PDA

View Full Version : PyQt layout got squeezed.


Panupat
08-22-2012, 06:42 AM
I'm trying to create UI from Qt Designer and am having some weird problem.

Laying out labels and combo boxes, no problem
Putting them into QHBoxLayout, no problem

But as soon as I apply Lay Out to the whole thing, everything got squeezed into the corner. Happens in both Maya 2011 and 2012. The UI looks fine in Qt Designer.

http://img210.imageshack.us/img210/7756/pyqtsqueeze.png

Am I overlooking something?

I'm using uic to display the ui.


class UI(QtGui.QMainWindow):
def __init__(self, parent=getMayaWindow()):
QtGui.QMainWindow.__init__(self, parent)
self.ui = uic.loadUi('%sassetLib.ui' % UIPATH, self)

test = UI()
test.ui.show()

fezz
08-23-2012, 05:49 PM
Try:



class UI(QtGui.QMainWindow):
def __init__(self, parent=getMayaWindow()):
QtGui.QMainWindow.__init__(self, parent)
self.ui = uic.loadUi('%sassetLib.ui' % UIPATH, self)
self.setCentralWidget(self.ui)

test = UI()
test.ui.show()

CGTalk Moderation
08-23-2012, 05:49 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.