[PyKDE] Draw Label in a grid (2)

simon stockes simonstockes at gmail.com
Wed Jan 24 18:06:54 GMT 2007


Sorry for the first message. I did not finish my mail.

So, The code below is supposed to draw 2 labels in a grid.
For me the 2 labels are painted at the same place when I run the code !!
Why this superposition ?

Simon

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/2a063f4b/attachment.html


More information about the PyQt mailing list