Windows indicator: print output when ran in console
This commit is contained in:
parent
a6639a7f88
commit
6396fc8e5a
1 changed files with 12 additions and 0 deletions
|
@ -9,6 +9,10 @@
|
|||
#include <QProcess>
|
||||
#include <QThread>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include <Windows.h>
|
||||
#endif
|
||||
|
||||
#ifdef QSYSTRAY
|
||||
#include <QSystemTrayIcon>
|
||||
#else
|
||||
|
@ -32,6 +36,14 @@
|
|||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
// If ran from a console, redirect the output there
|
||||
if (AttachConsole(ATTACH_PARENT_PROCESS)) {
|
||||
freopen("CONOUT$", "w", stdout);
|
||||
freopen("CONOUT$", "w", stderr);
|
||||
}
|
||||
#endif
|
||||
|
||||
QIcon::setFallbackThemeName(QStringLiteral("breeze"));
|
||||
QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||
|
|
Loading…
Reference in a new issue