summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qguiapplication.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-06-28 08:56:44 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-06-28 08:58:49 +0200
commitbe35b70ca1bf61d022f7dee9df4aaccbf715b25e (patch)
treedd59ae3713b2bc516101f921491292a8b2c295e3 /src/gui/kernel/qguiapplication.cpp
parentcc54161abb977751b4499c559fc0f464b9e2399e (diff)
parent572200989b224ad68e7b8ae4c0aecceb6ca871a2 (diff)
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'src/gui/kernel/qguiapplication.cpp')
-rw-r--r--src/gui/kernel/qguiapplication.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 77c9978a9e..89664447c4 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -94,9 +94,12 @@
#include <QtGui/QClipboard>
#endif
-#ifdef Q_OS_MAC
+#if defined(Q_OS_MAC)
# include "private/qcore_mac_p.h"
-#endif
+#elif defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+# include <QtCore/qt_windows.h>
+# include <QtCore/QLibraryInfo>
+#endif // Q_OS_WIN && !Q_OS_WINCE
QT_BEGIN_NAMESPACE
@@ -789,6 +792,12 @@ static void init_platform(const QString &pluginArgument, const QString &platform
fatalMessage += QStringLiteral("Available platforms are: %1\n").arg(
keys.join(QStringLiteral(", ")));
fatalMessage += QStringLiteral("GUI applications require a platform plugin. Terminating.");
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+ // Windows: Display message box unless it is a console application
+ // or debug build showing an assert box.
+ if (!QLibraryInfo::isDebugBuild() && !GetConsoleWindow())
+ MessageBox(0, (LPCTSTR)fatalMessage.utf16(), (LPCTSTR)(QCoreApplication::applicationName().utf16()), MB_OK | MB_ICONERROR);
+#endif // Q_OS_WIN && !Q_OS_WINCE
qFatal("%s", qPrintable(fatalMessage));
return;
}