i have made this:
def keyPressEvent(self, event):
if event.key() == Qt.Key_Enter or event.key() == Qt.Key_Return and (self.okButton.hasFocus() or self.cancelButton.hasFocus()):
print "test"
event.accept()
else:
def keyPressEvent(self, event):
if event.key() == Qt.Key_Enter or event.key() == Qt.Key_Return and (self.okButton.hasFocus() or self.cancelButton.hasFocus()):
print "test"
event.accept()
else:
QDialog.keyPressEvent(self, event)
To copy to clipboard, switch view to plain text mode
and i still have the same problem, when i press the enter in the doublespinbox, the okButton get the focus and automatically it is clicked.
Bookmarks