[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyKDE] Draw Label in a grid
From:       Phil Thompson <phil () riverbankcomputing ! co ! uk>
Date:       2007-01-24 18:11:38
Message-ID: 200701241811.38362.phil () riverbankcomputing ! co ! uk
[Download RAW message or body]

On Wednesday 24 January 2007 5:58 pm, simon stockes wrote:
> 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)

You haven't added the grid layout to the main window.

Phil

_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic