示例#1
0
 def __init__(self, parent, format):
     QDateTimeEdit.__init__(self, parent)
     self.setFrame(False)
     self.setMinimumDateTime(UNDEFINED_QDATETIME)
     self.setSpecialValueText(_('Undefined'))
     self.setCalendarPopup(True)
     self.setDisplayFormat(format)
示例#2
0
 def __init__(self, parent, format):
     QDateTimeEdit.__init__(self, parent)
     self.setFrame(False)
     self.setMinimumDateTime(UNDEFINED_QDATETIME)
     self.setSpecialValueText(_('Undefined'))
     self.setCalendarPopup(True)
     self.setDisplayFormat(format)
示例#3
0
 def __init__(self, parent):
     QDateTimeEdit.__init__(self, parent)
     self.setToolTip(self.TOOLTIP)
     self.setWhatsThis(self.TOOLTIP)
     fmt = tweaks[self.TWEAK]
     if fmt is None:
         fmt = self.FMT
     self.setDisplayFormat(fmt)
     self.setCalendarPopup(True)
     self.setMinimumDateTime(UNDEFINED_QDATETIME)
     self.setSpecialValueText(_('Undefined'))
     self.clear_button = QToolButton(parent)
     self.clear_button.setIcon(QIcon(I('trash.png')))
     self.clear_button.setToolTip(_('Clear date'))
     self.clear_button.clicked.connect(self.reset_date)
示例#4
0
 def __init__(self, parent):
     QDateTimeEdit.__init__(self, parent)
     self.setToolTip(self.TOOLTIP)
     self.setWhatsThis(self.TOOLTIP)
     fmt = tweaks[self.TWEAK]
     if fmt is None:
         fmt = self.FMT
     self.setDisplayFormat(fmt)
     self.setCalendarPopup(True)
     self.setMinimumDateTime(UNDEFINED_QDATETIME)
     self.setSpecialValueText(_('Undefined'))
     self.clear_button = QToolButton(parent)
     self.clear_button.setIcon(QIcon(I('trash.png')))
     self.clear_button.setToolTip(_('Clear date'))
     self.clear_button.clicked.connect(self.reset_date)
 def keyPressEvent(self, ev):
     if ev.key() == Qt.Key_Minus:
         ev.accept()
         self.setDateTime(self.minimumDateTime())
     elif ev.key() == Qt.Key_Equal:
         ev.accept()
         self.setDateTime(QDateTime.currentDateTime())
     else:
         return QDateTimeEdit.keyPressEvent(self, ev)
示例#6
0
 def keyPressEvent(self, ev):
     if ev.key() == Qt.Key_Minus:
         ev.accept()
         self.setDateTime(self.minimumDateTime())
     elif ev.key() == Qt.Key_Equal:
         ev.accept()
         self.setDateTime(QDateTime.currentDateTime())
     else:
         return QDateTimeEdit.keyPressEvent(self, ev)
示例#7
0
 def keyPressEvent(self, ev):
     if ev.key() == Qt.Key_Minus:
         ev.accept()
         self.setDateTime(UNDEFINED_QDATETIME)
     elif ev.key() == Qt.Key_Equal:
         ev.accept()
         self.setDateTime(QDateTime.currentDateTime())
     else:
         return QDateTimeEdit.keyPressEvent(self, ev)
示例#8
0
 def keyPressEvent(self, ev):
     if ev.key() == Qt.Key_Minus:
         ev.accept()
         self.setDateTime(UNDEFINED_QDATETIME)
     elif ev.key() == Qt.Key_Equal:
         ev.accept()
         self.setDateTime(QDateTime.currentDateTime())
     else:
         return QDateTimeEdit.keyPressEvent(self, ev)
 def focusOutEvent(self, x):
     self.setSpecialValueText(_('Undefined'))
     QDateTimeEdit.focusOutEvent(self, x)
 def focusInEvent(self, x):
     self.setSpecialValueText('')
     QDateTimeEdit.focusInEvent(self, x)
示例#11
0
 def focusOutEvent(self, x):
     self.setSpecialValueText(_('Undefined'))
     QDateTimeEdit.focusOutEvent(self, x)
示例#12
0
 def focusInEvent(self, x):
     self.setSpecialValueText('')
     QDateTimeEdit.focusInEvent(self, x)