File: compile-on-the-fly.py

package info (click to toggle)
python-qt4 4.4.2-4
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 24,888 kB
  • ctags: 3,771
  • sloc: python: 42,056; cpp: 4,369; sh: 482; xml: 164; makefile: 160
file content (24 lines) | stat: -rwxr-xr-x 498 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env python
import sys

from PyQt4 import QtCore, QtGui, uic


app = QtGui.QApplication(sys.argv)
form_class, base_class = uic.loadUiType("demo.ui")

class DemoImpl(QtGui.QDialog, form_class):
    def __init__(self, *args):
        QtGui.QWidget.__init__(self, *args)

        self.setupUi(self)
    
    @QtCore.pyqtSignature("")
    def on_button1_clicked(self):
        for s in "This is a demo".split(" "):
            self.list.addItem(s)


form = DemoImpl()
form.show()
app.exec_()