PDA

View Full Version : QMainWindow && QToolBox



eleanor
21st October 2007, 19:57
Hi, I have a problem: I have a main window where I add centralWidget().
The class inherits QMainWindow.



QToolBox *m_pToolbox = new QToolBox();
QTabWidget *m_pTabVnos = new QTabWidget();
m_pToolbox->addItem(m_pTabVnos,trUtf8("Insert));
setCentralWidget(m_pToolbox);


Now I want this widget not to resize itself through all the central widget.
I want this QToolBox to be 1/3 of the width of the central widget (like in kpdf program).
The rest of the space (so 2/3 of the width) will be empty or now.

How can I do that?

wysota
21st October 2007, 20:11
Create a widget with a horizontal layout and two child widgets - the toolbox and an empty widget (like QWidget). If you want to have 1:2 proportions, set horizontal stretches of respective widgets to 1 and 2. Finally set the widget containing the two mentioned child widgets as a central widget for your main window.