[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: [PyKDE] Draw Label in a grid (2)
From: "simon stockes" <simonstockes () gmail ! com>
Date: 2007-01-24 18:06:54
Message-ID: f36398ff0701241006q52603399xce9796699ac8e357 () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
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)
[Attachment #5 (text/html)]
Sorry for the first message. I did not finish my mail.<br><br>So, The code below is \
supposed to draw 2 labels in a grid.<br>For me the 2 labels are painted at the same \
place when I run the code !!<br>Why this superposition ? <br><br>Simon<br><br>import \
sys<br>from PyQt4 import QtGui, QtCore<br><br>class \
MainWindow(QtGui.QMainWindow):<br><br> def __init__(self, \
*args):<br> \
QtGui.QMainWindow.__init__(self)<br> \
self.setWindowTitle ("DE")<br> \
self.gridlayout = QtGui.QGridLayout()<br> \
self.gridlayout.setMargin(9)<br> \
self.gridlayout.setSpacing(6)<br> \
self.gridlayout.setObjectName("gridlayout")<br> \
self.gridlayout.addWidget(QtGui.QLabel("foo",self),0,1)<br> \
self.gridlayout.addWidget(QtGui.QLabel("fAn",self),0,2)<br><br>def \
main(args):<br> app=QtGui.QApplication(args)<br> \
win=MainWindow() <br> win.show()<br> \
app.connect(app, QtCore.SIGNAL("lastWindowClosed()")<br> &n \
bsp; &nbs \
p; \
, app<br>   \
; \
, QtCore.SLOT("quit()")<br> & \
nbsp; \
) <br> sys.exit(app.exec_())<br><br>if \
__name__=="__main__":<br> main(sys.argv)
_______________________________________________
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