You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
761 B
33 lines
761 B
13 years ago
|
#!/usr/bin/env python
|
||
|
|
||
13 years ago
|
# TQt tutorial 5.
|
||
13 years ago
|
|
||
|
import sys
|
||
8 years ago
|
from python_tqt import qt
|
||
13 years ago
|
|
||
|
|
||
13 years ago
|
class MyWidget(qt.TQVBox):
|
||
13 years ago
|
def __init__(self, parent=None, name=None):
|
||
13 years ago
|
qt.TQVBox.__init__(self, parent, name)
|
||
13 years ago
|
|
||
13 years ago
|
quit = qt.TQPushButton("Quit", self, "quit")
|
||
|
quit.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold))
|
||
13 years ago
|
|
||
8 years ago
|
self.connect(quit, qt.SIGNAL("clicked()"), qt.tqApp, qt.SLOT("quit()"))
|
||
13 years ago
|
|
||
13 years ago
|
lcd = qt.TQLCDNumber(2, self, "lcd")
|
||
13 years ago
|
|
||
13 years ago
|
slider = qt.TQSlider(qt.TQt.Horizontal, self, "slider")
|
||
13 years ago
|
slider.setRange(0, 99)
|
||
|
slider.setValue(0)
|
||
|
|
||
|
self.connect(slider, qt.SIGNAL("valueChanged(int)"), lcd, qt.SLOT("display(int)"))
|
||
|
|
||
|
|
||
13 years ago
|
a = qt.TQApplication(sys.argv)
|
||
13 years ago
|
|
||
|
w = MyWidget()
|
||
|
a.setMainWidget(w)
|
||
|
w.show()
|
||
|
sys.exit(a.exec_loop())
|