Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    Unsolved qt.qpa.xcb: could not connect to display

    Installation and Deployment
    3
    3
    1521
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      Phsnomy last edited by

      I'm quite sure it's a qt issue. I got this message when I run flatpak apps and wireshark.
      With QT_DEBUG_PLUGINS set to 1, I got following msgs:

      sudo QT_DEBUG_PLUGINS=1 wireshark                                                                                                                                                       
      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": 0,
          "className": "KWinIntegrationPlugin",
          "debug": false,
          "version": 330752
      }
      
      
      Got keys from plugin meta data ("wayland-org.kde.kwin.qpa")
      QFactoryLoader::QFactoryLoader() looking at "/usr/lib64/qt5/plugins/platforms/libqeglfs.so"
      Found metadata in lib /usr/lib64/qt5/plugins/platforms/libqeglfs.so, metadata=
      {
          "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
          "MetaData": {
              "Keys": [
                  "eglfs"
              ]
          },
          "archreq": 0,
          "className": "QEglFSIntegrationPlugin",
          "debug": false,
          "version": 330752
      }
      
      
      Got keys from plugin meta data ("eglfs")
      QFactoryLoader::QFactoryLoader() looking at "/usr/lib64/qt5/plugins/platforms/libqlinuxfb.so"
      Found metadata in lib /usr/lib64/qt5/plugins/platforms/libqlinuxfb.so, metadata=
      {
          "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
          "MetaData": {
              "Keys": [
                  "linuxfb"
              ]
          },
          "archreq": 0,
          "className": "QLinuxFbIntegrationPlugin",
          "debug": false,
          "version": 330752
      }
      
      
      Got keys from plugin meta data ("linuxfb")
      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": 0,
          "className": "QMinimalIntegrationPlugin",
          "debug": false,
          "version": 330752
      }
      
      
      Got keys from plugin meta data ("minimal")
      QFactoryLoader::QFactoryLoader() looking at "/usr/lib64/qt5/plugins/platforms/libqminimalegl.so"
      Found metadata in lib /usr/lib64/qt5/plugins/platforms/libqminimalegl.so, metadata=
      {
          "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
          "MetaData": {
              "Keys": [
                  "minimalegl"
              ]
          },
          "archreq": 0,
          "className": "QMinimalEglIntegrationPlugin",
          "debug": false,
          "version": 330752
      }
      
      
      Got keys from plugin meta data ("minimalegl")
      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": 0,
          "className": "QOffscreenIntegrationPlugin",
          "debug": false,
          "version": 330752
      }
      
      
      Got keys from plugin meta data ("offscreen")
      QFactoryLoader::QFactoryLoader() looking at "/usr/lib64/qt5/plugins/platforms/libqvnc.so"
      Found metadata in lib /usr/lib64/qt5/plugins/platforms/libqvnc.so, metadata=
      {
          "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
          "MetaData": {
              "Keys": [
                  "vnc"
              ]
          },
          "archreq": 0,
          "className": "QVncIntegrationPlugin",
          "debug": false,
          "version": 330752
      }
      
      
      Got keys from plugin meta data ("vnc")
      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": 0,
          "className": "QWaylandEglPlatformIntegrationPlugin",
          "debug": false,
          "version": 330752
      }
      
      
      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": 0,
          "className": "QWaylandIntegrationPlugin",
          "debug": false,
          "version": 330752
      }
      
      
      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": 0,
          "className": "QWaylandXCompositeEglPlatformIntegrationPlugin",
          "debug": false,
          "version": 330752
      }
      
      
      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": 0,
          "className": "QWaylandXCompositeGlxPlatformIntegrationPlugin",
          "debug": false,
          "version": 330752
      }
      
      
      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": 0,
          "className": "QXcbIntegrationPlugin",
          "debug": false,
          "version": 330752
      }
      
      
      Got keys from plugin meta data ("xcb")
      QFactoryLoader::QFactoryLoader() checking directory path "/usr/bin/platforms" ...
      loaded library "/usr/lib64/qt5/plugins/platforms/libqxcb.so"
      qt.qpa.xcb: could not connect to display 
      qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
      loaded library "/usr/lib64/qt5/plugins/platforms/libqwayland-generic.so"
      error: XDG_RUNTIME_DIR not set in the environment.
      Failed to create wl_display (No such file or directory)
      qt.qpa.plugin: Could not load the Qt platform plugin "wayland" 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, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.
      
      [1]    14744 abort      sudo QT_DEBUG_PLUGINS=1 wireshark
      
      
      

      How can I fix this?

      JonB 1 Reply Last reply Reply Quote 0
      • JonB
        JonB @Phsnomy last edited by

        @Phsnomy said in qt.qpa.xcb: could not connect to display:

        error: XDG_RUNTIME_DIR not set in the environment.

        I'm not an expert in this area, but this is telling you you need to set that environment variable to make your situation work. I suggest you Google for wayland xdg_runtime_dir and read what others say about this.

        1 Reply Last reply Reply Quote 1
        • mrjj
          mrjj Lifetime Qt Champion last edited by

          Hi and welcome to the forums

          What is the Os ?

          Did you try
          export DISPLAY=:0.0
          wireshark
          from shell ?

          1 Reply Last reply Reply Quote 1
          • First post
            Last post