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. No console window in GUI app with CONFIG+=console
Forum Updated to NodeBB v4.3 + New Features

No console window in GUI app with CONFIG+=console

Scheduled Pinned Locked Moved General and Desktop
8 Posts 6 Posters 13.8k 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.
  • T Offline
    T Offline
    Tom C
    wrote on 19 Apr 2012, 08:52 last edited by
    #1

    My GUI app won't start with a console even if I add the line "CONFIG+=console" in the projetc file.

    I tried to clean all files before recompile it but still no console.

    Qt lib 4.8
    Qt Creator 2.4
    Compiler mingw32

    Does somebody have an idea ?

    1 Reply Last reply
    0
    • R Offline
      R Offline
      rschaub
      wrote on 19 Apr 2012, 08:54 last edited by
      #2

      have you tried deleting the makefiles and/or re-running qmake?

      1 Reply Last reply
      0
      • T Offline
        T Offline
        Tom C
        wrote on 19 Apr 2012, 09:08 last edited by
        #3

        Yes, i tried to delete all generated files ( including makefiles ) and rebuild the project in a Qt command prompt

        1 Reply Last reply
        0
        • A Offline
          A Offline
          AcerExtensa
          wrote on 19 Apr 2012, 09:11 last edited by
          #4

          Are you using "QApplication":http://doc-snapshot.qt-project.org/4.8/qapplication.html or "QCoreApplication":http://doc-snapshot.qt-project.org/4.8/qcoreapplication.html instance?

          @The QApplication class manages the GUI application's control flow and main settings.@

          @The QCoreApplication class provides an event loop for console Qt applications.@

          God is Real unless explicitly declared as Integer.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            andre
            wrote on 19 Apr 2012, 09:12 last edited by
            #5

            Should not matter, you can get a console with a QApplication too. Also note that QApplication inherits QCoreApplication.

            1 Reply Last reply
            0
            • T Offline
              T Offline
              Tom C
              wrote on 19 Apr 2012, 09:22 last edited by
              #6

              I'm using a QApplication instance. But i'm not sure if the problem is here 'cause this feature was made to provide a debug console in GUI app.

              1 Reply Last reply
              0
              • W Offline
                W Offline
                Wilk
                wrote on 19 Apr 2012, 19:27 last edited by
                #7

                Hello
                AFAIK Qt Creator automatically gets debug output from the application and shows it at "Application Output" tab.

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  goetz
                  wrote on 21 Apr 2012, 22:56 last edited by
                  #8

                  A QApplication always initializes the graphics system. For a real console app, without using QtGui module, you need QCoreApplication.

                  There is no easy way to provide a "debug console" in your application. You will need to attach to the windows service for that or provide a logger window for qDebug/qWarning/qError yourself. For the latter, there is an example for a "Browser for QDebug Log Output":/wiki/Browser_for_QDebug_output in the wiki.

                  PS: There's another, more sophisticated logger framework. See the "announcement in the showcase forum":/forums/viewthread/2654.

                  http://www.catb.org/~esr/faqs/smart-questions.html

                  1 Reply Last reply
                  0

                  1/8

                  19 Apr 2012, 08:52

                  • Login

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