take ownership of QApplication in tutorials
[lqt.git] / test / t3.lua
blobf793954b0f0885daa693cd44604c4c74c5edf550
1 #!/usr/bin/lua
3 require'qtgui'
5 app = QApplication.new(select('#', ...), {...})
6 app.__gc = app.delete -- take ownership of object
8 window = QWidget.new()
9 window:resize(200, 120)
11 quit = QPushButton.new(QString.new("Quit"), window)
12 quit:setFont(QFont.new(QString.new'Times', 18, 75))
13 quit:setGeometry(10, 40, 180, 40)
15 QObject.connect(quit, '2clicked()', app, '1quit()')
17 window:show()
19 app.exec()