Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
fastdev:python_qt [2009/11/03 12:56] memeruizfastdev:python_qt [2009/11/11 11:35] (current) memeruiz
Line 1: Line 1:
 +====== 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_())
  
 
Recent changes RSS feed Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki