diff options
Diffstat (limited to 'src/gui/kernel/qguiapplication.cpp')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 52 |
1 files changed, 38 insertions, 14 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 33b3d3f715..416c899270 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -104,13 +104,13 @@ #if defined(Q_OS_MAC) # include "private/qcore_mac_p.h" -#elif defined(Q_OS_WIN) && !defined(Q_OS_WINCE) +#elif defined(Q_OS_WIN) # include <QtCore/qt_windows.h> # include <QtCore/QLibraryInfo> # if defined(Q_OS_WINPHONE) # include <Objbase.h> # endif -#endif // Q_OS_WIN && !Q_OS_WINCE +#endif // Q_OS_WIN #include <ctype.h> @@ -656,9 +656,20 @@ QGuiApplicationPrivate::QGuiApplicationPrivate(int &argc, char **argv, int flags */ void QGuiApplication::setApplicationDisplayName(const QString &name) { - if (!QGuiApplicationPrivate::displayName) - QGuiApplicationPrivate::displayName = new QString; - *QGuiApplicationPrivate::displayName = name; + if (!QGuiApplicationPrivate::displayName) { + QGuiApplicationPrivate::displayName = new QString(name); + if (qGuiApp) { + disconnect(qGuiApp, &QGuiApplication::applicationNameChanged, + qGuiApp, &QGuiApplication::applicationDisplayNameChanged); + + if (QGuiApplicationPrivate::displayName != applicationName()) + emit qGuiApp->applicationDisplayNameChanged(); + } + } else if (name != *QGuiApplicationPrivate::displayName) { + *QGuiApplicationPrivate::displayName = name; + if (qGuiApp) + emit qGuiApp->applicationDisplayNameChanged(); + } } QString QGuiApplication::applicationDisplayName() @@ -1054,7 +1065,7 @@ QWindow *QGuiApplication::topLevelAt(const QPoint &pos) \li \c eglfs is a platform plugin for running Qt5 applications on top of EGL and OpenGL ES 2.0 without an actual windowing system (like X11 or Wayland). For more information, see \l{EGLFS}. - \li \c ios + \li \c ios (also used for tvOS) \li \c kms is an experimental platform plugin using kernel modesetting and \l{http://dri.freedesktop.org/wiki/DRM}{DRM} (Direct Rendering Manager). @@ -1102,12 +1113,12 @@ static void init_platform(const QString &pluginArgument, const QString &platform keys.join(QStringLiteral(", "))); } fatalMessage += QStringLiteral("Reinstalling the application may fix this problem."); -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) // 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 && !Q_OS_WINRT +#endif // Q_OS_WIN && !Q_OS_WINRT qFatal("%s", qPrintable(fatalMessage)); return; } @@ -1186,7 +1197,7 @@ static void init_plugins(const QList<QByteArray> &pluginList) if (plugin) QGuiApplicationPrivate::generic_plugin_list.append(plugin); else - qWarning() << "No such plugin for spec " << pluginSpec; + qWarning("No such plugin for spec \"%s\"", pluginSpec.constData()); } } @@ -1310,7 +1321,7 @@ void QGuiApplicationPrivate::init() #ifndef QT_NO_SESSIONMANAGER QString session_id; QString session_key; -# if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) +# if defined(Q_OS_WIN) wchar_t guidstr[40]; GUID guid; CoCreateGuid(&guid); @@ -1424,9 +1435,8 @@ void QGuiApplicationPrivate::init() init_plugins(pluginList); QWindowSystemInterface::flushWindowSystemEvents(); -#ifndef QT_NO_SESSIONMANAGER Q_Q(QGuiApplication); - +#ifndef QT_NO_SESSIONMANAGER // connect to the session manager session_manager = new QSessionManager(q, session_id, session_key); #endif @@ -1455,6 +1465,10 @@ void QGuiApplicationPrivate::init() if (layout_direction == Qt::LayoutDirectionAuto || force_reverse) QGuiApplication::setLayoutDirection(qt_detectRTLLanguage() ? Qt::RightToLeft : Qt::LeftToRight); + + if (!QGuiApplicationPrivate::displayName) + QObject::connect(q, &QGuiApplication::applicationNameChanged, + q, &QGuiApplication::applicationDisplayNameChanged); } extern void qt_cleanupFontDatabase(); @@ -2450,6 +2464,7 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To QWindow *window = e->window.data(); typedef QPair<Qt::TouchPointStates, QList<QTouchEvent::TouchPoint> > StatesAndTouchPoints; QHash<QWindow *, StatesAndTouchPoints> windowsNeedingEvents; + bool velocityOnly = false; for (int i = 0; i < e->points.count(); ++i) { QTouchEvent::TouchPoint touchPoint = e->points.at(i); @@ -2526,8 +2541,14 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To // Stationary points might not be delivered down to the receiving item // and get their position transformed, keep the old values instead. - if (touchPoint.state() != Qt::TouchPointStationary) + if (touchPoint.state() == Qt::TouchPointStationary) { + if (touchInfo.touchPoint.velocity() != touchPoint.velocity()) { + touchInfo.touchPoint.setVelocity(touchPoint.velocity()); + velocityOnly = true; + } + } else { touchInfo.touchPoint = touchPoint; + } break; } @@ -2561,7 +2582,10 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To break; case Qt::TouchPointStationary: // don't send the event if nothing changed - continue; + if (velocityOnly) + eventType = QEvent::TouchUpdate; + else + continue; default: eventType = QEvent::TouchUpdate; break; |