Remove obsolete storage, constructors and accessors in QEvent subclasses

Change-Id: I5c51244031ff40f1972106ad4fe27010c8be1193
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Shawn Rutledge 2020-04-10 12:55:43 +02:00
parent 548dcef089
commit 688e5da4e7
7 changed files with 14 additions and 501 deletions

View File

@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the QtGui module of the Qt Toolkit. ** This file is part of the QtGui module of the Qt Toolkit.
@ -655,7 +655,7 @@ QHoverEvent::~QHoverEvent()
{ {
} }
#if QT_CONFIG(wheelevent)
/*! /*!
\class QWheelEvent \class QWheelEvent
\brief The QWheelEvent class contains parameters that describe a wheel event. \brief The QWheelEvent class contains parameters that describe a wheel event.
@ -743,106 +743,6 @@ QHoverEvent::~QHoverEvent()
\l inverted always returns false. \l inverted always returns false.
*/ */
#if QT_DEPRECATED_SINCE(5, 15)
/*!
\fn Qt::Orientation QWheelEvent::orientation() const
\obsolete
Use angleDelta() instead.
*/
#endif
#if QT_CONFIG(wheelevent)
#if QT_DEPRECATED_SINCE(5, 15)
/*!
\obsolete
This constructor has been deprecated.
*/
QWheelEvent::QWheelEvent(const QPointF &pos, int delta,
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers,
Qt::Orientation orient)
: QInputEvent(Wheel, modifiers), p(pos), qt4D(delta), qt4O(orient), mouseState(buttons),
src(Qt::MouseEventNotSynthesized), invertedScrolling(false), ph(Qt::NoScrollPhase)
{
g = QCursor::pos();
if (orient == Qt::Vertical)
angleD = QPoint(0, delta);
else
angleD = QPoint(delta, 0);
}
/*!
\obsolete
This constructor has been deprecated.
*/
QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos, int delta,
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers,
Qt::Orientation orient)
: QInputEvent(Wheel, modifiers), p(pos), g(globalPos), qt4D(delta), qt4O(orient), mouseState(buttons),
src(Qt::MouseEventNotSynthesized), invertedScrolling(false), ph(Qt::NoScrollPhase)
{
if (orient == Qt::Vertical)
angleD = QPoint(0, delta);
else
angleD = QPoint(delta, 0);
}
/*!
\obsolete
This constructor has been deprecated.
*/
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos,
QPoint pixelDelta, QPoint angleDelta, int qt4Delta, Qt::Orientation qt4Orientation,
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers)
: QWheelEvent(pos, globalPos, pixelDelta, angleDelta, qt4Delta, qt4Orientation,
buttons, modifiers, Qt::NoScrollPhase)
{}
QT_WARNING_POP
/*!
\obsolete
This constructor has been deprecated.
*/
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos,
QPoint pixelDelta, QPoint angleDelta, int qt4Delta, Qt::Orientation qt4Orientation,
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::ScrollPhase phase)
: QWheelEvent(pos, globalPos, pixelDelta, angleDelta, qt4Delta, qt4Orientation,
buttons, modifiers, phase, Qt::MouseEventNotSynthesized)
{}
QT_WARNING_POP
/*!
\obsolete
This constructor has been deprecated.
*/
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos,
QPoint pixelDelta, QPoint angleDelta, int qt4Delta, Qt::Orientation qt4Orientation,
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::ScrollPhase phase, Qt::MouseEventSource source)
: QWheelEvent(pos, globalPos, pixelDelta, angleDelta, qt4Delta, qt4Orientation,
buttons, modifiers, phase, source, false)
{}
QT_WARNING_POP
/*!
\obsolete
This constructor has been deprecated.
*/
QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos,
QPoint pixelDelta, QPoint angleDelta, int qt4Delta, Qt::Orientation qt4Orientation,
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::ScrollPhase phase, Qt::MouseEventSource source, bool inverted)
: QInputEvent(Wheel, modifiers), p(pos), g(globalPos), pixelD(pixelDelta),
angleD(angleDelta), qt4D(qt4Delta), qt4O(qt4Orientation), mouseState(buttons), src(source),
invertedScrolling(inverted), ph(phase)
{}
#endif // QT_DEPRECATED_SINCE(5, 15)
/*! /*!
Constructs a wheel event object. Constructs a wheel event object.
@ -877,10 +777,8 @@ QWheelEvent::QWheelEvent(QPointF pos, QPointF globalPos, QPoint pixelDelta, QPoi
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::ScrollPhase phase, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::ScrollPhase phase,
bool inverted, Qt::MouseEventSource source) bool inverted, Qt::MouseEventSource source)
: QInputEvent(Wheel, modifiers), p(pos), g(globalPos), pixelD(pixelDelta), angleD(angleDelta), : QInputEvent(Wheel, modifiers), p(pos), g(globalPos), pixelD(pixelDelta), angleD(angleDelta),
qt4O(qAbs(angleDelta.x()) > qAbs(angleDelta.y()) ? Qt::Horizontal : Qt::Vertical), mouseState(buttons), src(source), ph(phase), invertedScrolling(inverted)
mouseState(buttons), src(source), invertedScrolling(inverted), ph(phase)
{ {
qt4D = (qt4O == Qt::Horizontal ? angleDelta.x() : angleDelta.y());
} }
/*! /*!
@ -974,72 +872,6 @@ QWheelEvent::~QWheelEvent()
\sa position() \sa position()
*/ */
#if QT_DEPRECATED_SINCE(5, 15)
/*!
\fn int QWheelEvent::delta() const
\obsolete
This function has been deprecated, use pixelDelta() or angleDelta() instead.
*/
/*!
\fn QPoint QWheelEvent::pos() const
\obsolete
This function has been deprecated, use position() instead.
*/
/*!
\fn int QWheelEvent::x() const
\obsolete
This function has been deprecated, use position() instead.
*/
/*!
\fn int QWheelEvent::y() const
\obsolete
This function has been deprecated, use position() instead.
*/
/*!
\fn QPoint QWheelEvent::globalPos() const
\obsolete
This function has been deprecated, use globalPosition() instead.
*/
/*!
\fn int QWheelEvent::globalX() const
\obsolete
This function has been deprecated, use globalPosition() instead.
*/
/*!
\fn int QWheelEvent::globalY() const
\obsolete
This function has been deprecated, use globalPosition() instead.
*/
/*!
\fn const QPointF &QWheelEvent::posF() const
\obsolete
This function has been deprecated, use position() instead.
*/
/*!
\fn const QPointF &QWheelEvent::globalPosF() const
\obsolete
This function has been deprecated, use globalPosition() instead.
*/
#endif
/*! /*!
\fn Qt::ScrollPhase QWheelEvent::phase() const \fn Qt::ScrollPhase QWheelEvent::phase() const
\since 5.2 \since 5.2
@ -2637,18 +2469,6 @@ Qt::MouseButtons QTabletEvent::buttons() const
\sa Qt::NativeGestureType, QGestureEvent \sa Qt::NativeGestureType, QGestureEvent
*/ */
#if QT_DEPRECATED_SINCE(5, 10)
/*!
\deprecated The QTouchDevice parameter is now required
*/
QNativeGestureEvent::QNativeGestureEvent(Qt::NativeGestureType type, const QPointF &localPos, const QPointF &windowPos,
const QPointF &screenPos, qreal realValue, ulong sequenceId, quint64 intValue)
: QInputEvent(QEvent::NativeGesture), mGestureType(type),
mLocalPos(localPos), mWindowPos(windowPos), mScreenPos(screenPos), mRealValue(realValue),
mSequenceId(sequenceId), mIntValue(intValue)
{ }
#endif
/*! /*!
Constructs a native gesture event of type \a type originating from \a device. Constructs a native gesture event of type \a type originating from \a device.
@ -3880,15 +3700,8 @@ QDebug operator<<(QDebug dbg, const QEvent *e)
case QEvent::Wheel: { case QEvent::Wheel: {
const QWheelEvent *we = static_cast<const QWheelEvent *>(e); const QWheelEvent *we = static_cast<const QWheelEvent *>(e);
dbg << "QWheelEvent(" << we->phase(); dbg << "QWheelEvent(" << we->phase();
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED // delta() and orientation()
if (!we->pixelDelta().isNull() || !we->angleDelta().isNull()) if (!we->pixelDelta().isNull() || !we->angleDelta().isNull())
dbg << ", pixelDelta=" << we->pixelDelta() << ", angleDelta=" << we->angleDelta(); dbg << ", pixelDelta=" << we->pixelDelta() << ", angleDelta=" << we->angleDelta();
#if QT_DEPRECATED_SINCE(5, 14)
else if (int qt4Delta = we->delta())
dbg << ", delta=" << qt4Delta << ", orientation=" << we->orientation();
#endif
QT_WARNING_POP
dbg << ')'; dbg << ')';
} }
break; break;
@ -4573,47 +4386,6 @@ QPointF QTouchEvent::TouchPoint::lastNormalizedPos() const
return d->lastNormalizedPos; return d->lastNormalizedPos;
} }
#if QT_DEPRECATED_SINCE(5, 15)
/*!
\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().
*/
QRectF QTouchEvent::TouchPoint::rect() const
{
QRectF ret(QPointF(), d->ellipseDiameters);
ret.moveCenter(d->pos);
return ret;
}
/*!
\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().
*/
QRectF QTouchEvent::TouchPoint::sceneRect() const
{
QRectF ret(QPointF(), d->ellipseDiameters);
ret.moveCenter(d->scenePos);
return ret;
}
/*!
\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().
*/
QRectF QTouchEvent::TouchPoint::screenRect() const
{
QRectF ret(QPointF(), d->ellipseDiameters);
ret.moveCenter(d->screenPos);
return ret;
}
#endif
/*! /*!
Returns the pressure of this touch point. The return value is in Returns the pressure of this touch point. The return value is in
the range 0.0 to 1.0. the range 0.0 to 1.0.
@ -4811,42 +4583,6 @@ void QTouchEvent::TouchPoint::setLastNormalizedPos(const QPointF &lastNormalized
d->lastNormalizedPos = lastNormalizedPos; d->lastNormalizedPos = lastNormalizedPos;
} }
#if QT_DEPRECATED_SINCE(5, 15)
// ### remove the following 3 setRect functions and their usages soon
/*! \internal
\obsolete
*/
void QTouchEvent::TouchPoint::setRect(const QRectF &rect)
{
if (d->ref.loadRelaxed() != 1)
d = d->detach();
d->pos = rect.center();
d->ellipseDiameters = rect.size();
}
/*! \internal
\obsolete
*/
void QTouchEvent::TouchPoint::setSceneRect(const QRectF &sceneRect)
{
if (d->ref.loadRelaxed() != 1)
d = d->detach();
d->scenePos = sceneRect.center();
d->ellipseDiameters = sceneRect.size();
}
/*! \internal
\obsolete
*/
void QTouchEvent::TouchPoint::setScreenRect(const QRectF &screenRect)
{
if (d->ref.loadRelaxed() != 1)
d = d->detach();
d->screenPos = screenRect.center();
d->ellipseDiameters = screenRect.size();
}
#endif
/*! \internal */ /*! \internal */
void QTouchEvent::TouchPoint::setPressure(qreal pressure) void QTouchEvent::TouchPoint::setPressure(qreal pressure)
{ {

View File

@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the QtGui module of the Qt Toolkit. ** This file is part of the QtGui module of the Qt Toolkit.
@ -173,35 +173,6 @@ class Q_GUI_EXPORT QWheelEvent : public QInputEvent
public: public:
enum { DefaultDeltasPerStep = 120 }; enum { DefaultDeltasPerStep = 120 };
#if QT_DEPRECATED_SINCE(5, 15)
// Actually deprecated since 5.0, in docs
QT_DEPRECATED_VERSION_X_5_15("Use the last QWheelEvent constructor taking pixelDelta, angleDelta, phase, and inverted")
QWheelEvent(const QPointF &pos, int delta,
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers,
Qt::Orientation orient = Qt::Vertical);
// Actually deprecated since 5.0, in docs
QT_DEPRECATED_VERSION_X_5_15("Use the last QWheelEvent constructor taking pixelDelta, angleDelta, phase, and inverted")
QWheelEvent(const QPointF &pos, const QPointF& globalPos, int delta,
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers,
Qt::Orientation orient = Qt::Vertical);
QT_DEPRECATED_VERSION_X_5_15("Use the last QWheelEvent constructor taking pixelDelta, angleDelta, phase, and inverted")
QWheelEvent(const QPointF &pos, const QPointF& globalPos,
QPoint pixelDelta, QPoint angleDelta, int qt4Delta, Qt::Orientation qt4Orientation,
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
QT_DEPRECATED_VERSION_X_5_15("Use the last QWheelEvent constructor taking pixelDelta, angleDelta, phase, and inverted")
QWheelEvent(const QPointF &pos, const QPointF& globalPos,
QPoint pixelDelta, QPoint angleDelta, int qt4Delta, Qt::Orientation qt4Orientation,
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::ScrollPhase phase);
QT_DEPRECATED_VERSION_X_5_15("Use the last QWheelEvent constructor taking pixelDelta, angleDelta, phase, and inverted")
QWheelEvent(const QPointF &pos, const QPointF &globalPos, QPoint pixelDelta, QPoint angleDelta,
int qt4Delta, Qt::Orientation qt4Orientation, Qt::MouseButtons buttons,
Qt::KeyboardModifiers modifiers, Qt::ScrollPhase phase, Qt::MouseEventSource source);
QT_DEPRECATED_VERSION_X_5_15("Use the last QWheelEvent constructor taking pixelDelta, angleDelta, phase, and inverted")
QWheelEvent(const QPointF &pos, const QPointF &globalPos, QPoint pixelDelta, QPoint angleDelta,
int qt4Delta, Qt::Orientation qt4Orientation, Qt::MouseButtons buttons,
Qt::KeyboardModifiers modifiers, Qt::ScrollPhase phase, Qt::MouseEventSource source, bool inverted);
#endif
QWheelEvent(QPointF pos, QPointF globalPos, QPoint pixelDelta, QPoint angleDelta, QWheelEvent(QPointF pos, QPointF globalPos, QPoint pixelDelta, QPoint angleDelta,
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::ScrollPhase phase, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::ScrollPhase phase,
bool inverted, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); bool inverted, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized);
@ -211,33 +182,6 @@ public:
inline QPoint pixelDelta() const { return pixelD; } inline QPoint pixelDelta() const { return pixelD; }
inline QPoint angleDelta() const { return angleD; } inline QPoint angleDelta() const { return angleD; }
#if QT_DEPRECATED_SINCE(5, 15)
// Actually deprecated since 5.0, in docs
QT_DEPRECATED_VERSION_X_5_15("Use angleDelta()")
inline int delta() const { return qt4D; }
// Actually deprecated since 5.0, in docs
QT_DEPRECATED_VERSION_X_5_15("Use angleDelta()")
inline Qt::Orientation orientation() const { return qt4O; }
#ifndef QT_NO_INTEGER_EVENT_COORDINATES
QT_DEPRECATED_VERSION_X_5_15("Use position()")
inline QPoint pos() const { return p.toPoint(); }
QT_DEPRECATED_VERSION_X_5_15("Use globalPosition()")
inline QPoint globalPos() const { return g.toPoint(); }
QT_DEPRECATED_VERSION_X_5_15("Use position()")
inline int x() const { return int(p.x()); }
QT_DEPRECATED_VERSION_X_5_15("Use position()")
inline int y() const { return int(p.y()); }
QT_DEPRECATED_VERSION_X_5_15("Use globalPosition()")
inline int globalX() const { return int(g.x()); }
QT_DEPRECATED_VERSION_X_5_15("Use globalPosition()")
inline int globalY() const { return int(g.y()); }
#endif
QT_DEPRECATED_VERSION_X_5_15("Use position()")
inline const QPointF &posF() const { return p; }
QT_DEPRECATED_VERSION_X_5_15("Use globalPosition()")
inline const QPointF &globalPosF() const { return g; }
#endif // QT_DEPRECATED_SINCE(5, 15)
inline QPointF position() const { return p; } inline QPointF position() const { return p; }
inline QPointF globalPosition() const { return g; } inline QPointF globalPosition() const { return g; }
@ -253,14 +197,11 @@ protected:
QPointF g; QPointF g;
QPoint pixelD; QPoint pixelD;
QPoint angleD; QPoint angleD;
int qt4D = 0; Qt::MouseButtons mouseState;
Qt::Orientation qt4O = Qt::Vertical;
Qt::MouseButtons mouseState = Qt::NoButton;
uint _unused_ : 2; // Kept for binary compatibility
uint src: 2; uint src: 2;
bool invertedScrolling : 1;
uint ph : 3; uint ph : 3;
int reserved : 24; bool invertedScrolling : 1;
int reserved : 26;
friend class QApplication; friend class QApplication;
}; };
@ -321,10 +262,6 @@ protected:
class Q_GUI_EXPORT QNativeGestureEvent : public QInputEvent class Q_GUI_EXPORT QNativeGestureEvent : public QInputEvent
{ {
public: public:
#if QT_DEPRECATED_SINCE(5, 10)
QT_DEPRECATED QNativeGestureEvent(Qt::NativeGestureType type, const QPointF &localPos, const QPointF &windowPos,
const QPointF &screenPos, qreal value, ulong sequenceId, quint64 intArgument);
#endif
QNativeGestureEvent(Qt::NativeGestureType type, const QTouchDevice *dev, const QPointF &localPos, const QPointF &windowPos, QNativeGestureEvent(Qt::NativeGestureType type, const QTouchDevice *dev, const QPointF &localPos, const QPointF &windowPos,
const QPointF &screenPos, qreal value, ulong sequenceId, quint64 intArgument); const QPointF &screenPos, qreal value, ulong sequenceId, quint64 intArgument);
~QNativeGestureEvent(); ~QNativeGestureEvent();
@ -888,23 +825,6 @@ public:
QPointF startNormalizedPos() const; QPointF startNormalizedPos() const;
QPointF lastNormalizedPos() 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 pressure() const;
qreal rotation() const; qreal rotation() const;
QSizeF ellipseDiameters() const; QSizeF ellipseDiameters() const;

View File

@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Copyright (C) 2016 Intel Corporation. ** Copyright (C) 2016 Intel Corporation.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
@ -2302,16 +2302,8 @@ void QGuiApplicationPrivate::processWheelEvent(QWindowSystemInterfacePrivate::Wh
return; return;
} }
#if QT_DEPRECATED_SINCE(5, 14) QWheelEvent ev(localPoint, globalPoint, e->pixelDelta, e->angleDelta,
QT_WARNING_PUSH mouse_buttons, e->modifiers, e->phase, e->inverted, e->source);
QT_WARNING_DISABLE_DEPRECATED
QWheelEvent ev(localPoint, globalPoint, e->pixelDelta, e->angleDelta, e->qt4Delta, e->qt4Orientation,
mouse_buttons, e->modifiers, e->phase, e->source, e->inverted);
QT_WARNING_POP
#else
QWheelEvent ev(localPoint, globalPoint, e->pixelDelta, e->angleDelta,
mouse_buttons, e->modifiers, e->phase, e->inverted, e->source);
#endif
ev.setTimestamp(e->timestamp); ev.setTimestamp(e->timestamp);
QGuiApplication::sendSpontaneousEvent(window, &ev); QGuiApplication::sendSpontaneousEvent(window, &ev);
#else #else

View File

@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the QtGui module of the Qt Toolkit. ** This file is part of the QtGui module of the Qt Toolkit.
@ -367,31 +367,6 @@ QT_DEFINE_QPA_EVENT_HANDLER(bool, handleCloseEvent, QWindow *window)
\a w == 0 means that the event is in global coords only, \a local will be ignored in this case \a w == 0 means that the event is in global coords only, \a local will be ignored in this case
*/ */
#if QT_DEPRECATED_SINCE(5, 11)
QT_DEFINE_QPA_EVENT_HANDLER(bool, handleMouseEvent, QWindow *window, const QPointF &local, const QPointF &global, Qt::MouseButtons b,
Qt::KeyboardModifiers mods, Qt::MouseEventSource source)
{
return handleMouseEvent<Delivery>(window, local, global, b, Qt::NoButton, QEvent::None, mods, source);
}
QT_DEFINE_QPA_EVENT_HANDLER(bool, handleMouseEvent, QWindow *window, ulong timestamp, const QPointF &local, const QPointF &global, Qt::MouseButtons b,
Qt::KeyboardModifiers mods, Qt::MouseEventSource source)
{
return handleMouseEvent<Delivery>(window, timestamp, local, global, b, Qt::NoButton, QEvent::None, mods, source);
}
bool QWindowSystemInterface::handleFrameStrutMouseEvent(QWindow *window, const QPointF &local, const QPointF &global, Qt::MouseButtons b,
Qt::KeyboardModifiers mods, Qt::MouseEventSource source)
{
return handleFrameStrutMouseEvent(window, local, global, b, Qt::NoButton, QEvent::None, mods, source);
}
bool QWindowSystemInterface::handleFrameStrutMouseEvent(QWindow *window, ulong timestamp, const QPointF &local, const QPointF &global, Qt::MouseButtons b,
Qt::KeyboardModifiers mods, Qt::MouseEventSource source)
{
return handleFrameStrutMouseEvent(window, timestamp, local, global, b, Qt::NoButton, QEvent::None, mods, source);
}
#endif // QT_DEPRECATED_SINCE(5, 11)
QT_DEFINE_QPA_EVENT_HANDLER(bool, handleMouseEvent, QWindow *window, QT_DEFINE_QPA_EVENT_HANDLER(bool, handleMouseEvent, QWindow *window,
const QPointF &local, const QPointF &global, Qt::MouseButtons state, const QPointF &local, const QPointF &global, Qt::MouseButtons state,
@ -548,22 +523,6 @@ QWindowSystemInterfacePrivate::WheelEvent::WheelEvent(QWindow *window, ulong tim
{ {
} }
#if QT_DEPRECATED_SINCE(5, 10)
bool QWindowSystemInterface::handleWheelEvent(QWindow *window, const QPointF &local, const QPointF &global, int d, Qt::Orientation o, Qt::KeyboardModifiers mods) {
unsigned long time = QWindowSystemInterfacePrivate::eventTime.elapsed();
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
return handleWheelEvent(window, time, local, global, d, o, mods);
QT_WARNING_POP
}
bool QWindowSystemInterface::handleWheelEvent(QWindow *window, ulong timestamp, const QPointF &local, const QPointF &global, int d, Qt::Orientation o, Qt::KeyboardModifiers mods)
{
QPoint point = (o == Qt::Vertical) ? QPoint(0, d) : QPoint(d, 0);
return handleWheelEvent(window, timestamp, local, global, QPoint(), point, mods);
}
#endif // QT_DEPRECATED_SINCE(5, 10)
bool QWindowSystemInterface::handleWheelEvent(QWindow *window, const QPointF &local, const QPointF &global, QPoint pixelDelta, QPoint angleDelta, Qt::KeyboardModifiers mods, Qt::ScrollPhase phase, Qt::MouseEventSource source) bool QWindowSystemInterface::handleWheelEvent(QWindow *window, const QPointF &local, const QPointF &global, QPoint pixelDelta, QPoint angleDelta, Qt::KeyboardModifiers mods, Qt::ScrollPhase phase, Qt::MouseEventSource source)
{ {
unsigned long time = QWindowSystemInterfacePrivate::eventTime.elapsed(); unsigned long time = QWindowSystemInterfacePrivate::eventTime.elapsed();
@ -688,7 +647,7 @@ QList<QTouchEvent::TouchPoint>
p.setState(point->state); p.setState(point->state);
p.setScreenPos(QHighDpi::fromNativePixels(point->area.center(), window)); p.setScreenPos(QHighDpi::fromNativePixels(point->area.center(), window));
p.setEllipseDiameters(point->area.size()); p.setEllipseDiameters(QHighDpi::fromNativePixels(point->area.size(), window));
// The local pos and rect are not set, they will be calculated // The local pos and rect are not set, they will be calculated
// when the event gets processed by QGuiApplication. // when the event gets processed by QGuiApplication.
@ -751,6 +710,7 @@ QList<QWindowSystemInterface::TouchPoint>
p.normalPosition = QHighDpi::toNativeLocalPosition(pt.normalizedPos(), window); p.normalPosition = QHighDpi::toNativeLocalPosition(pt.normalizedPos(), window);
QRectF area(QPointF(), pt.ellipseDiameters()); QRectF area(QPointF(), pt.ellipseDiameters());
area.moveCenter(pt.screenPos()); area.moveCenter(pt.screenPos());
// TODO store ellipseDiameters in QWindowSystemInterface::TouchPoint or just use QTouchEvent::TouchPoint
p.area = QHighDpi::toNativePixels(area, window); p.area = QHighDpi::toNativePixels(area, window);
p.pressure = pt.pressure(); p.pressure = pt.pressure();
p.state = pt.state(); p.state = pt.state();
@ -899,23 +859,6 @@ QT_DEFINE_QPA_EVENT_HANDLER(void, handleThemeChange, QWindow *window)
} }
#if QT_CONFIG(draganddrop) #if QT_CONFIG(draganddrop)
#if QT_DEPRECATED_SINCE(5, 11)
QPlatformDragQtResponse QWindowSystemInterface::handleDrag(QWindow *window, const QMimeData *dropData,
const QPoint &p, Qt::DropActions supportedActions)
{
return QGuiApplicationPrivate::processDrag(window, dropData, p, supportedActions,
QGuiApplication::mouseButtons(),
QGuiApplication::keyboardModifiers());
}
QPlatformDropQtResponse QWindowSystemInterface::handleDrop(QWindow *window, const QMimeData *dropData,
const QPoint &p, Qt::DropActions supportedActions)
{
return QGuiApplicationPrivate::processDrop(window, dropData, p, supportedActions,
QGuiApplication::mouseButtons(),
QGuiApplication::keyboardModifiers());
}
#endif // QT_DEPRECATED_SINCE(5, 11)
/*! /*!
Drag and drop events are sent immediately. Drag and drop events are sent immediately.
@ -997,26 +940,6 @@ bool QWindowSystemInterface::handleTabletEvent(QWindow *window, const QPointF &l
xTilt, yTilt, tangentialPressure, rotation, z, uid, modifiers); xTilt, yTilt, tangentialPressure, rotation, z, uid, modifiers);
} }
#if QT_DEPRECATED_SINCE(5, 10)
void QWindowSystemInterface::handleTabletEvent(QWindow *window, ulong timestamp, bool down, const QPointF &local, const QPointF &global,
int device, int pointerType, qreal pressure, int xTilt, int yTilt,
qreal tangentialPressure, qreal rotation, int z, qint64 uid,
Qt::KeyboardModifiers modifiers)
{
handleTabletEvent(window, timestamp, local, global, device, pointerType, (down ? Qt::LeftButton : Qt::NoButton), pressure,
xTilt, yTilt, tangentialPressure, rotation, z, uid, modifiers);
}
void QWindowSystemInterface::handleTabletEvent(QWindow *window, bool down, const QPointF &local, const QPointF &global,
int device, int pointerType, qreal pressure, int xTilt, int yTilt,
qreal tangentialPressure, qreal rotation, int z, qint64 uid,
Qt::KeyboardModifiers modifiers)
{
handleTabletEvent(window, local, global, device, pointerType, (down ? Qt::LeftButton : Qt::NoButton), pressure,
xTilt, yTilt, tangentialPressure, rotation, z, uid, modifiers);
}
#endif // QT_DEPRECATED_SINCE(5, 10)
bool QWindowSystemInterface::handleTabletEnterProximityEvent(ulong timestamp, int device, int pointerType, qint64 uid) bool QWindowSystemInterface::handleTabletEnterProximityEvent(ulong timestamp, int device, int pointerType, qint64 uid)
{ {
QWindowSystemInterfacePrivate::TabletEnterProximityEvent *e = QWindowSystemInterfacePrivate::TabletEnterProximityEvent *e =

View File

@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the QtGui module of the Qt Toolkit. ** This file is part of the QtGui module of the Qt Toolkit.
@ -76,23 +76,6 @@ public:
struct AsynchronousDelivery {}; struct AsynchronousDelivery {};
struct DefaultDelivery {}; struct DefaultDelivery {};
#if QT_DEPRECATED_SINCE(5, 11)
template<typename Delivery = QWindowSystemInterface::DefaultDelivery>
QT_DEPRECATED static bool handleMouseEvent(QWindow *window, const QPointF &local, const QPointF &global, Qt::MouseButtons b,
Qt::KeyboardModifiers mods = Qt::NoModifier,
Qt::MouseEventSource source = Qt::MouseEventNotSynthesized);
template<typename Delivery = QWindowSystemInterface::DefaultDelivery>
QT_DEPRECATED static bool handleMouseEvent(QWindow *window, ulong timestamp, const QPointF &local, const QPointF &global, Qt::MouseButtons b,
Qt::KeyboardModifiers mods = Qt::NoModifier,
Qt::MouseEventSource source = Qt::MouseEventNotSynthesized);
QT_DEPRECATED static bool handleFrameStrutMouseEvent(QWindow *window, const QPointF &local, const QPointF &global, Qt::MouseButtons b,
Qt::KeyboardModifiers mods = Qt::NoModifier,
Qt::MouseEventSource source = Qt::MouseEventNotSynthesized);
QT_DEPRECATED static bool handleFrameStrutMouseEvent(QWindow *window, ulong timestamp, const QPointF &local, const QPointF &global, Qt::MouseButtons b,
Qt::KeyboardModifiers mods = Qt::NoModifier,
Qt::MouseEventSource source = Qt::MouseEventNotSynthesized);
#endif
template<typename Delivery = QWindowSystemInterface::DefaultDelivery> template<typename Delivery = QWindowSystemInterface::DefaultDelivery>
static bool handleMouseEvent(QWindow *window, const QPointF &local, const QPointF &global, static bool handleMouseEvent(QWindow *window, const QPointF &local, const QPointF &global,
Qt::MouseButtons state, Qt::MouseButton button, QEvent::Type type, Qt::MouseButtons state, Qt::MouseButton button, QEvent::Type type,
@ -148,11 +131,6 @@ public:
Qt::MouseEventSource source = Qt::MouseEventNotSynthesized, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized,
bool inverted = false); bool inverted = false);
#if QT_DEPRECATED_SINCE(5, 10)
QT_DEPRECATED static bool handleWheelEvent(QWindow *window, const QPointF &local, const QPointF &global, int d, Qt::Orientation o, Qt::KeyboardModifiers mods = Qt::NoModifier);
QT_DEPRECATED static bool handleWheelEvent(QWindow *window, ulong timestamp, const QPointF &local, const QPointF &global, int d, Qt::Orientation o, Qt::KeyboardModifiers mods = Qt::NoModifier);
#endif
struct TouchPoint { struct TouchPoint {
TouchPoint() : id(0), uniqueId(-1), pressure(0), rotation(0), state(Qt::TouchPointStationary) { } TouchPoint() : id(0), uniqueId(-1), pressure(0), rotation(0), state(Qt::TouchPointStationary) { }
int id; // for application use int id; // for application use
@ -219,12 +197,6 @@ public:
static bool handleApplicationTermination(); static bool handleApplicationTermination();
#if QT_CONFIG(draganddrop) #if QT_CONFIG(draganddrop)
#if QT_DEPRECATED_SINCE(5, 11)
QT_DEPRECATED static QPlatformDragQtResponse handleDrag(QWindow *window, const QMimeData *dropData,
const QPoint &p, Qt::DropActions supportedActions);
QT_DEPRECATED static QPlatformDropQtResponse handleDrop(QWindow *window, const QMimeData *dropData,
const QPoint &p, Qt::DropActions supportedActions);
#endif // #if QT_DEPRECATED_SINCE(5, 11)
static QPlatformDragQtResponse handleDrag(QWindow *window, const QMimeData *dropData, static QPlatformDragQtResponse handleDrag(QWindow *window, const QMimeData *dropData,
const QPoint &p, Qt::DropActions supportedActions, const QPoint &p, Qt::DropActions supportedActions,
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers); Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
@ -263,16 +235,6 @@ public:
int device, int pointerType, Qt::MouseButtons buttons, qreal pressure, int xTilt, int yTilt, int device, int pointerType, Qt::MouseButtons buttons, qreal pressure, int xTilt, int yTilt,
qreal tangentialPressure, qreal rotation, int z, qint64 uid, qreal tangentialPressure, qreal rotation, int z, qint64 uid,
Qt::KeyboardModifiers modifiers = Qt::NoModifier); Qt::KeyboardModifiers modifiers = Qt::NoModifier);
#if QT_DEPRECATED_SINCE(5, 10)
QT_DEPRECATED static void handleTabletEvent(QWindow *window, ulong timestamp, bool down, const QPointF &local, const QPointF &global,
int device, int pointerType, qreal pressure, int xTilt, int yTilt,
qreal tangentialPressure, qreal rotation, int z, qint64 uid,
Qt::KeyboardModifiers modifiers = Qt::NoModifier);
QT_DEPRECATED static void handleTabletEvent(QWindow *window, bool down, const QPointF &local, const QPointF &global,
int device, int pointerType, qreal pressure, int xTilt, int yTilt,
qreal tangentialPressure, qreal rotation, int z, qint64 uid,
Qt::KeyboardModifiers modifiers = Qt::NoModifier);
#endif
static bool handleTabletEnterProximityEvent(ulong timestamp, int device, int pointerType, qint64 uid); static bool handleTabletEnterProximityEvent(ulong timestamp, int device, int pointerType, qint64 uid);
static void handleTabletEnterProximityEvent(int device, int pointerType, qint64 uid); static void handleTabletEnterProximityEvent(int device, int pointerType, qint64 uid);
static bool handleTabletLeaveProximityEvent(ulong timestamp, int device, int pointerType, qint64 uid); static bool handleTabletLeaveProximityEvent(ulong timestamp, int device, int pointerType, qint64 uid);

View File

@ -3029,16 +3029,8 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
if (spontaneous && (phase == Qt::NoScrollPhase || phase == Qt::ScrollUpdate)) if (spontaneous && (phase == Qt::NoScrollPhase || phase == Qt::ScrollUpdate))
QApplicationPrivate::giveFocusAccordingToFocusPolicy(w, e, relpos); QApplicationPrivate::giveFocusAccordingToFocusPolicy(w, e, relpos);
#if QT_DEPRECATED_SINCE(5, 14)
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
QWheelEvent we(relpos, wheel->globalPos(), wheel->pixelDelta(), wheel->angleDelta(), wheel->delta(), wheel->orientation(), wheel->buttons(),
wheel->modifiers(), phase, wheel->source(), wheel->inverted());
QT_WARNING_POP
#else
QWheelEvent we(relpos, wheel->globalPosition(), wheel->pixelDelta(), wheel->angleDelta(), wheel->buttons(), QWheelEvent we(relpos, wheel->globalPosition(), wheel->pixelDelta(), wheel->angleDelta(), wheel->buttons(),
wheel->modifiers(), phase, wheel->inverted(), wheel->source()); wheel->modifiers(), phase, wheel->inverted(), wheel->source());
#endif
we.setTimestamp(wheel->timestamp()); we.setTimestamp(wheel->timestamp());
bool eventAccepted; bool eventAccepted;
do { do {
@ -3074,16 +3066,8 @@ QT_WARNING_POP
// sending those events until we get a ScrollEnd, which signifies // sending those events until we get a ScrollEnd, which signifies
// the end of the natural scrolling sequence. // the end of the natural scrolling sequence.
const QPoint &relpos = QApplicationPrivate::wheel_widget->mapFromGlobal(wheel->globalPosition().toPoint()); const QPoint &relpos = QApplicationPrivate::wheel_widget->mapFromGlobal(wheel->globalPosition().toPoint());
#if QT_DEPRECATED_SINCE(5, 0)
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
QWheelEvent we(relpos, wheel->globalPos(), wheel->pixelDelta(), wheel->angleDelta(), wheel->delta(), wheel->orientation(), wheel->buttons(),
wheel->modifiers(), wheel->phase(), wheel->source());
QT_WARNING_POP
#else
QWheelEvent we(relpos, wheel->globalPosition(), wheel->pixelDelta(), wheel->angleDelta(), wheel->buttons(), QWheelEvent we(relpos, wheel->globalPosition(), wheel->pixelDelta(), wheel->angleDelta(), wheel->buttons(),
wheel->modifiers(), wheel->phase(), wheel->inverted(), wheel->source()); wheel->modifiers(), wheel->phase(), wheel->inverted(), wheel->source());
#endif
we.setTimestamp(wheel->timestamp()); we.setTimestamp(wheel->timestamp());
we.spont = true; we.spont = true;
we.ignore(); we.ignore();

View File

@ -863,12 +863,8 @@ void QWidgetWindow::handleWheelEvent(QWheelEvent *event)
QPoint mapped = widget->mapFrom(rootWidget, pos); QPoint mapped = widget->mapFrom(rootWidget, pos);
#if QT_DEPRECATED_SINCE(5, 0)
QWheelEvent translated(mapped, event->globalPos(), event->pixelDelta(), event->angleDelta(), event->delta(), event->orientation(), event->buttons(), event->modifiers(), event->phase(), event->source(), event->inverted());
#else
QWheelEvent translated(QPointF(mapped), event->globalPosition(), event->pixelDelta(), event->angleDelta(), QWheelEvent translated(QPointF(mapped), event->globalPosition(), event->pixelDelta(), event->angleDelta(),
event->buttons(), event->modifiers(), event->phase(), event->inverted(), event->source()); event->buttons(), event->modifiers(), event->phase(), event->inverted(), event->source());
#endif
translated.setTimestamp(event->timestamp()); translated.setTimestamp(event->timestamp());
QGuiApplication::forwardEvent(widget, &translated, event); QGuiApplication::forwardEvent(widget, &translated, event);
} }