diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2020-10-27 14:36:38 +0100 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2020-11-17 07:10:32 +0000 |
commit | 9415c8b5cd075eaa643595e779227ca623087330 (patch) | |
tree | 6904854c698214d795915886b8deb273d67094fd | |
parent | 8cb1b07aea12d50b4fecc45c903705dfd368022a (diff) | |
download | qtwayland-9415c8b5cd075eaa643595e779227ca623087330.tar.gz |
Fix some compile warnings
QTouchEvent::touchPoints() is deprecated and replaced by just
points(), and there is a new value in Qt::TouchPointState.
normalizedPos() is replaced by normalizedPosition().
And QVariant::type() is deprecated.
Change-Id: I4a4eea2775030f67ad12488df25d4859099c1783
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
-rw-r--r-- | src/compositor/compositor_api/qwaylandquickitem.cpp | 2 | ||||
-rw-r--r-- | src/compositor/compositor_api/qwaylandtouch.cpp | 5 | ||||
-rw-r--r-- | src/compositor/extensions/qwaylandqttextinputmethod.cpp | 2 | ||||
-rw-r--r-- | src/compositor/extensions/qwlqttouch.cpp | 6 | ||||
-rw-r--r-- | tests/auto/client/seatv5/tst_seatv5.cpp | 4 |
5 files changed, 11 insertions, 8 deletions
diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp index 891823c6..36d0b371 100644 --- a/src/compositor/compositor_api/qwaylandquickitem.cpp +++ b/src/compositor/compositor_api/qwaylandquickitem.cpp @@ -683,7 +683,7 @@ void QWaylandQuickItem::touchEvent(QTouchEvent *event) QWaylandSeat *seat = compositor()->seatFor(event); QPointF pointPos; - const QList<QTouchEvent::TouchPoint> &points = event->touchPoints(); + const QList<QTouchEvent::TouchPoint> &points = event->points(); if (!points.isEmpty()) pointPos = points.at(0).position(); diff --git a/src/compositor/compositor_api/qwaylandtouch.cpp b/src/compositor/compositor_api/qwaylandtouch.cpp index 03ccdbbc..9272b453 100644 --- a/src/compositor/compositor_api/qwaylandtouch.cpp +++ b/src/compositor/compositor_api/qwaylandtouch.cpp @@ -162,6 +162,9 @@ uint QWaylandTouch::sendTouchPointEvent(QWaylandSurface *surface, int id, const case Qt::TouchPointStationary: // stationary points are not sent through wayland, the client must cache them break; + case Qt::TouchPointUnknownState: + // Ignored + break; } return serial; @@ -208,7 +211,7 @@ void QWaylandTouch::sendFullTouchEvent(QWaylandSurface *surface, QTouchEvent *ev if (ext && ext->postTouchEvent(event, surface)) return; - const QList<QTouchEvent::TouchPoint> points = event->touchPoints(); + const QList<QTouchEvent::TouchPoint> points = event->points(); if (points.isEmpty()) return; diff --git a/src/compositor/extensions/qwaylandqttextinputmethod.cpp b/src/compositor/extensions/qwaylandqttextinputmethod.cpp index 5119373a..91895796 100644 --- a/src/compositor/extensions/qwaylandqttextinputmethod.cpp +++ b/src/compositor/extensions/qwaylandqttextinputmethod.cpp @@ -306,7 +306,7 @@ void QWaylandQtTextInputMethod::sendInputMethodEvent(QInputMethodEvent *event) attribute.type, attribute.start, attribute.length, - attribute.value.type() == QVariant::Color ? attribute.value.value<QColor>().name() : QString()); + attribute.value.typeId() == QVariant::Color ? attribute.value.value<QColor>().name() : QString()); break; case QInputMethodEvent::Language: // ### What is the type of value? Is it string? Q_FALLTHROUGH(); diff --git a/src/compositor/extensions/qwlqttouch.cpp b/src/compositor/extensions/qwlqttouch.cpp index 2df66121..83e62b58 100644 --- a/src/compositor/extensions/qwlqttouch.cpp +++ b/src/compositor/extensions/qwlqttouch.cpp @@ -58,7 +58,7 @@ static inline int toFixed(qreal f) bool TouchExtensionGlobal::postTouchEvent(QTouchEvent *event, QWaylandSurface *surface) { - const QList<QTouchEvent::TouchPoint> points = event->touchPoints(); + const QList<QTouchEvent::TouchPoint> points = event->points(); const int pointCount = points.count(); if (!pointCount) return false; @@ -93,8 +93,8 @@ bool TouchExtensionGlobal::postTouchEvent(QTouchEvent *event, QWaylandSurface *s int x = toFixed(tp.position().x()); int y = toFixed(tp.position().y()); - int nx = toFixed(tp.normalizedPos().x()); - int ny = toFixed(tp.normalizedPos().y()); + int nx = toFixed(tp.normalizedPosition().x()); + int ny = toFixed(tp.normalizedPosition().y()); int w = toFixed(tp.ellipseDiameters().width()); int h = toFixed(tp.ellipseDiameters().height()); int vx = toFixed(tp.velocity().x()); diff --git a/tests/auto/client/seatv5/tst_seatv5.cpp b/tests/auto/client/seatv5/tst_seatv5.cpp index 0c4dcfe0..69c52ed5 100644 --- a/tests/auto/client/seatv5/tst_seatv5.cpp +++ b/tests/auto/client/seatv5/tst_seatv5.cpp @@ -421,7 +421,7 @@ public: explicit Event(const QTouchEvent *event) : type(event->type()) , touchPointStates(event->touchPointStates()) - , touchPoints(event->touchPoints()) + , touchPoints(event->points()) { } QEvent::Type type{}; @@ -506,7 +506,7 @@ void tst_seatv5::multiTouch() t->sendDown(xdgToplevel()->surface(), {48, 48}, 1); t->sendFrame(c); - // Compositor event order should not change the order of the QTouchEvent::touchPoints() + // Compositor event order should not change the order of the QTouchEvent::points() // See QTBUG-77014 t->sendMotion(c, {49, 48}, 1); t->sendMotion(c, {33, 32}, 0); |