Python + Qt

This explains how to program a very simple application with python and QT.

import sys
from PyQt4 import QtGui,QtCore
app=QtGui.QApplication(sys.argv)
main_widget=QtGui.QWidget()
button=QtGui.QPushButton("test", main_widget)
main_widget.show()
main_widget.setWindowTitle("test application")
def testprint():
   print "Works"
QtCore.QObject.connect(button,QtCore.SIGNAL("clicked()"),testprint)
sys.exit(app.exec_())
 
fastdev/python_qt.txt · Last modified: 2009/11/11 11:35 by memeruiz · [Old revisions]
Recent changes RSS feed Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki