PDA

View Full Version : Most reliable way to replace Q_WS_X11



LucaDanieli
10th March 2017, 11:07
Hello all,

I am dealing with the replacement of the old Q_WS_X11 definitions.
I cannot find a clear information in internet on what is Q_WS_X11 supposed to be replaced with, so I am asking here if you have any idea about how to deal with the updating.
Or, a link to some alternative?

Thanks!
Luca

anda_skoa
11th March 2017, 10:41
It depends a bit on what you were guarding with that.

In Qt5 all the GUI differences moved into the QPA (Qt Platform Abstraction) plugins, which are enabled for build by configure switches and feature compile tests.

If you are accessing X11 API directly, you might have to change more than just the guard define because the Qt X11 adapter is based on XCB now instead libx11.

One of the Qt extension libraries that has windowing system specific code, KWindowSystems (https://inqlude.org/libraries/kwindowsystem.html), has its own configure-time checks to decide whether to build X11 specific portions: https://cgit.kde.org/kwindowsystem.git/tree/CMakeLists.txt

Can you give examples of what the Q_WS_X11 define is correctly guarding in your code?

Cheers,
_