[Qt-interest] MDI sub windows too small & setting widget bg image

velociraptor Genjix aphidia at hotmail.com
Mon Oct 18 19:53:32 CEST 2010


Hello!
I'm using MDI sub windows. On the sub windows is my custom widget. Unless I place a layout object and another widget inside it on my custom widget, then the mdi sub window will be -1,-1 eventhough the widget itself is (100,100) [you can see it by resizing the mdi sub window]
class MdiTable(QtGui.QWidget):    sequenceNumber = 1
    def __init__(self):        super(MdiTable, self).__init__()        self.resize(100,100)
        b = QtGui.QTextEdit()
        box = QtGui.QHBoxLayout()        box.addWidget(b)
        self.setLayout(box)
I'd rather just have my widget be a resizable size X, Y and place the widgets inside. How can I do this?
Also how do I set a background image for the widget? This code doesn't work for me:
        pix = QtGui.QPixmap('/images/carl_sagan.jpg')        p = QtGui.QPalette()        p.setBrush(QtGui.QPalette.Background, pix)        self.setPalette(p)
Thanks! 		 	   		  



More information about the Qt-interest-old mailing list