File: load_ui2.py

package info (click to toggle)
python-qt4 4.7.3-1%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 28,504 kB
  • ctags: 4,680
  • sloc: python: 28,738; cpp: 8,897; sh: 245; xml: 243; makefile: 150
file content (23 lines) | stat: -rwxr-xr-x 449 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python

import sys

from PyQt4 import QtCore, QtGui, uic


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

        uic.loadUi('demo.ui', self)

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


app = QtGui.QApplication(sys.argv)
widget = DemoImpl()
widget.show()
sys.exit(app.exec_())