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>
This commit is contained in:
Shawn Rutledge 2020-03-30 12:07:29 +02:00
parent c3b6d09cae
commit 68916fede4
2 changed files with 20 additions and 26 deletions

View File

@ -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)

View File

@ -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);