I'm trying to add QWidget to a QMainWindow but I cannot figure out how to 
make it resize properly.

Top - if I show the widget by itself.
Bottom - the widget added to QMainWindow. 

Am I doing something wrong?



class LayerInfoWidget(QtGui.QWidget):
    def __init__(self, parent = None):
        super(LayerInfoWidget, self).__init__(parent)
        
        self.hLayout = QtGui.QHBoxLayout(self)



        self.label = QtGui.QLabel(self)

        self.label.setText('Pass Name Here')
        
        self.enabled = QtGui.QCheckBox(self)
        self.enabled.setChecked(True)
        
        self.frameList = QtGui.QLineEdit(self)
        self.frameList.setText('1-10')
        
        self.passName = QtGui.QLineEdit(self)
        self.passName.setText('Filename - PASS')
        
        self.hLayout.addWidget(self.label)
        self.hLayout.addWidget(self.enabled)
        self.hLayout.addWidget(self.frameList)
        self.hLayout.addWidget(self.passName)
        
        self.setLayout(self.hLayout)
        


mainwin = QtGui.QMainWindow()
vLayout = QtGui.QVBoxLayout(mainwin)
mywidget = LayerInfoWidget(parent=mainwin)
vLayout.addWidget(mywidget)
mainwin.setLayout(vLayout)

mainwin.show()
mainwin.raise_()



-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/6b9b3864-1a4c-43f1-9c1a-23e54bd73bb1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to