Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to disable GUI while craeting QApplication object in QT 5.6
Forum Updated to NodeBB v4.3 + New Features

How to disable GUI while craeting QApplication object in QT 5.6

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 884 Views 1 Watching
  • 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.
  • seetharamS Offline
    seetharamS Offline
    seetharam
    wrote on last edited by
    #1

    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

    JonBJ 1 Reply Last reply
    0
    • seetharamS seetharam

      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

      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by
      #2

      @seetharam
      This post is duplicated in https://forum.qt.io/topic/90623/how-to-disable-gui-while-creating-qapplication-object-in-qt-5-6, where I have posted.

      It really is best not to post identical duplicate threads....

      1 Reply Last reply
      1
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi
        Yes you need to refactor your code and use
        QCoreApplication and QApplication depending on console or GUI mode.
        No way around it as its how it works now.

        JonBJ 1 Reply Last reply
        0
        • mrjjM mrjj

          Hi
          Yes you need to refactor your code and use
          QCoreApplication and QApplication depending on console or GUI mode.
          No way around it as its how it works now.

          JonBJ Online
          JonBJ Online
          JonB
          wrote on last edited by
          #4

          @mrjj
          No point you spending your time here, because the post is also duplicated a 3rd time and answered, as per https://forum.qt.io/topic/89993/qapplication-not-working-as-expected-with-3rd-paramaeter-guimode/8 ... :(

          1 Reply Last reply
          1
          • mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Oh
            Already answer.
            Thank you @JonB
            https://forum.qt.io/topic/89993/qapplication-not-working-as-expected-with-3rd-paramaeter-guimode

            Locking this one.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved