コード例 #1
0
 def __init__(self, parent=None):
     super(QWidget, self).__init__(parent)
     self.setupUi(self)
     self.activated = False
     self.parent = parent
     self.custom = CustomFiltersTable(self)
     self.custom.setWindowFlags(Qt.Popup)
     self.connect(self.showFilters, SIGNAL("clicked(bool)"),
                  self.editFilters)
     self.connect(self.execFilter, SIGNAL("clicked(bool)"), self.runFilter)
コード例 #2
0
ファイル: filter.py プロジェクト: arxsys/dff-api
class FilterBar(Ui_filterBar, QWidget):
    def __init__(self, parent = None):
        super(QWidget, self).__init__(parent)
        self.setupUi(self)
        self.activated = False
        self.parent = parent
        self.custom = CustomFiltersTable(self)
        self.custom.setWindowFlags(Qt.Popup)
        self.connect(self.showFilters, SIGNAL("clicked(bool)"), self.editFilters)
        self.connect(self.execFilter, SIGNAL("clicked(bool)"), self.runFilter)
        
    def buildQuery(self):
        query = ""
        if self.filterEdit.text() != "":
            query += "(name == w(\"" + str(unicode(self.filterEdit.text()).encode('utf-8')) + "\"))"
        else:
            return None
        return query

    def runFilter(self):
        query = self.buildQuery()
        if query != None:
            self.parent.currentView().launchFilter(query)

    def editFilters(self):
        self.custom.setFixedWidth(self.filterEdit.width())
        self.custom.move(self.filterEdit.mapToGlobal(self.filterEdit.rect().bottomLeft()))
        self.custom.show()

    def autoEnabled(self):
        return self.autoApply.isChecked()
    
    def initStyleSheets(self):
        self.founded = "QLineEdit {background: #eeeeee;}"
        self.notfounded = "QLineEdit {background: #000000;}"
コード例 #3
0
ファイル: filter.py プロジェクト: arxsys/dff-api
 def __init__(self, parent = None):
     super(QWidget, self).__init__(parent)
     self.setupUi(self)
     self.activated = False
     self.parent = parent
     self.custom = CustomFiltersTable(self)
     self.custom.setWindowFlags(Qt.Popup)
     self.connect(self.showFilters, SIGNAL("clicked(bool)"), self.editFilters)
     self.connect(self.execFilter, SIGNAL("clicked(bool)"), self.runFilter)
コード例 #4
0
class FilterBar(Ui_filterBar, QWidget):
    def __init__(self, parent=None):
        super(QWidget, self).__init__(parent)
        self.setupUi(self)
        self.activated = False
        self.parent = parent
        self.custom = CustomFiltersTable(self)
        self.custom.setWindowFlags(Qt.Popup)
        self.connect(self.showFilters, SIGNAL("clicked(bool)"),
                     self.editFilters)
        self.connect(self.execFilter, SIGNAL("clicked(bool)"), self.runFilter)

    def buildQuery(self):
        query = ""
        if self.filterEdit.text() != "":
            query += "(name == w(\"" + str(
                unicode(self.filterEdit.text()).encode('utf-8')) + "\"))"
        else:
            return None
        return query

    def runFilter(self):
        query = self.buildQuery()
        if query != None:
            self.parent.currentView().launchFilter(query)

    def editFilters(self):
        self.custom.setFixedWidth(self.filterEdit.width())
        self.custom.move(
            self.filterEdit.mapToGlobal(self.filterEdit.rect().bottomLeft()))
        self.custom.show()

    def autoEnabled(self):
        return self.autoApply.isChecked()

    def initStyleSheets(self):
        self.founded = "QLineEdit {background: #eeeeee;}"
        self.notfounded = "QLineEdit {background: #000000;}"