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

How to disable gui while creating QApplication object in QT 5.6



  • Hi ,
    One our Operating systems does not have X server.
    To run our QT application in Console mode in non- Xserver machine , I have used below QApplication constructor.

    QApplication::QApplication(int & argc, char ** argv, bool GUIenabled) -> supports in QT 4.8
    Now we have upgraded our QT software from 4.8 to 5.6 .
    In QT 5.6 , above QApplication construtor is not supporting. In our appliation we are inheriting a class from QApplication and initialising many other objects in that class and we are showing a splash screen before launching main application.
    Now I am not able to run my application in console mode.
    TO resolve this I think I need to duplicate my classes and inherite the duplicate class from QCore application .

    Could you please let me know , if there is any way to resolve this issue in simpler way.

    Regards,
    Seetharam



  • @Maddineni
    I have not used Qt 4.

    But at Qt 5 you will need to use http://doc.qt.io/qt-5/qcoreapplication.html (QCoreApplication) for non-GUI app. QApplication & QGuiApplication derive from that, but specialize to require a GUI.


Log in to reply