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)
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;}"
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)
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;}"