Пример #1
0
class FilterTagWidget(QtGui.QWidget, object):
    value_changed = QtCore.pyqtSignal()

    def __init__(self, parent=None):
        super(FilterTagWidget, self).__init__(parent)
        self.active = False
        self.tag_widget = CurveTagWidget()
        self.lay = QtGui.QVBoxLayout()
        self.setLayout(self.lay)
        self.lay.addWidget(self.tag_widget)
        self.button_filter_by_tag = QtGui.QPushButton('filter by tag')
        self.lay.addWidget(self.button_filter_by_tag)
        self.button_remove = QtGui.QPushButton('remove \ntag filter')
        self.lay.addWidget(self.button_remove)
        self.button_remove.pressed.connect(self.remove)
        self.button_filter_by_tag.pressed.connect(self.filter_by_tag)
        self.remove()
        self.tag_widget.value_changed.connect(self.value_changed)

    def filter_by_tag(self):
        self.active = True
        self.tag_widget.show()
        self.button_filter_by_tag.hide()
        self.button_remove.show()
        self.value_changed.emit()

    def remove(self):
        self.active = False
        self.button_remove.hide()
        self.tag_widget.hide()
        self.button_filter_by_tag.show()
        self.value_changed.emit()

    def get_tags(self):
        return self.tag_widget.get_tags()
Пример #2
0
 def __init__(self, parent=None):
     super(FilterTagWidget, self).__init__(parent)
     self.active = False
     self.tag_widget = CurveTagWidget()
     self.lay = QtGui.QVBoxLayout()
     self.setLayout(self.lay)
     self.lay.addWidget(self.tag_widget)
     self.button_filter_by_tag = QtGui.QPushButton('filter by tag')
     self.lay.addWidget(self.button_filter_by_tag)
     self.button_remove = QtGui.QPushButton('remove \ntag filter')
     self.lay.addWidget(self.button_remove)
     self.button_remove.pressed.connect(self.remove)
     self.button_filter_by_tag.pressed.connect(self.filter_by_tag)
     self.remove()
     self.tag_widget.value_changed.connect(self.value_changed)
class FilterTagWidget(QtGui.QWidget, object):
    value_changed = QtCore.pyqtSignal()

    def __init__(self, parent=None):
        super(FilterTagWidget, self).__init__(parent)
        self.active = False
        self.tag_widget = CurveTagWidget()
        self.lay = QtGui.QVBoxLayout()
        self.setLayout(self.lay)
        self.lay.addWidget(self.tag_widget)
        self.button_filter_by_tag = QtGui.QPushButton('filter by tag')
        self.lay.addWidget(self.button_filter_by_tag)
        self.button_remove = QtGui.QPushButton('remove \ntag filter')
        self.lay.addWidget(self.button_remove)
        self.button_remove.pressed.connect(self.remove)
        self.button_filter_by_tag.pressed.connect(self.filter_by_tag)        
        self.remove()
        self.tag_widget.value_changed.connect(self.value_changed)
        self.lay.setMargin(0)
        
    def filter_by_tag(self):
        self.active = True
        self.tag_widget.show()
        self.button_filter_by_tag.hide()
        self.button_remove.show()
        self.value_changed.emit()
        
    def remove(self):
        self.active = False
        self.button_remove.hide()
        self.tag_widget.hide()
        self.button_filter_by_tag.show()
        self.value_changed.emit()
        
    
    def get_tags(self):
        return self.tag_widget.get_tags()
 def __init__(self, parent=None):
     super(FilterTagWidget, self).__init__(parent)
     self.active = False
     self.tag_widget = CurveTagWidget()
     self.lay = QtGui.QVBoxLayout()
     self.setLayout(self.lay)
     self.lay.addWidget(self.tag_widget)
     self.button_filter_by_tag = QtGui.QPushButton('filter by tag')
     self.lay.addWidget(self.button_filter_by_tag)
     self.button_remove = QtGui.QPushButton('remove \ntag filter')
     self.lay.addWidget(self.button_remove)
     self.button_remove.pressed.connect(self.remove)
     self.button_filter_by_tag.pressed.connect(self.filter_by_tag)        
     self.remove()
     self.tag_widget.value_changed.connect(self.value_changed)