diff options
Diffstat (limited to 'src/gui/kernel/qguiapplication.cpp')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 2a1d7e3bcc..3c3cea2910 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -782,12 +782,14 @@ static void init_platform(const QString &pluginArgument, const QString &platform QGuiApplicationPrivate::platform_name = new QString(name); } else { QStringList keys = QPlatformIntegrationFactory::keys(platformPluginPath); - QString fatalMessage = - QString::fromLatin1("Failed to load platform plugin \"%1\". Available platforms are: \n").arg(name); - foreach(const QString &key, keys) { - fatalMessage.append(key + QLatin1Char('\n')); - } - qFatal("%s", fatalMessage.toLocal8Bit().constData()); + + QString fatalMessage + = QStringLiteral("Failed to find or load platform plugin \"%1\".\n").arg(name); + if (!keys.isEmpty()) + fatalMessage += QStringLiteral("Available platforms are: %1\n").arg( + keys.join(QStringLiteral(", "))); + fatalMessage += QStringLiteral("GUI applications require a platform plugin. Terminating."); + qFatal(qPrintable(fatalMessage)); return; } @@ -2251,8 +2253,8 @@ void QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::E if (!p->receivedExpose) { if (p->resizeEventPending) { // as a convenience for plugins, send a resize event before the first expose event if they haven't done so - QSize size = p->geometry.size(); - QResizeEvent e(size, size); + // window->geometry() should have a valid size as soon as a handle exists. + QResizeEvent e(window->geometry().size(), p->geometry.size()); QGuiApplication::sendSpontaneousEvent(window, &e); p->resizeEventPending = false; |