Qt platform plugin xcb could not load - Qt6
-
Hello all,
I am new to both Ubuntu/Linux and Qt and I am trying to create my first Qt project. I am choosing a C++ Widget project with all of the default settings, and when I build I expected it to open a blank window (like it does on my Windows machine), however I get the following error. From my googling, it seems a library isn't linked? I'm not sure if that is the problem or what but I really don't know how to solve this. Any help would be appreciated.
-
Hi and welcome to devnet,
Any chance you are running your desktop environment on top of Wayland ?
If so, one thing you can do is to go in the Run part of the project panel and set the QT_QPA_PLATFORM environment variable to wayland and restart your application.
-
Hi @ryan_rockhopper,
This comes up quite often - try searching these forums for "xcb".
That said, here's my go-to solution: @Paul-Colby said in qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.:
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
For modern Ubuntu's, I resolve this with:
sudo apt install libxcb-cursor0
Cheers.
-
@ryan_rockhopper
echo $XDG_SESSION_TYPE -
@Paul-Colby said in Qt platform plugin xcb could not load - Qt6:
sudo apt install libxcb-cursor0
Thank you Paul-Colby, that totally fixed it. You're the man!
-