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
Qt 6.11 is out! See what's new in the release blog

No console window in GUI app with CONFIG+=console

Scheduled Pinned Locked Moved General and Desktop
8 Posts 6 Posters 14.5k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on 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 last edited by
      #2

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

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on 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
        • ? Offline
          ? Offline
          A Former User
          wrote on 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.@

          1 Reply Last reply
          0
          • A Offline
            A Offline
            andre
            wrote on 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
            • ? Offline
              ? Offline
              A Former User
              wrote on 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 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
                • ? Offline
                  ? Offline
                  A Former User
                  wrote on 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.

                  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