PDA

View Full Version : QMainWindow Maximization Issue



vishal.chauhan
15th March 2007, 08:22
Hi All,

I m using Qt 4.2.2 on my Intel Mac.
I Have a Issue with QMainWindow.

I have a QMainWindow of size (849,625).
I have toolBar item,two treewidget and 1 listWidget on the MainWindow.

What I want is that when I Maximized the MainWindow the widget on the MainWindow should be arranged to the mainWindow size and also when I again make it size to first size they should arrange to that size.

If anybody knows then plz help me.

Thanks.

Lykurg
15th March 2007, 08:26
Hi,

use Layouts and QMainWindow::setCentralWidget().

Lykurg

vishal.chauhan
15th March 2007, 08:32
Thanks for Reply.

But Actually I m using Designer to create the MainWindow.

Lykurg
15th March 2007, 08:41
But Actually I m using Designer to create the MainWindow.

then use the designer to create layouts.

Lykurg

vishal.chauhan
15th March 2007, 09:54
Thanks for reply.

I open the Object Inspector and set all the Widget as a central Widget.
But when I maximized my window they are not maximized.

Lykurg
15th March 2007, 10:19
ok,

when working with designer forget about the QMainWindow::setCentralWidget().

1. put all things in the mainwidget you want.
2. maybe arrange the items with layouts
3. click on a free mainwidget pice to activate it, or select the item in the top of the object inspector
4. then choose a layout on the designer toolbar and click it.

And now if you resize the mainwindow the content also will be resized...


Lykurg

vishal.chauhan
15th March 2007, 13:30
Thanks.

now the size is maximized.
But when I set the layouts then actually if I set the Grid layout then it is not taking the widget size and position as given by me It takes the iteself.
and in other layouts it is not setting them as I want.