Qt Forum

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

    Update: Forum Guidelines & Code of Conduct

    QT5 QApplication Crashes When There is No Monitor

    General and Desktop
    2
    3
    1728
    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.
    • S
      simy307 last edited by

      I am running a Qt Desktop Application on CentOS 6.4 with Qt 5 Libraries.

      When I start the application from VNC/Teamviewer, as some of our servers do not have monitors, the application crashes. Starting from:

      @QApplication a(argc, argv);@

      I have tracked this down to a core file call qxcbconnection.cpp and the line:

      @xcb_create_window(m_connection, XCB_COPY_FROM_PARENT,
      m_connectionEventListener, m_screens.at(0)->root(),
      0, 0, 1, 1, 0, XCB_WINDOW_CLASS_INPUT_ONLY,
      m_screens.at(0)->screen()->root_visual, 0, 0);@

      The problem is, if there is no monitor connected, then m_screens is empty, and therefore causes an "index out of bounds" error.

      My question is: Is there a way to get around this? I have tried editing the Qt5 library files but that does nothing (acts like nothing has changed at all even when I delete the function call). I need to keep the GUI, as I log on constantly to the headless servers with vnc/teamviewer to view graphical meters and output on the GUI; and also because there are servers with monitors that it must run on graphically.

      1 Reply Last reply Reply Quote 0
      • T
        tobias.hunger last edited by

        Could you please "file a bug report":https://bugreports.qt-project.org/ about this? It should really get some developer attention!

        1 Reply Last reply Reply Quote 0
        • S
          simy307 last edited by

          Thank you for the suggestion! I have just done so. "Bug Report":https://bugreports.qt-project.org/browse/QTBUG-31354

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