Hi,
Im having problems with adjusting the sizes of the widget in my
splitters. I have two splitters, a vertical and a horizontal one. The
father of the horizontal splitter is the vertical splitter and I use the
following code piece to add the widget to the splitters:
MyDockWidget dockWid = new MyDockWidget();
dockWid.setAttribute(Qt.WidgetAttribute.WA_DeleteOnClose, true);
dockWid.setObjectName("dockWid"+imageInCentralWidget++);
dockWid.setFeatures(com.trolltech.qt.gui.QDockWidget.DockWidgetFeature.createQFlags(com.trolltech.qt.gui.QDockWidget.DockWidgetFeature.NoDockWidgetFeatures));
switch(imageInCentralWidget){
case 1:
spliterH.addWidget(dockWid);
break;
case 2:
spliterH.addWidget(dockWid);
break;
case 3:
spliterV.addWidget(dockWid);
dockWid.resize(centralWidget().width(),
centralWidget().height() / 2);
break;
}
What happens in th switch is. case 1: The dockWid is added and it takes
the whole area of the centralWidget() - Good. Then in case 2: The second
widget is added horizontally and both widget are resized so they have
equal widths and heihts (they splitt the central widget area equally) -
God. And for case 3: The third dockWid is added Vertically beneath both
upper widget but unfortunately it takes most of the space, something
like 80% of the centralWidget() height. I would like it to also split
the centralwidgets height equally between it and the upper two widgets.
As you can see I tryed to do it with the resize(centralWidget().width(),
centralWidget().height() / 2); but it wont work. I also tryed variuos
sizePolicy setups but apparently I dont understand something.
I'd be thankfull for all the help.
Dave
_______________________________________________
Qt-jambi-interest mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest