Solved Hide console with QApplication
-
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!
-
@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 removingtestlib
hides the console. -
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?
-
@St-Stanislav
also, do you have this in your pro file ?
CONFIG += consoleit will cause a console to open (even if your target a GUI one)
-
@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
-
@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 removingtestlib
hides the console. -
if theres 2 consoleļ¼ then remember to delete 'return a.exec', 'system pause'