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. Console window with QtQuick app

Console window with QtQuick app

Scheduled Pinned Locked Moved Solved QML and Qt Quick
7 Posts 3 Posters 1.2k Views
  • 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.
  • ODБOïO Offline
    ODБOïO Offline
    ODБOï
    wrote on last edited by
    #1

    Hello,
    When i'm running my gui application i also have a console window oppening, i can see debug messages in it. How to disable that window ?

    I think once i did CONFIG += console in my .pro file, but right now this line is not there
    i tryed CONFIG -= console but still have the window. How to solve this issue please ?

    Is this window openning because i use qDebug() function in my code ?

    .pro

    QT += quick testlib
    QT += opcua
    QT += network
    QT += widgets
    QT += quickcontrols2
    CONFIG -= console
    CONFIG += c++11
    
    DEFINES += QT_DEPRECATED_WARNINGS
    
    SOURCES += main.cpp \
        machinebackend.cpp \
        syslogtest.cpp \
        uatest.cpp \
        sftpclient.cpp \
        sftp_user.cpp \
        simplebackend.cpp
      #  test/test_machinebackend.cpp
    
    HEADERS += \
        machinebackend.h \
        syslogtest.h \
        uatest.h \
        sftpclient.h \
        sftp_user.h \
        simplebackend.h
    
    test{
        message(Configuring TEST build...)
    
        TEMPLATE = app
        TARGET = myapptests
        SOURCES -= main.cpp
        QT += testlib
    
        HEADERS += \
            test/test_machinebackend.h
    
    
        SOURCES += \
            test/test_machinebackend.cpp
    
    }
    else{
         message(Configuring APP build...)
        TEMPLATE = app
        TARGET = myapp
       # CONFIG += plugin
       # TARGET = $$qtLibraryTarget($$TARGET)
    }
    
    
    J.HilkJ 1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Perhaps you have "Run in terminal" checkbox ticked in Project->Build settings?

      (Z(:^

      ODБOïO 1 Reply Last reply
      1
      • sierdzioS sierdzio

        Perhaps you have "Run in terminal" checkbox ticked in Project->Build settings?

        ODБOïO Offline
        ODБOïO Offline
        ODБOï
        wrote on last edited by
        #3

        @sierdzio Hi, thank you
        no, that checkbox is not checked

        1 Reply Last reply
        0
        • ODБOïO ODБOï

          Hello,
          When i'm running my gui application i also have a console window oppening, i can see debug messages in it. How to disable that window ?

          I think once i did CONFIG += console in my .pro file, but right now this line is not there
          i tryed CONFIG -= console but still have the window. How to solve this issue please ?

          Is this window openning because i use qDebug() function in my code ?

          .pro

          QT += quick testlib
          QT += opcua
          QT += network
          QT += widgets
          QT += quickcontrols2
          CONFIG -= console
          CONFIG += c++11
          
          DEFINES += QT_DEPRECATED_WARNINGS
          
          SOURCES += main.cpp \
              machinebackend.cpp \
              syslogtest.cpp \
              uatest.cpp \
              sftpclient.cpp \
              sftp_user.cpp \
              simplebackend.cpp
            #  test/test_machinebackend.cpp
          
          HEADERS += \
              machinebackend.h \
              syslogtest.h \
              uatest.h \
              sftpclient.h \
              sftp_user.h \
              simplebackend.h
          
          test{
              message(Configuring TEST build...)
          
              TEMPLATE = app
              TARGET = myapptests
              SOURCES -= main.cpp
              QT += testlib
          
              HEADERS += \
                  test/test_machinebackend.h
          
          
              SOURCES += \
                  test/test_machinebackend.cpp
          
          }
          else{
               message(Configuring APP build...)
              TEMPLATE = app
              TARGET = myapp
             # CONFIG += plugin
             # TARGET = $$qtLibraryTarget($$TARGET)
          }
          
          
          J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on last edited by
          #4

          @LeLev are you by any chance on macOS? I ran into that too.

          Make sure your actually change your QCoreApplication to QApplication and I don't know if it was necessary, but I deleted the build folder and the *.pro.user file

          and that fixed it for me.


          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
          2
          • ODБOïO Offline
            ODБOïO Offline
            ODБOï
            wrote on last edited by ODБOï
            #5

            @J-Hilk hi,
            Im on windows 7. Qt 5.11 mingw32

            i changed my QGuiApplication to QApplication
            i tryed what you suggested but still have the same problem.

            1 Reply Last reply
            0
            • ODБOïO Offline
              ODБOïO Offline
              ODБOï
              wrote on last edited by
              #6

              So the console is opening because i include testlib

              QT.testlib.CONFIG -= console
              

              https://stackoverflow.com/questions/760323/why-does-my-qt-4-5-app-open-a-console-window-under-windows

              @J-Hilk and @sierdzio thx!

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

                Oh, right, good catch. Thanks for reporting back on this :-)

                (Z(:^

                1 Reply Last reply
                1

                • Login

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