#
# this is hello_world.py - an example how to use Qt with python
#
# (c) 1998 Matthias Hoelzer
#


## 1) include all the needed libraries

from qt.application import *
from qt.widget import *
from qt.pushbutton import *
from qt.label import *
from qt.font import *


## 2) create an application object. 
##      (Command line parameters are passed automatically)

a = Application()


## 3) create the main widget

w = Widget()


## 4) add some text

l = Label("Hello World!",w)
l.move((16,8))
l.setFont(Font("Courier",24))
l.adjustSize()


## 5) add an pushbutton to quit

def quit():
    a.quit()

b = PushButton("Quit", w)
b.connect("pressed", quit)
b.move((16, 50))
b.adjustSize()


## 6) make the widget the application's main widget

w.show()
a.setMainWidget(w)


## 7) execute the application

a.execute()


## 8) clean up the application

del a