[PyKDE] Draw Label in a grid

simon stockes simonstockes at gmail.com
Wed Jan 24 17:58:37 GMT 2007


The code below is supposed to draw

import sys
from PyQt4 import QtGui, QtCore

class MainWindow(QtGui.QMainWindow):

    def __init__(self, *args):
        QtGui.QMainWindow.__init__(self)
        self.setWindowTitle("DE")
        self.gridlayout = QtGui.QGridLayout()
        self.gridlayout.setMargin(9)
        self.gridlayout.setSpacing(6)
        self.gridlayout.setObjectName("gridlayout")
        self.gridlayout.addWidget(QtGui.QLabel("foo",self),0,1)
        self.gridlayout.addWidget(QtGui.QLabel("fAn",self),0,2)

def main(args):
    app=QtGui.QApplication(args)
    win=MainWindow()
    win.show()
    app.connect(app, QtCore.SIGNAL("lastWindowClosed()")
                                 , app
                                 , QtCore.SLOT("quit()")
                                 )
    sys.exit(app.exec_())

if __name__=="__main__":
    main(sys.argv)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20070124/cf1a454f/attachment.html


More information about the PyQt mailing list