[PyQt] help with QSplitter and showMaximized?

inhahe inhahe at gmail.com
Sat Sep 6 06:08:51 BST 2008


Hi, can someone help me with this
i'm new to Qt so it could be something simple..

--

from PyQt4.QtGui import *
app = QApplication([])
mainWin = QMainWindow()
mainWin.showMaximized()
menu = mainWin.menuBar()
menu.addAction("test")
frame = QFrame(mainWin)
frame.move(0, menu.height())
Vsplitter = QSplitter(frame)
testlbl = QLabel('test')
Vsplitter.addWidget(testlbl)
mainWin.show()
app.exec_()

--

The problem is that the 'test' label doesn't show up because of the
showMaximized call.  If I put that at the end of everything else, the
test label shows up.  Or if I leave it out, run it, then click the
maximize button the test label is still there.  In my actual app I
can't just put showmaximized at the end because some things will need
to be added dynamically.

Also, the reason I use the frame is that if I don't, the test label
and the menu bar try to take up the same space..

thx
-inhahe


More information about the PyQt mailing list