diff options
Diffstat (limited to 'src/gui/kernel/qguiapplication.cpp')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index cb7a0b8ac9..a3ef3b2314 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -58,6 +58,7 @@ #include <QtCore/private/qabstracteventdispatcher_p.h> #include <QtCore/qmutex.h> #include <QtCore/private/qthread_p.h> +#include <QtCore/private/qlocking_p.h> #include <QtCore/qdir.h> #include <QtCore/qlibraryinfo.h> #include <QtCore/qnumeric.h> @@ -2762,7 +2763,7 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To QWindow *window = e->window.data(); typedef QPair<Qt::TouchPointStates, QList<QTouchEvent::TouchPoint> > StatesAndTouchPoints; QHash<QWindow *, StatesAndTouchPoints> windowsNeedingEvents; - bool stationaryTouchPointChangedVelocity = false; + bool stationaryTouchPointChangedProperty = false; for (int i = 0; i < e->points.count(); ++i) { QTouchEvent::TouchPoint touchPoint = e->points.at(i); @@ -2842,7 +2843,11 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To if (touchPoint.state() == Qt::TouchPointStationary) { if (touchInfo.touchPoint.velocity() != touchPoint.velocity()) { touchInfo.touchPoint.setVelocity(touchPoint.velocity()); - stationaryTouchPointChangedVelocity = true; + stationaryTouchPointChangedProperty = true; + } + if (!qFuzzyCompare(touchInfo.touchPoint.pressure(), touchPoint.pressure())) { + touchInfo.touchPoint.setPressure(touchPoint.pressure()); + stationaryTouchPointChangedProperty = true; } } else { touchInfo.touchPoint = touchPoint; @@ -2883,7 +2888,7 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To break; case Qt::TouchPointStationary: // don't send the event if nothing changed - if (!stationaryTouchPointChangedVelocity) + if (!stationaryTouchPointChangedProperty) continue; Q_FALLTHROUGH(); default: @@ -3301,7 +3306,7 @@ void QGuiApplicationPrivate::applyWindowGeometrySpecificationTo(QWindow *window) QFont QGuiApplication::font() { Q_ASSERT_X(QGuiApplicationPrivate::self, "QGuiApplication::font()", "no QGuiApplication instance"); - QMutexLocker locker(&applicationFontMutex); + const auto locker = qt_scoped_lock(applicationFontMutex); initFontUnlocked(); return *QGuiApplicationPrivate::app_font; } @@ -3313,7 +3318,7 @@ QFont QGuiApplication::font() */ void QGuiApplication::setFont(const QFont &font) { - QMutexLocker locker(&applicationFontMutex); + auto locker = qt_unique_lock(applicationFontMutex); const bool emitChange = !QGuiApplicationPrivate::app_font || (*QGuiApplicationPrivate::app_font != font); if (!QGuiApplicationPrivate::app_font) @@ -3501,7 +3506,7 @@ Qt::ApplicationState QGuiApplication::applicationState() \since 5.14 Sets the high-DPI scale factor rounding policy for the application. The - policy decides how non-integer scale factors (such as Windows 150%) are + \a policy decides how non-integer scale factors (such as Windows 150%) are handled, for applications that have AA_EnableHighDpiScaling enabled. The two principal options are whether fractional scale factors should @@ -4077,7 +4082,7 @@ void QGuiApplicationPrivate::notifyThemeChanged() sendApplicationPaletteChange(); } if (!(applicationResourceFlags & ApplicationFontExplicitlySet)) { - QMutexLocker locker(&applicationFontMutex); + const auto locker = qt_scoped_lock(applicationFontMutex); clearFontUnlocked(); initFontUnlocked(); } |