summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2013-06-21 08:54:47 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-06-26 05:46:09 +0200
commit7ead3a39c71949e28d682f893f8b4037e25d7259 (patch)
tree17926765f66ee2e1d4eeb5486fc7dffb5f97d860 /src
parent851fae6dbe08785ebb8be3732c40fbe1a5a280a0 (diff)
Windows: Display a message box if platform plugin cannot be found.
Task-number: QTBUG-31765 Task-number: QTBUG-31760 Change-Id: Iadfabccf7be755564e313a8f0c128f533b9bd024 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Diffstat (limited to 'src')
-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;
}