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.

tut5.py 692B

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