summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorSergio Martins <sergio.martins@kdab.com>2017-12-13 23:23:42 +0000
committerSérgio Martins <sergio.martins@kdab.com>2017-12-15 13:54:37 +0000
commit60d99b6413600194a2d1f3dde8313b55bf3d12f0 (patch)
tree9a99073ddf67171a446efa347c4439fef34a4306 /src/gui
parentb4330bc391bbb08898f192ea3469b73aed09134c (diff)
Rework the "failed to find or load QPA plugin" message a bit
This is one of the most frequent problems users ask for help with, and they don't even know if the plugin was found but not loaded or simply not found. Qt knows what happened, so communicate it to the user. Change-Id: I6003ed4ab3d147a5d159b2002004e53c251cb512 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qguiapplication.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index f566677ff4..37fbfe679d 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -1140,8 +1140,14 @@ static void init_platform(const QString &pluginArgument, const QString &platform
if (Q_UNLIKELY(!QGuiApplicationPrivate::platform_integration)) {
QStringList keys = QPlatformIntegrationFactory::keys(platformPluginPath);
- QString fatalMessage
- = QStringLiteral("This application failed to start because it could not find or load the Qt platform plugin \"%1\"\nin \"%2\".\n\n").arg(name, QDir::toNativeSeparators(platformPluginPath));
+ QString fatalMessage;
+ if (keys.contains(name)) {
+ fatalMessage = QStringLiteral("This application failed to start because it could not load the Qt platform plugin \"%2\"\nin \"%3\", even though it was found. ").arg(name, QDir::toNativeSeparators(platformPluginPath));
+ fatalMessage += QStringLiteral("This is usually due to missing dependencies, which you can verify by setting the env variable QT_DEBUG_PLUGINS to 1.\n\n");
+ } else {
+ fatalMessage = QStringLiteral("This application failed to start because it could not find the Qt platform plugin \"%2\"\nin \"%3\".\n\n").arg(name, QDir::toNativeSeparators(platformPluginPath));
+ }
+
if (!keys.isEmpty()) {
fatalMessage += QStringLiteral("Available platform plugins are: %1.\n\n").arg(
keys.join(QLatin1String(", ")));