# coding: gbk
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import sys
app = QApplication(sys.argv)
window = QWidget()
window.setWindowTitle("测试")
layout = QVBoxLayout()
window.setLayout(layout)
spinBox = QSpinBox()
layout.addWidget(spinBox)
slider = QSlider(Qt.Horizontal)
layout.addWidget(slider)
QObject.connect(spinBox, SIGNAL("valueChanged(int)"), slider, SLOT("setValue(int)"))
QObject.connect(slider, SIGNAL("valueChanged(int)"), spinBox, SLOT("setValue(int)"))
window.show()
sys.exit(app.exec())
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import sys
app = QApplication(sys.argv)
window = QWidget()
window.setWindowTitle("测试")
layout = QVBoxLayout()
window.setLayout(layout)
spinBox = QSpinBox()
layout.addWidget(spinBox)
slider = QSlider(Qt.Horizontal)
layout.addWidget(slider)
QObject.connect(spinBox, SIGNAL("valueChanged(int)"), slider, SLOT("setValue(int)"))
QObject.connect(slider, SIGNAL("valueChanged(int)"), spinBox, SLOT("setValue(int)"))
window.show()
sys.exit(app.exec())