[PyQt] QDockWidget issue in Linux, but not Windows, OSX

Hans-Peter Jansen hpj at urpla.net
Mon Feb 13 21:49:19 GMT 2012


Am Monday 13 February 2012 21:37:55 schrieb JPolk:
> Thanks for your help, Pete
>
> While your example does indeed fix the problem that my example code showed,
> unfortunately, when plugging it in to the real program, the problem
> persists.
>
> However, I have been able to reproduce this bug using just Designer.

Yup, sure. Same problem. Why can't you adopt my attempt to your problem? 
Just replace the parent of the dock with a QMainWindow. Case closed. 

The second best way is analysing the QMainWindow class and find out, what it 
is doing special for docking widgets. I guess, they fiddle with the window 
flags.

Your approach will suffer from being unpossible to save the dock states and 
the like anyway, I *guess*. 

> On Windows here,...run Designer
>     Create a MainWindow (default one do)
>     Drop in a QFrame and pull it to just shy of MainWindow
>     Drop in a QDockWidget
>     Select dockWidget
>     Cut
>     Select QFrame
>     Paste
> and then "run it" doing a  Form->Preview, ...clicked "undock" button,
> behaviour is Normal
>
> Did the same thing on Linux,
> but when I click the "undock" button, the button is stuck at top, just like
> our problem.
> Can anyone else confirm this on Linux ?
>
> So that's definitely gotta be a Qt bug, right?

If it's one, then it's in the highly obscure class of issues (pretty hard to 
fully solvable in a multi platform toolkit).

> Any advice about how to fix ?
>
> Thanks!

Pete


More information about the PyQt mailing list