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

Samuel Gaist samuel.gaist at edeltech.ch
Fri Jul 20 12:06:40 CEST 2012


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

> On 07/20/2012 10:31 AM, Samuel Gaist wrote:
>> Hi,
>> 
>> 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.
> 
> I've tried that, but that ends up screwing up how the dock widget is 
> rendered. The dock widget is rendered properly when added through 
> addDockWidget(), though.
> 
> 
> Rui Maciel
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

My bad, i've forgotten the implication of widget parenting without a layout in between.

Did you also try my second suggestion ? addDockWidget + dockWidget.setFloating(true)

Hope it helps
Samuel


More information about the Interest mailing list