summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qcommandlineparser.cpp
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@theqtcompany.com>2015-09-02 11:07:33 +0200
committerOliver Wolff <oliver.wolff@theqtcompany.com>2016-01-05 08:14:35 +0000
commit452a27e1f0abba550cba24390c03a05d9091bedc (patch)
tree6ad93ab269569fc0558bb9f316a40fd65ac318df /src/corelib/tools/qcommandlineparser.cpp
parent47b5b5d1065085974737aaca44f229704b59b49b (diff)
Winrt: Show message when command line processing fails/usage should be shown
Change-Id: If8f69906beb22f632ccbde92aab5caf914dcb31b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Diffstat (limited to 'src/corelib/tools/qcommandlineparser.cpp')
-rw-r--r--src/corelib/tools/qcommandlineparser.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/corelib/tools/qcommandlineparser.cpp b/src/corelib/tools/qcommandlineparser.cpp
index 15c7a0646f..2bc60c5b9e 100644
--- a/src/corelib/tools/qcommandlineparser.cpp
+++ b/src/corelib/tools/qcommandlineparser.cpp
@@ -540,7 +540,13 @@ static inline bool displayMessageBox()
static void showParserMessage(const QString &message, MessageType type)
{
-#if defined(Q_OS_WIN) && !defined(QT_BOOTSTRAPPED) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WINRT)
+ if (type == UsageMessage)
+ qInfo(qPrintable(message));
+ else
+ qCritical(qPrintable(message));
+ return;
+#elif defined(Q_OS_WIN) && !defined(QT_BOOTSTRAPPED) && !defined(Q_OS_WINCE)
if (displayMessageBox()) {
const UINT flags = MB_OK | MB_TOPMOST | MB_SETFOREGROUND
| (type == UsageMessage ? MB_ICONINFORMATION : MB_ICONERROR);
@@ -553,7 +559,7 @@ static void showParserMessage(const QString &message, MessageType type)
reinterpret_cast<const wchar_t *>(title.utf16()), flags);
return;
}
-#endif // Q_OS_WIN && !QT_BOOTSTRAPPED && !Q_OS_WIN && !Q_OS_WINRT
+#endif // Q_OS_WIN && !QT_BOOTSTRAPPED && !Q_OS_WINCE
fputs(qPrintable(message), type == UsageMessage ? stdout : stderr);
}