标签:blog http io ar sp on 2014 log bs
from PyQt4.Qt import *
from PyQt4.QtGui import *
from PyQt4.QtCore import *
import sys
class A(QWidget):
def __init__(self,parnt=None):
super(A,self).__init__(parnt)
win=QWidget(self)
win.setWindowTitle(‘Age‘)
box=QSpinBox(self)
der=QSlider(Qt.Horizontal)
#有效范围
box.setRange(0,130)
der.setRange(0,130)
QObject.connect(box,SIGNAL(‘valueChanged(int)‘),der,SLOT(‘setValue(int)‘))
QObject.connect(der,SIGNAL(‘valueChanged(int)‘),box,SLOT(‘setValue(int)‘))
box.setValue(35)
layout=QHBoxLayout()
layout.addWidget(box)
layout.addWidget(der)
win.setLayout(layout)
app=QApplication(sys.argv)
a=A()
a.show()
sys.exit(app.exec_())
如图:
标签:blog http io ar sp on 2014 log bs
原文地址:http://www.cnblogs.com/mhxy13867806343/p/4126169.html