Created
October 30, 2012 06:03
-
-
Save ragnraok/3978565 to your computer and use it in GitHub Desktop.
PyQt4SingalAndSlot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf8 -*- | |
import sys | |
from PyQt4.QtCore import * | |
from PyQt4.QtGui import * | |
class Form(QDialog): | |
def __init__(self, parent=None): | |
super(Form, self).__init__(parent) | |
dial = QDial() | |
dial.setNotchesVisible(True) | |
spinbox = QSpinBox() | |
layout = QHBoxLayout() | |
layout.addWidget(dial) | |
layout.addWidget(spinbox) | |
self.setLayout(layout) | |
self.connect(dial, SIGNAL("valueChanged(int)"), | |
spinbox, SLOT("setValue(int)")) | |
self.connect(spinbox, SIGNAL("valueChanged(int)"), | |
dial, SLOT("setValue(int)")) | |
self.setWindowTitle("SignalAndSlot") | |
app = QApplication(sys.argv) | |
form = Form() | |
form.show() | |
app.exec_() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment