Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Hide console with QApplication
Qt 6.11 is out! See what's new in the release blog

Hide console with QApplication

Scheduled Pinned Locked Moved Solved QML and Qt Quick
6 Posts 4 Posters 2.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.
  • S Offline
    S Offline
    St.Stanislav
    wrote on last edited by
    #1

    Hello all! I still have the following question because haven't yet found any solution anywhere. I have QML application with QApplication (cause I use ChartView) after running deployed application console is opened and the GUI is started. So is it possible to hide this console? Currently I work with Windows, so my question about this OP.

    Thank you in advance!

    J.HilkJ 1 Reply Last reply
    0
    • sierdzioS sierdzio

      Do you have this in your .pro file?

      TEMPLATE = app
      

      Does console show only when you run it from Qt Creator, or also when run independently?

      S Offline
      S Offline
      St.Stanislav
      wrote on last edited by St.Stanislav
      #5

      @sierdzio So only adding TEMPLATE = app gave me no luck, but I have found the root of the problem: QT += testlib gives me console at startup. Moreover, TEMPLATE = app is excess, just removing testlib hides the console.

      1 Reply Last reply
      2
      • sierdzioS Offline
        sierdzioS Offline
        sierdzio
        Moderators
        wrote on last edited by
        #2

        Do you have this in your .pro file?

        TEMPLATE = app
        

        Does console show only when you run it from Qt Creator, or also when run independently?

        (Z(:^

        S 2 Replies Last reply
        1
        • S St.Stanislav

          Hello all! I still have the following question because haven't yet found any solution anywhere. I have QML application with QApplication (cause I use ChartView) after running deployed application console is opened and the GUI is started. So is it possible to hide this console? Currently I work with Windows, so my question about this OP.

          Thank you in advance!

          J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on last edited by
          #3

          @St-Stanislav
          also, do you have this in your pro file ?
          CONFIG += console

          it will cause a console to open (even if your target a GUI one)


          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          1 Reply Last reply
          1
          • sierdzioS sierdzio

            Do you have this in your .pro file?

            TEMPLATE = app
            

            Does console show only when you run it from Qt Creator, or also when run independently?

            S Offline
            S Offline
            St.Stanislav
            wrote on last edited by St.Stanislav
            #4

            @sierdzio I found that I have no TEMPLATE definition at all, so I'm going to check it. And console shows exactly when run independently. From QtCreator all messages (e.g. qDebug() << "";) go to QtCreator's console

            @J-Hilk Nope, no console tag is defined there, my config is

            lex yacc debug exceptions depend_includepath testcase_targets import_plugins import_qpa_plugin windows file_copies qmake_use qt warn_on release link_prl flat debug_and_release debug_and_release_target precompile_header autogen_precompile_source embed_manifest_dll embed_manifest_exe shared shared release no_plugin_manifest win32 msvc copy_dir_files qtc_run c++11 qtquickcompiler qtc_run c++11
            
            1 Reply Last reply
            0
            • sierdzioS sierdzio

              Do you have this in your .pro file?

              TEMPLATE = app
              

              Does console show only when you run it from Qt Creator, or also when run independently?

              S Offline
              S Offline
              St.Stanislav
              wrote on last edited by St.Stanislav
              #5

              @sierdzio So only adding TEMPLATE = app gave me no luck, but I have found the root of the problem: QT += testlib gives me console at startup. Moreover, TEMPLATE = app is excess, just removing testlib hides the console.

              1 Reply Last reply
              2
              • Puppy BearP Offline
                Puppy BearP Offline
                Puppy Bear
                wrote on last edited by
                #6

                if theres 2 console, then remember to delete 'return a.exec', 'system pause'

                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