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 761B

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