[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: [PyQt] Centering inside groupbox... newbie question
From: "Mark Rages" <markrages () gmail ! com>
Date: 2007-11-29 18:50:16
Message-ID: 74ee72ca0711291050m7afa1804g6c2ef3ce3c46fff3 () mail ! gmail ! com
[Download RAW message or body]
Hi,
I'm new to PyQt and Qt in general.
I want to make a QGroupBox containing a centered QLabel. The QLabel
needs to remain centered as the groupbox is resized.
It is easy to make a QLabel that stays centered:
#!/usr/bin/python2.4
import sys
import qt
a = qt.QApplication(sys.argv)
textlabel=qt.QLabel("textlabel",None)
textlabel.setAlignment(qt.QLabel.AlignCenter)
a.setMainWidget(textlabel)
textlabel.show()
a.exec_loop()
# end program
But I can't seem to get the same behaviour inside the groupbox:
#!/usr/bin/python2.4
import sys
import qt
a = qt.QApplication(sys.argv)
gb = qt.QHGroupBox("gblabel",None)
textlabel=qt.QLabel("textlabel",gb)
textlabel.setAlignment(qt.QLabel.AlignCenter)
a.setMainWidget(gb)
gb.show()
a.exec_loop()
#end program
The label stays contered horizontally, but hugs the top of the groupbox.
What am I missing?
Regards,
Mark
markrages@gmail
--
Mark Rages, Engineer
Midwest Telecine LLC
markrages@midwesttelecine.com
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic