Reopen console on windows when started from cmd.exe

This commit is contained in:
2026-03-26 14:46:23 +01:00
parent 6a537642ab
commit 3f88e5fe83
+11
View File
@@ -6,6 +6,9 @@
#include <QSettings>
#include <stdlib.h>
#include "../thumbnailer/genthumbnail.h"
#ifdef Q_OS_WIN64
#include <windows.h>
#endif
int main(int argc, char *argv[])
{
@@ -19,6 +22,14 @@ int main(int argc, char *argv[])
bool useGLES = true;
#endif
#ifdef Q_OS_WIN64
if(AttachConsole(ATTACH_PARENT_PROCESS))
{
freopen("CONOUT$", "w", stdout);
freopen("CONOUT$", "w", stderr);
}
#endif
QCommandLineParser cmd;
cmd.addOption({"gl", "Use desktop OpenGL. This is default on x86 and MacOS platform."});
cmd.addOption({"gles", "Use OpenGL ES. This is default on ARM platform."});