SIP4 python bindings for TQt
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.

tut6.py 925B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/usr/bin/env python
  2. # TQt tutorial 6.
  3. import sys
  4. from python_tqt.qt import *
  5. class LCDRange(TQVBox):
  6. def __init__(self,parent=None,name=None):
  7. TQVBox.__init__(self,parent,name)
  8. lcd = TQLCDNumber(2,self,"lcd")
  9. slider = TQSlider(TQt.Horizontal,self,"slider")
  10. slider.setRange(0,99)
  11. slider.setValue(0)
  12. self.connect(slider,SIGNAL("valueChanged(int)"),lcd,SLOT("display(int)"))
  13. class MyWidget(TQVBox):
  14. def __init__(self,parent=None,name=None):
  15. TQVBox.__init__(self,parent,name)
  16. quit = TQPushButton("Quit",self,"quit")
  17. quit.setFont(TQFont("Times",18,TQFont.Bold))
  18. self.connect(quit,SIGNAL("clicked()"),tqApp,SLOT("quit()"))
  19. grid = TQGrid(4,self)
  20. for c in range(4):
  21. for r in range(4):
  22. LCDRange(grid)
  23. a = TQApplication(sys.argv)
  24. w = MyWidget()
  25. a.setMainWidget(w)
  26. w.show()
  27. a.exec_loop()