码迷,mamicode.com
首页 > 其他好文 > 详细

pyqt2015有效范围

时间:2014-11-27 14:22:19      阅读:162      评论:0      收藏:0      [点我收藏+]

标签: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_())

 如图:bubuko.com,布布扣

pyqt2015有效范围

标签:blog   http   io   ar   sp   on   2014   log   bs   

原文地址:http://www.cnblogs.com/mhxy13867806343/p/4126169.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!