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
[EMAIL PROTECTED]
-- 
Mark Rages, Engineer
Midwest Telecine LLC
[EMAIL PROTECTED]
_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to