PDA

View Full Version : How to fix the position of a widget in the main window



ich
11th August 2014, 12:48
Hi,
I want a widget to appear on a fixed position in my mainwindow when I push a button.
How can I fix the position to the left side of my mainwindow without using the Designer ?

Thanks for help !

anda_skoa
11th August 2014, 13:21
Maybe using a QDockWindow and QMainWindow::addDockWidget with Qt::LeftDockWidgetArea?

Cheers,
_

ChrisW67
11th August 2014, 21:01
Or inserting/removing the widget at position 0 in a QHBoxLayout that holds the remaining content of the main window.
Or showing and absolutely positioning a widget (child of main window) on top of the content in the main window. Calling move(0,0) should get you most of the way.

Really depends on the effect you are trying to achieve.