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.
42 lines
1008 B
42 lines
1008 B
13 years ago
|
#!/usr/bin/env python
|
||
|
|
||
13 years ago
|
# TQt tutorial 6.
|
||
13 years ago
|
|
||
|
import sys
|
||
8 years ago
|
from python_tqt import qt
|
||
13 years ago
|
|
||
|
|
||
13 years ago
|
class LCDRange(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
|
lcd = qt.TQLCDNumber(2, self, "lcd")
|
||
|
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
|
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
|
grid = qt.TQGrid(4, self)
|
||
13 years ago
|
|
||
|
for c in range(4):
|
||
|
for r in range(4):
|
||
|
LCDRange(grid)
|
||
|
|
||
|
|
||
13 years ago
|
a = qt.TQApplication(sys.argv)
|
||
13 years ago
|
|
||
|
w = MyWidget()
|
||
|
a.setMainWidget(w)
|
||
|
w.show()
|
||
|
sys.exit(a.exec_loop())
|