Results 1 to 1 of 1

Thread: QT5 QApplication Crashes When There is No Monitor

  1. #1
    Join Date
    May 2013
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5

    Default QT5 QApplication Crashes When There is No Monitor

    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:

    Qt Code:
    1. QApplication a(argc, argv);
    To copy to clipboard, switch view to plain text mode 

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

    Qt Code:
    1. xcb_create_window(m_connection, XCB_COPY_FROM_PARENT,
    2. m_connectionEventListener,>root(),
    3. 0, 0, 1, 1, 0, XCB_WINDOW_CLASS_INPUT_ONLY,
    4.>screen()->root_visual, 0, 0);
    To copy to clipboard, switch view to plain text mode 

    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 view graphical meters and output on the GUI.

  2. The following user says thank you to simy307 for this useful post:

Similar Threads

  1. Debugger crashes on QApplication
    By themagician in forum Installation and Deployment
    Replies: 1
    Last Post: 2nd March 2012, 10:46
  2. Replies: 2
    Last Post: 1st August 2011, 06:30
  3. QT on LCD monitor
    By Ratheendrans in forum Qt for Embedded and Mobile
    Replies: 3
    Last Post: 5th March 2011, 16:03
  4. X Monitor in a Qt form
    By prasenjit in forum Qt-based Software
    Replies: 1
    Last Post: 29th April 2010, 06:58
  5. Qt system monitor?
    By khopper in forum Qt Programming
    Replies: 2
    Last Post: 7th November 2008, 15:32

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.