Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

datetime editor emits editingfinished on date or time change

git-svn-id: http://projects.conceptive.be/camelot/svn/trunk@1606 8325946a-aa55-0410-8760-f0bc8c33efaa
  • Loading branch information...
commit e4850bd5751ca408a3e2ea6254cc69df9a02b79d 1 parent 45d6ca0
erikj authored
Showing with 11 additions and 1 deletion.
  1. +11 −1 camelot/view/controls/editors/datetimeeditor.py
View
12 camelot/view/controls/editors/datetimeeditor.py
@@ -24,6 +24,7 @@ def __init__(self,
self.dateedit.setEnabled(editable)
self.dateedit.setDisplayFormat(dateformat)
self.dateedit.setCalendarPopup(True)
+ self.dateedit.dateChanged.connect( self.editing_finished )
layout.addWidget(self.dateedit, 1)
class TimeValidator(QtGui.QValidator):
@@ -56,6 +57,8 @@ def validate(self, input, pos):
for i in range(0,24)))]
self.timeedit.addItems(time_entries)
self.timeedit.setValidator(TimeValidator(self))
+ self.timeedit.currentIndexChanged.connect( self.editing_finished )
+ self.timeedit.editTextChanged.connect( self.editing_finished )
# self.timeedit = QtGui.QTimeEdit(self)
# self.timeedit.setDisplayFormat(timeformat)
@@ -80,7 +83,14 @@ def validate(self, input, pos):
layout.setMargin(0)
layout.setSpacing(0)
layout.addStretch(1)
-
+
+ @QtCore.pyqtSlot(QtCore.QDate)
+ @QtCore.pyqtSlot(QtCore.QString)
+ @QtCore.pyqtSlot(int)
+ def editing_finished(self, _arg):
+ if self.time() and self.date():
+ self.editingFinished.emit()
+
def get_value(self):
time_value = self.time()
date_value = self.date()
Please sign in to comment.
Something went wrong with that request. Please try again.