Skip to content

Instantly share code, notes, and snippets.

@quazgar
Forked from anonymous/returnPressed
Last active August 29, 2015 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quazgar/7b72b08f069a1ecf0ce2 to your computer and use it in GitHub Desktop.
Save quazgar/7b72b08f069a1ecf0ce2 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import PySide.QtGui as QtGui
from PySide.QtGui import QApplication, QMainWindow
import sys
class TestWindow(QMainWindow):
def __init__(self):
super(TestWindow, self).__init__()
self.spinbox = QtGui.QDoubleSpinBox(self)
self.spinbox.lineEdit().returnPressed.connect(
self.test_method)
self.spinbox.lineEdit().editingFinished.connect(
self.test_finished)
def test_method(self):
print("Return pressed.")
def test_finished(self):
print("Editing finished.")
app = QtGui.QApplication(sys.argv)
w = TestWindow()
w.show()
sys.exit(app.exec_())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment