저는 Python 및 PySide에서 간단한 응용 프로그램을 작성했습니다. 실행하면 신호가 작동하지 않습니다. 응용 프로그램이 오류없이 시작됩니다.신호가 PySide에서 작동하지 않습니다.
from PySide.QtCore import *
from PySide.QtGui import *
import sys
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("valueChaged(int)"), spinbox.setValue)
self.connect(spinbox, SIGNAL("valueChaged(int)"), dial.setValue)
self.setWindowTitle("Signals and Slots")
# END def __init__
# END class Form
def main():
app = QApplication(sys.argv)
form = Form()
form.show()
app.exec_()
# END def main
if __name__ == '__main__':
main()
# END if
내가 사용하고 있습니다 :
Pyside 1.2.2; Python 2.7.6; OS Centos; 윈도우 7
내가 가진 응용 프로그램을 실행하고 있습니다 :
숭고한 텍스트 3 이클립스 루나;
신호를 작동 시키려면 어떻게해야합니까?
Btw. 새로운 스타일의 신호 구문 인'dial.valueChanged.connect (spinbox.setValue)'를 사용하면 에러가 발생합니다. – Trilarion