Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

(Linux) qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.



  • I'm trying to run XP-Pen pentablet drivers on my system-- they launch just fine under my normal user, but because they are drivers I need to run them as root, which gives me the following error:

    sleepy@magi ~/Programs/Pentablet/Linux_Pentablet_V1.2.13.1 $ sudo QT_DEBUG_PLUGINS=1 ./Pentablet_Driver
    QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib64/qt5/plugins/platforms" ...
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib64/qt5/plugins/platforms/KWinQpaPlugin.so"
    Found metadata in lib /usr/lib64/qt5/plugins/platforms/KWinQpaPlugin.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "wayland-org.kde.kwin.qpa"
            ]
        },
        "archreq": 2,
        "className": "KWinIntegrationPlugin",
        "debug": false,
        "version": 331520
    }
    
    
    Got keys from plugin meta data ("wayland-org.kde.kwin.qpa")
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib64/qt5/plugins/platforms/libqminimal.so"
    Found metadata in lib /usr/lib64/qt5/plugins/platforms/libqminimal.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "minimal"
            ]
        },
        "archreq": 2,
        "className": "QMinimalIntegrationPlugin",
        "debug": false,
        "version": 331520
    }
    
    
    Got keys from plugin meta data ("minimal")
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib64/qt5/plugins/platforms/libqoffscreen.so"
    Found metadata in lib /usr/lib64/qt5/plugins/platforms/libqoffscreen.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "offscreen"
            ]
        },
        "archreq": 2,
        "className": "QOffscreenIntegrationPlugin",
        "debug": false,
        "version": 331520
    }
    
    
    Got keys from plugin meta data ("offscreen")
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib64/qt5/plugins/platforms/libqwayland-egl.so"
    Found metadata in lib /usr/lib64/qt5/plugins/platforms/libqwayland-egl.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "wayland-egl"
            ]
        },
        "archreq": 2,
        "className": "QWaylandEglPlatformIntegrationPlugin",
        "debug": false,
        "version": 331520
    }
    
    
    Got keys from plugin meta data ("wayland-egl")
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib64/qt5/plugins/platforms/libqwayland-generic.so"
    Found metadata in lib /usr/lib64/qt5/plugins/platforms/libqwayland-generic.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "wayland"
            ]
        },
        "archreq": 2,
        "className": "QWaylandIntegrationPlugin",
        "debug": false,
        "version": 331520
    }
    
    
    Got keys from plugin meta data ("wayland")
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib64/qt5/plugins/platforms/libqwayland-xcomposite-egl.so"
    Found metadata in lib /usr/lib64/qt5/plugins/platforms/libqwayland-xcomposite-egl.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "wayland-xcomposite-egl"
            ]
        },
        "archreq": 2,
        "className": "QWaylandXCompositeEglPlatformIntegrationPlugin",
        "debug": false,
        "version": 331520
    }
    
    
    Got keys from plugin meta data ("wayland-xcomposite-egl")
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib64/qt5/plugins/platforms/libqwayland-xcomposite-glx.so"
    Found metadata in lib /usr/lib64/qt5/plugins/platforms/libqwayland-xcomposite-glx.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "wayland-xcomposite-glx"
            ]
        },
        "archreq": 2,
        "className": "QWaylandXCompositeGlxPlatformIntegrationPlugin",
        "debug": false,
        "version": 331520
    }
    
    
    Got keys from plugin meta data ("wayland-xcomposite-glx")
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib64/qt5/plugins/platforms/libqxcb.so"
    Found metadata in lib /usr/lib64/qt5/plugins/platforms/libqxcb.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "xcb"
            ]
        },
        "archreq": 2,
        "className": "QXcbIntegrationPlugin",
        "debug": false,
        "version": 331520
    }
    
    
    Got keys from plugin meta data ("xcb")
    QFactoryLoader::QFactoryLoader() checking directory path "/home/sleepy/Programs/Pentablet/Linux_Pentablet_V1.2.13.1/platforms" ...
    QFactoryLoader::QFactoryLoader() looking at "/home/sleepy/Programs/Pentablet/Linux_Pentablet_V1.2.13.1/platforms/libqxcb.so"
    Found metadata in lib /home/sleepy/Programs/Pentablet/Linux_Pentablet_V1.2.13.1/platforms/libqxcb.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "xcb"
            ]
        },
        "className": "QXcbIntegrationPlugin",
        "debug": false,
        "version": 330241
    }
    
    
    Got keys from plugin meta data ("xcb")
    loaded library "/usr/lib64/qt5/plugins/platforms/libqxcb.so"
    No protocol specified
    qt.qpa.xcb: could not connect to display :0
    qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
    This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
    
    Available platform plugins are: wayland-org.kde.kwin.qpa, minimal, offscreen, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.
    
    Aborted
    

    I'm using Gentoo and I have xcb installed:

    sleepy@magi ~/Programs/Pentablet/Linux_Pentablet_V1.2.13.1 $ eix xcb
    * dev-perl/X11-XCB
         Available versions:  0.170.0-r1^t {test}
         Homepage:            https://metacpan.org/release/X11-XCB
         Description:         Perl bindings for libxcb
    
    [I] x11-base/xcb-proto
         Available versions:  1.14-r1 {ABI_MIPS="n32 n64 o32" ABI_RISCV="lp64 lp64d" ABI_S390="32 64" ABI_X86="32 64 x32" PYTHON_TARGETS="python3_6 python3_7 python3_8"}
         Installed versions:  1.14-r1(08:32:13 PM 05/08/2020)(ABI_MIPS="-n32 -n64 -o32" ABI_RISCV="-lp64 -lp64d" ABI_S390="-32 -64" ABI_X86="32 64 -x32" PYTHON_TARGETS="python3_7 python3_8 -python3_6")
         Homepage:            https://xcb.freedesktop.org/ https://gitlab.freedesktop.org/xorg/proto/xcbproto
         Description:         X C-language Bindings protocol headers
    
    [I] x11-libs/libxcb
         Available versions:  1.14(0/1.12)^t {doc selinux static-libs test +xkb ABI_MIPS="n32 n64 o32" ABI_RISCV="lp64 lp64d" ABI_S390="32 64" ABI_X86="32 64 x32"}
         Installed versions:  1.14(0/1.12)^t(08:32:42 PM 05/08/2020)(xkb -doc -selinux -static-libs -test ABI_MIPS="-n32 -n64 -o32" ABI_RISCV="-lp64 -lp64d" ABI_S390="-32 -64" ABI_X86="32 64 -x32")
         Homepage:            https://xcb.freedesktop.org/ https://gitlab.freedesktop.org/xorg/lib/libxcb
         Description:         X C-language Bindings library
    
    [I] x11-libs/xcb-util
         Available versions:  0.4.0-r1^t {doc static-libs test ABI_MIPS="n32 n64 o32" ABI_RISCV="lp64 lp64d" ABI_S390="32 64" ABI_X86="32 64 x32"}
         Installed versions:  0.4.0-r1^t(08:07:25 AM 05/22/2020)(-doc -static-libs -test ABI_MIPS="-n32 -n64 -o32" ABI_RISCV="-lp64 -lp64d" ABI_S390="-32 -64" ABI_X86="32 64 -x32")
         Homepage:            https://xcb.freedesktop.org/ https://gitlab.freedesktop.org/xorg/lib/libxcb-util
         Description:         X C-language Bindings sample implementations
    
    [I] x11-libs/xcb-util-cursor
         Available versions:  0.1.3-r2^t {doc static-libs test ABI_MIPS="n32 n64 o32" ABI_RISCV="lp64 lp64d" ABI_S390="32 64" ABI_X86="32 64 x32"}
         Installed versions:  0.1.3-r2^t(08:07:58 AM 05/22/2020)(-doc -static-libs -test ABI_MIPS="-n32 -n64 -o32" ABI_RISCV="-lp64 -lp64d" ABI_S390="-32 -64" ABI_X86="32 64 -x32")
         Homepage:            https://xcb.freedesktop.org/ https://gitlab.freedesktop.org/xorg/lib/libxcb-cursor
         Description:         X C-language Bindings sample implementations
    
    [I] x11-libs/xcb-util-image
         Available versions:  0.4.0-r1^t {doc static-libs test ABI_MIPS="n32 n64 o32" ABI_RISCV="lp64 lp64d" ABI_S390="32 64" ABI_X86="32 64 x32"}
         Installed versions:  0.4.0-r1^t(08:07:41 AM 05/22/2020)(-doc -static-libs -test ABI_MIPS="-n32 -n64 -o32" ABI_RISCV="-lp64 -lp64d" ABI_S390="-32 -64" ABI_X86="32 64 -x32")
         Homepage:            https://xcb.freedesktop.org/ https://gitlab.freedesktop.org/xorg/lib/libxcb-image
         Description:         X C-language Bindings sample implementations
    
    [I] x11-libs/xcb-util-keysyms
         Available versions:  0.4.0-r1^t {doc static-libs test ABI_MIPS="n32 n64 o32" ABI_RISCV="lp64 lp64d" ABI_S390="32 64" ABI_X86="32 64 x32"}
         Installed versions:  0.4.0-r1^t(08:03:51 AM 05/22/2020)(-doc -static-libs -test ABI_MIPS="-n32 -n64 -o32" ABI_RISCV="-lp64 -lp64d" ABI_S390="-32 -64" ABI_X86="32 64 -x32")
         Homepage:            https://xcb.freedesktop.org/ https://gitlab.freedesktop.org/xorg/lib/libxcb-keysyms
         Description:         X C-language Bindings sample implementations
    
    [I] x11-libs/xcb-util-renderutil
         Available versions:  0.3.9-r2^t {doc static-libs test ABI_MIPS="n32 n64 o32" ABI_RISCV="lp64 lp64d" ABI_S390="32 64" ABI_X86="32 64 x32"}
         Installed versions:  0.3.9-r2^t(08:04:24 AM 05/22/2020)(-doc -static-libs -test ABI_MIPS="-n32 -n64 -o32" ABI_RISCV="-lp64 -lp64d" ABI_S390="-32 -64" ABI_X86="32 64 -x32")
         Homepage:            https://xcb.freedesktop.org/ https://gitlab.freedesktop.org/xorg/lib/libxcb-render-util
         Description:         X C-language Bindings sample implementations
    
    [I] x11-libs/xcb-util-wm
         Available versions:  0.4.1-r2^t {doc static-libs test ABI_MIPS="n32 n64 o32" ABI_RISCV="lp64 lp64d" ABI_S390="32 64" ABI_X86="32 64 x32"}
         Installed versions:  0.4.1-r2^t(08:04:09 AM 05/22/2020)(-doc -static-libs -test ABI_MIPS="-n32 -n64 -o32" ABI_RISCV="-lp64 -lp64d" ABI_S390="-32 -64" ABI_X86="32 64 -x32")
         Homepage:            https://xcb.freedesktop.org/ https://gitlab.freedesktop.org/xorg/lib/libxcb-wm
         Description:         X C-language Bindings sample implementations
    
    * x11-libs/xcb-util-xrm
         Available versions:  1.3^t {doc static-libs test ABI_MIPS="n32 n64 o32" ABI_RISCV="lp64 lp64d" ABI_S390="32 64" ABI_X86="32 64 x32"}
         Homepage:            https://xcb.freedesktop.org/
         Description:         X C-language Bindings sample implementations
    
    [I] x11-misc/xcb
         Available versions:  2.4-r1 {motif}
         Installed versions:  2.4-r1(05:04:39 PM 08/29/2020)(-motif)
         Homepage:            http://oldhome.schmorp.de/marc/xcb.html
         Description:         Marc Lehmann's improved X Cut Buffers
    
    Found 11 matches
    

    Running the application under polkit does not fix the issue. How can I fix this?



  • Hi, I think this is not a really a Qt question, because you get the error "No protocol specified, qt.qpa.xcb: could not connect to display :0"

    Try copying your .Xauthority file into /root, say like this:
    sudo cp ~/.Xauthority /root

    Otherwise, there are lots of hits googling that error, here is one that might help:
    https://unix.stackexchange.com/questions/118811/why-cant-i-run-gui-apps-from-root-no-protocol-specified



  • @hskoglund said in (Linux) qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.:

    Hi, I think this is not a really a Qt question, because you get the error "No protocol specified, qt.qpa.xcb: could not connect to display :0"

    Try copying your .Xauthority file into /root, say like this:
    sudo cp ~/.Xauthority /root

    Otherwise, there are lots of hits googling that error, here is one that might help:
    https://unix.stackexchange.com/questions/118811/why-cant-i-run-gui-apps-from-root-no-protocol-specified

    Ah yup, that fixed it. Thank you!


Log in to reply