diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-03-30 12:07:29 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-03-30 18:12:51 +0200 |
commit | 68916fede41d1eca5d07eb6b1db518d41a007616 (patch) | |
tree | 168450c6332238c8b16567fd1bd3d8fb463ce27e /src | |
parent | c3b6d09caef755171c8cd113e83b8f6f6f54cb7d (diff) |
Finish deprecating TouchPoint::rect, sceneRect and screenRect accessors
All 6 getters and setters were deprecated by doc comment \obsolete in
3c159957f863cf8d367a9261e7016e52cd0348c1 (Qt 5.9). Now we will generate
compiler warnings too.
Change-Id: I94c6da607fa5758072af1287c9286b6c52179cfb
Reviewed-by: Frederik Gladhorn <gladhorn@kde.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qevent.cpp | 30 | ||||
-rw-r--r-- | src/gui/kernel/qevent.h | 16 |
2 files changed, 20 insertions, 26 deletions
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index bda0949764..466e70db30 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -4653,19 +4653,12 @@ QPointF QTouchEvent::TouchPoint::lastNormalizedPos() const return d->lastNormalizedPos; } +#if QT_DEPRECATED_SINCE(5, 15) /*! - Returns the rect for this touch point, relative to the widget - or QGraphicsItem that received the event. The rect is centered - around the point returned by pos(). - - \note This function returns an empty rect if the device does not report touch point sizes. - - \obsolete This function is deprecated in 5.9 because it returns the outer bounds + \deprecated This function is deprecated since 5.9 because it returns the outer bounds of the touchpoint regardless of rotation, whereas a touchpoint is more correctly modeled as an ellipse at position pos() with ellipseDiameters() which are independent of rotation(). - - \sa scenePos(), ellipseDiameters() */ QRectF QTouchEvent::TouchPoint::rect() const { @@ -4675,16 +4668,10 @@ QRectF QTouchEvent::TouchPoint::rect() const } /*! - Returns the rect for this touch point in scene coordinates. - - \note This function returns an empty rect if the device does not report touch point sizes. - - \obsolete This function is deprecated in 5.9 because it returns the outer bounds + \deprecated This function is deprecated since 5.9 because it returns the outer bounds of the touchpoint regardless of rotation, whereas a touchpoint is more correctly modeled as an ellipse at position scenePos() with ellipseDiameters() which are independent of rotation(). - - \sa scenePos(), ellipseDiameters() */ QRectF QTouchEvent::TouchPoint::sceneRect() const { @@ -4694,16 +4681,10 @@ QRectF QTouchEvent::TouchPoint::sceneRect() const } /*! - Returns the rect for this touch point in screen coordinates. - - \note This function returns an empty rect if the device does not report touch point sizes. - - \obsolete This function is deprecated because it returns the outer bounds of the + \deprecated This function is deprecated since 5.9 because it returns the outer bounds of the touchpoint regardless of rotation, whereas a touchpoint is more correctly modeled as an ellipse at position screenPos() with ellipseDiameters() which are independent of rotation(). - - \sa screenPos(), ellipseDiameters() */ QRectF QTouchEvent::TouchPoint::screenRect() const { @@ -4711,6 +4692,7 @@ QRectF QTouchEvent::TouchPoint::screenRect() const ret.moveCenter(d->screenPos); return ret; } +#endif /*! Returns the pressure of this touch point. The return value is in @@ -4909,6 +4891,7 @@ void QTouchEvent::TouchPoint::setLastNormalizedPos(const QPointF &lastNormalized d->lastNormalizedPos = lastNormalizedPos; } +#if QT_DEPRECATED_SINCE(5, 15) // ### remove the following 3 setRect functions and their usages soon /*! \internal \obsolete @@ -4942,6 +4925,7 @@ void QTouchEvent::TouchPoint::setScreenRect(const QRectF &screenRect) d->screenPos = screenRect.center(); d->ellipseDiameters = screenRect.size(); } +#endif /*! \internal */ void QTouchEvent::TouchPoint::setPressure(qreal pressure) diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index cf596d8d45..4aba9ff729 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -933,10 +933,23 @@ public: QPointF startNormalizedPos() const; QPointF lastNormalizedPos() const; +#if QT_DEPRECATED_SINCE(5, 15) + // All these are actually deprecated since 5.9, in docs + QT_DEPRECATED_VERSION_X_5_15("Use pos() and ellipseDiameters()") QRectF rect() const; + QT_DEPRECATED_VERSION_X_5_15("Use scenePos() and ellipseDiameters()") QRectF sceneRect() const; + QT_DEPRECATED_VERSION_X_5_15("Use screenPos() and ellipseDiameters()") QRectF screenRect() const; + // internal + QT_DEPRECATED_VERSION_X_5_15("Use setPos() and setEllipseDiameters()") + void setRect(const QRectF &rect); // deprecated + QT_DEPRECATED_VERSION_X_5_15("Use setScenePos() and setEllipseDiameters()") + void setSceneRect(const QRectF &sceneRect); // deprecated + QT_DEPRECATED_VERSION_X_5_15("Use setScreenPos() and setEllipseDiameters()") + void setScreenRect(const QRectF &screenRect); // deprecated +#endif qreal pressure() const; qreal rotation() const; QSizeF ellipseDiameters() const; @@ -961,9 +974,6 @@ public: void setLastScenePos(const QPointF &lastScenePos); void setLastScreenPos(const QPointF &lastScreenPos); void setLastNormalizedPos(const QPointF &lastNormalizedPos); - void setRect(const QRectF &rect); // deprecated - void setSceneRect(const QRectF &sceneRect); // deprecated - void setScreenRect(const QRectF &screenRect); // deprecated void setPressure(qreal pressure); void setRotation(qreal angle); void setEllipseDiameters(const QSizeF &dia); |