[Interest] QMainWindow: add a dock widget as a floater?

Samuel Gaist samuel.gaist at edeltech.ch
Fri Jul 20 11:31:54 CEST 2012


As silly as it might sound, why don't you just not add the QDockWidget ?
By default at construction time, the QDockWidget is a floater. If you want it to be a QMainWindow children, just make the QMainWindow it's parent.

Another thing that might be done is using setFloating() from QDockWidget.

Hope it helps

On 20 juil. 2012, at 11:12, Rui Maciel wrote:

> Is it possible to add a given QDockWidget object to a QMainWindow as a 
> floater?  According to the documentation for the QMainWindow class, the 
> QMainWindow::addDockWidget() member functions use Qt::DockWidgetAreas 
> flags to specify where to add a given dock widget, but there isn't a 
> flag for the floater case and when I pass the remaining options, 
> Qt::AllDockWidgetAreas or Qt::NoDockWidgetArea, the dock window appears 
> all screwed up.
> So, is it possible to add a dock widget to a QMainWindow object as a 
> floater?  If it is, what does it take to get it done?
> Thanks in advance,
> Rui Maciel
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

More information about the Interest mailing list