From c12df3744f04716e88e905888beeaaa4f331d687 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Thu, 14 Nov 2019 20:45:21 +0800 Subject: Windows is such a brilliant operating system. --- qmidiplayer-desktop/CMakeLists.txt | 7 +++++++ qmidiplayer-desktop/main.cpp | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/qmidiplayer-desktop/CMakeLists.txt b/qmidiplayer-desktop/CMakeLists.txt index a9b6bf1..7064e28 100644 --- a/qmidiplayer-desktop/CMakeLists.txt +++ b/qmidiplayer-desktop/CMakeLists.txt @@ -43,6 +43,13 @@ set(qmpdesktop_SOURCES resources.qrc ) +if(WIN32) + set(qmpdesktop_SOURCES + ${qmpdesktop_SOURCES} + qmidiplayer.rc + ) +endif(WIN32) + set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) diff --git a/qmidiplayer-desktop/main.cpp b/qmidiplayer-desktop/main.cpp index 602aedc..ba44e99 100644 --- a/qmidiplayer-desktop/main.cpp +++ b/qmidiplayer-desktop/main.cpp @@ -21,9 +21,15 @@ #include #include #include +#ifdef _WIN32 +#include +#endif int main(int argc,char **argv) { +#ifdef _WIN32 + FreeConsole(); +#endif QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); QCoreApplication::setApplicationName("qmidiplayer"); QCoreApplication::setApplicationVersion(APP_VERSION); -- cgit v1.2.3