[Development] NO effect setAttribute(Qt::WA_X11NetWmWindowTypeDock, true) for Qt5?

Leslie Zhai xiangzhai83 at gmail.com
Fri May 2 12:35:43 CEST 2014

Hi Jorgen,

Thanks for your reply :)

Yes! It has to setWindowFlags(Qt::BypassWindowManagerHint | 
Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint) for Qt5 to act like 
the DOCK 

And there is NO x11EventFilter for Qt5 any more, so I use 
MyXcbEventFilter based on QAbstractNativeEventFilter to handle
xcb_generic_event_t* event 

Perhaps it is easy to migrate to Qt5 towards general applications such 
https://github.com/xiangzhai/youaremyeyes/tree/master/src/browser only 
need to change some APIs and header files depend on different QT_VERSION.

BUT it is not easy for special ones, for example, WINDOW MANAGER 
https://github.com/xiangzhai/eggwm DESKTOP ENVIROMENT 
https://github.com/xiangzhai/qtpanel it needs to be familiar with some 
relative libraries ... sort of thing

Happy International Labour Day! Thanks for your reply again :)

Leslie Zhai <xiang.zhai at i-soft.com.cn>

> Hi
> On Wednesday 30 April 2014 10:32:15 Leslie Zhai wrote:
>> Hi Qt developers,
>> I migrated qtpanel from Qt4 to Qt5
>> but setAttribute(Qt::WA_X11NetWmWindowTypeDock, true) has NO effect for
>> Qt5 https://github.com/xiangzhai/qtpanel/blob/master/panelwindow.cpp#L138
>> qtpanel-qt4 snapshot
>> https://www.dropbox.com/s/nwebtd03fy4sght/qtpanel-qt4.png
>> BUT qtpanel-qt5 https://www.dropbox.com/s/dxt7z5ya26fr6ss/qtpanel-qt5.png
>> I need to setWindowFlags(Qt::FramelessWindowHint |
>> Qt::CustomizeWindowHint) to act like a dock for Qt5? but there is no
>> need for Qt4.
>> Please someone give me some advice, thanks a lot!
> The top level widget uses a QWindow in Qt 5. Because of the platform
> abstraction layer (QWindow and QPlatformWindow), the platform dependent widget
> attributes often doesn't have an effect in Qt 5.
> I have had a couple of stabs on solving this, but it has led to a big fat
> nothing so far. However, your mail just show yet another example for the need
> for a "pattern" to solve this.
> The other day Laszlo got a patch integrated which adds a new module called
> QtPlatformHeaders which (as the name implies) should only contain headers and
> no library.
> So I desided to use the new module and have another stab at adding an api for
> setting platform specific properties in change:
> https://codereview.qt-project.org/#change,84484
> Jørgen

More information about the Development mailing list