Qt Creator 6.0.1 not able to run in native Wayland mode on Linux / Wayland
-
Hello,
on Linux / Wayland I like to run Qt Creator 6.0.1 in native Wayland mode. Because if Qt Creator is running on XWayland the fonts are blurry.
But if Qt Creator is forced to run in native Wayland mode using QT_QPA_PLATFORM=wayland variable defined in /etc/environment, Qt Creator doesn't launch.
I tried to uninstall and reinstall Qt 6.2.2 and Qt Creator 6.0.1 using the online installer, but that didn't help. Is there a specific module (checkbox to choose in Qt online installer) that is mandatory to run Qt Creator in native Wayland mode that I might have missed / overlooked?
My system specs are:
CPU: Intel i7
GPU: UHD 630 running on 4K resolution using 2x (200%) scaling
OS: Arch Linux
Desktop Environments / WM: KDE Plasma 5.23.4 or Gnome 41 or Sway WM
Display Server: Wayland
Qt 6.2.2 with Qt Creator 6.0.1 installed using online installer
Environment variable defined in /etc/environment: QT_QPA_PLATFORM=waylandRunning QT Creator 6.0.1 from console debug output is:
---------------------------------- console output begin ---------------------------------------------
[me@plasma ~]$ /home/me/Qt/Tools/QtCreator/bin/qtcreator
.................
Got keys from plugin meta data QList("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/home/me/Qt/Tools/QtCreator/bin/platforms" ...
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vkkhrdisplay, vnc, xcb.
aborted
--------------------------- console output end ----------------------------------------------------------
Why Qt Creator can't find the Wayland Qt platform plugin? Can this problem be solved using the online installer adding some module? Or has to be a Linux package installed manually? Or is there a path variable missing to the Wayland Qt platform plugin?
Does anyone know advice and can help?
-
@mireiner said in Qt Creator 6 doesn't launch on Linux/Wayland if QT_QPA_PLATFORM=wayland is defined:
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vkkhrdisplay, vnc, xcb
According to this your QtCreator set-up does not contain Wayland platform plug-in.
Can you post the content of /home/me/Qt/Tools/QtCreator/bin/platforms ? -
@jsulm said in Qt Creator 6 doesn't launch on Linux/Wayland if QT_QPA_PLATFORM=wayland is defined:
According to this your QtCreator set-up does not contain Wayland platform plug-in.
Can you post the content of /home/me/Qt/Tools/QtCreator/bin/platforms ?There is no /home/me/Qt/Tools/QtCreator/bin/platforms directory in my Qt installation.
-
@mireiner said in Qt Creator 6 doesn't launch on Linux/Wayland if QT_QPA_PLATFORM=wayland is defined:
There is no "platforms" folder in /home/me/Qt/Tools/QtCreator/bin/platforms directory.
?
Do you mean /home/me/Qt/Tools/QtCreator/bin/platforms does not exist? -
Finally, I managed to fix the problem. Being the Qt Linux dilettante that I am, it took me one week:
The Qt Online Installer that I use to install Qt on Arch Linux doesn't install qt6-wayland package and doesn't spread the Qt Wayland plugins to all places where they are needed.
That's why Qt Creator 6.0.1 which is build using Qt 6.2.2 is not able to run in native Wayland mode and if QT_QPA_PLATFORM=wayland is defined won't even launch. The same is true for Qt Maintenance Tool. Because of that, both applications run on XWayland which results in blurry font rendering on HiDPI graphics.
A manual workaround to enable Qt Creator's 6.0.1 native Wayland mode for example on Arch Linux / Wayland (with KDE Plasma 5.23.4 or Gnome 41 or Sway WM) is:
Define QT_QPA_PLATFORM=wayland (for example in /etc/environment)
Install qt6-wayland package:
Copy directories:
/home/user/Qt/6.2.2/gcc_64/plugins/platforms
/home/user/Qt/6.2.2/gcc_64/plugins/wayland-decoration-client
/home/user/Qt/6.2.2/gcc_64/plugins/wayland-graphics-integration-client
/home/user/Qt/6.2.2/gcc_64/plugins/wayland-shell-integration
to (overriding existing platforms folder)
/home/user/Qt/Tools/QtCreator/lib/Qt/plugins/platforms
/home/user/Qt/Tools/QtCreator/lib/Qt/plugins/wayland-decoration-client
/home/user/Qt/Tools/QtCreator/lib/Qt/plugins/wayland-graphics-integration-client
/home/user/Qt/Tools/QtCreator/lib/Qt/plugins/wayland-shell-integrationreboot (to enable QT_QPA_PLATFORM=wayland environment variable)
After that, Qt Creator 6.0.1 runs in native Wayland mode with sharp font rendering on HiDPI graphics.
I wrote QTBUG-99429 report about it: https://bugreports.qt.io/browse/QTBUG-99429
Edit 15. February 2022:
There was a typo in this post. The correct name of the environment variable that forces Wayland is: QT_QPA_PLATFORM=wayland