Question

enter image description hereIn my MainWindow ,menuBar contents and toolBar contents are few that it will occupy only a small portion in the left side off the main window and the rest of the portion is left empty. Im having a info frame with some widgets in it in the right side of the centerwidget.

my question is that can i use the the info frame from the menu bar space itself as menubar and toolbar can occupy only left portion of the mainwindow and i can use the entire right portion for info frame..?

Was it helpful?

Solution

You can't use that space through layout because this space is already taken by the main menu and the toolbar. There is no option to put something in this space.

But you can add a main window's child without putting it in any layout. It will be shown above all layed out children. But you will have to calculate and adjust size and position of this widget manually.

For example, add the following code to the main window's constructor:

QPushButton* b = new QPushButton("TEST", this);
b->move(200, 0);

It looks like this:

screenshot

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top