Пример #1
0
        
class DateFilterWidget(QtGui.QGroupBox):
    """Filter widget based on a DateEditor"""
  
    filter_changed_signal = QtCore.pyqtSignal()
    
    def __init__(self, name, query_decorator, parent):
        QtGui.QGroupBox.__init__(self, unicode(name), parent)
        layout = QtGui.QVBoxLayout()
        self.date_editor = DateEditor(parent=self, nullable=True)
        self.date_editor.set_value(datetime.date.today())
        self.query_decorator = query_decorator
        layout.addWidget(self.date_editor)
        self.setLayout(layout)
        self.date_editor.editingFinished.connect(self.emit_filter_changed)
            
    @QtCore.pyqtSlot()
    def emit_filter_changed(self):
        self.filter_changed_signal.emit()
        
    def decorate_query(self, query):
Пример #2
0
class DateFilterWidget(QtGui.QGroupBox):
    """Filter widget based on a DateEditor"""

    filter_changed_signal = QtCore.pyqtSignal()

    def __init__(self, name, query_decorator, parent):
        QtGui.QGroupBox.__init__(self, unicode(name), parent)
        layout = QtGui.QVBoxLayout()
        self.date_editor = DateEditor(parent=self, nullable=True)
        self.date_editor.set_value(datetime.date.today())
        self.query_decorator = query_decorator
        layout.addWidget(self.date_editor)
        self.setLayout(layout)
        self.date_editor.editingFinished.connect(self.emit_filter_changed)

    @QtCore.pyqtSlot()
    def emit_filter_changed(self):
        self.filter_changed_signal.emit()

    def decorate_query(self, query):
        return self.query_decorator(query, self.date_editor.get_value())
Пример #3
0
class DateFilterWidget( QtGui.QGroupBox ):
    """Filter widget based on a DateEditor"""
  
    filter_changed_signal = QtCore.pyqtSignal()
    
    def __init__( self, filter_data, parent ):
        super( DateFilterWidget, self ).__init__( unicode( filter_data.name ), parent )
        layout = QtGui.QVBoxLayout()
        layout.setSpacing( 2 )
        self.date_editor = DateEditor(parent=self, nullable=True)
        self.date_editor.set_value( filter_data.default )
        for option in filter_data.options:
            self.query_decorator = option.decorator
        layout.addWidget( self.date_editor )
        self.setLayout( layout )
        self.date_editor.editingFinished.connect( self.emit_filter_changed )
            
    @QtCore.pyqtSlot()
    def emit_filter_changed(self):
        self.filter_changed_signal.emit()
        
    def decorate_query(self, query):
        return self.query_decorator(query, self.date_editor.get_value())
Пример #4
0
class DateFilterWidget( QtGui.QGroupBox ):
    """Filter widget based on a DateEditor"""
  
    filter_changed_signal = QtCore.pyqtSignal()
    
    def __init__( self, filter_data, parent ):
        super( DateFilterWidget, self ).__init__( unicode( filter_data.name ), parent )
        layout = QtGui.QVBoxLayout()
        layout.setSpacing( 2 )
        self.date_editor = DateEditor(parent=self, nullable=True)
        self.date_editor.set_value( filter_data.default )
        for option in filter_data.options:
            self.query_decorator = option.decorator
        layout.addWidget( self.date_editor )
        self.setLayout( layout )
        self.date_editor.editingFinished.connect( self.emit_filter_changed )
            
    @QtCore.pyqtSlot()
    def emit_filter_changed(self):
        self.filter_changed_signal.emit()
        
    def decorate_query(self, query):
        return self.query_decorator(query, self.date_editor.get_value())