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

Display problems



  • I tried running my project in the Ubuntu terminal and I keep getting this problem:

    QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-username'
    qt.qpa.screen: QXcbConnection: Could not connect to display
    Could not connect to any X display.

    Does anyone know why this is and how to solve it?



  • what do you get when you echo $DISPLAY ?
    what is the output of xhost ?

    What happens if you enter XDG_RUNTIME_DIR=/tmp {qtprogram} in the terminal?


  • Lifetime Qt Champion

    @mmaka Do you run X11? Wayland or something else? Do you try to run your app via VCN? More information is needed.


Log in to reply