Move the remaining QSinglePointEvent ctor to protected; add source arg
QSinglePointEvent no longer has public constructors: we don't expect users to construct instances, because it's conceptually an abstract base class (even though some subclasses don't add more storage). We give it a Qt::MouseEventSource argument so that m_source won't need to be set in other subclasses. There was some hope of removing MouseEventSource completely, but it hasn't been done, for the sake of avoiding SC breaks. Change-Id: Iea2946699726fb7ac98757b7b8f1b7cfdccc1449 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
parent
48219c8231
commit
f95691b8af
@ -81,7 +81,7 @@ QT_BEGIN_NAMESPACE
|
||||
window, and screen or desktop, respectively.
|
||||
*/
|
||||
QEnterEvent::QEnterEvent(const QPointF &localPos, const QPointF &scenePos, const QPointF &globalPos, const QPointingDevice *device)
|
||||
: QSinglePointEvent(QEvent::Enter, device, localPos, scenePos, globalPos)
|
||||
: QSinglePointEvent(QEvent::Enter, device, localPos, scenePos, globalPos, Qt::NoButton, Qt::NoButton, Qt::NoModifier)
|
||||
{
|
||||
}
|
||||
|
||||
@ -513,12 +513,14 @@ void QPointerEvent::clearPassiveGrabbers(const QEventPoint &point)
|
||||
/*!
|
||||
\internal
|
||||
*/
|
||||
QSinglePointEvent::QSinglePointEvent(QEvent::Type type, const QPointingDevice *dev, const QPointF &localPos, const QPointF &scenePos,
|
||||
const QPointF &globalPos, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers)
|
||||
QSinglePointEvent::QSinglePointEvent(QEvent::Type type, const QPointingDevice *dev,
|
||||
const QPointF &localPos, const QPointF &scenePos, const QPointF &globalPos,
|
||||
Qt::MouseButton button, Qt::MouseButtons buttons,
|
||||
Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source)
|
||||
: QPointerEvent(type, QEvent::SinglePointEventTag{}, dev, modifiers),
|
||||
m_button(button),
|
||||
m_mouseState(buttons),
|
||||
m_source(Qt::MouseEventNotSynthesized),
|
||||
m_source(source),
|
||||
m_doubleClick(false),
|
||||
m_reserved(0)
|
||||
{
|
||||
@ -753,9 +755,8 @@ QMouseEvent::QMouseEvent(QEvent::Type type, const QPointF &localPos, const QPoin
|
||||
const QPointF &globalPos, Qt::MouseButton button, Qt::MouseButtons buttons,
|
||||
Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source,
|
||||
const QPointingDevice *device)
|
||||
: QSinglePointEvent(type, device, localPos, windowPos, globalPos, button, buttons, modifiers)
|
||||
: QSinglePointEvent(type, device, localPos, windowPos, globalPos, button, buttons, modifiers, source)
|
||||
{
|
||||
m_source = source;
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -1157,10 +1158,9 @@ QHoverEvent::~QHoverEvent()
|
||||
QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF &globalPos, QPoint pixelDelta, QPoint angleDelta,
|
||||
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::ScrollPhase phase,
|
||||
bool inverted, Qt::MouseEventSource source, const QPointingDevice *device)
|
||||
: QSinglePointEvent(Wheel, device, pos, pos, globalPos, Qt::NoButton, buttons, modifiers),
|
||||
: QSinglePointEvent(Wheel, device, pos, pos, globalPos, Qt::NoButton, buttons, modifiers, source),
|
||||
m_phase(phase), m_invertedScrolling(inverted), m_pixelDelta(pixelDelta), m_angleDelta(angleDelta)
|
||||
{
|
||||
m_source = source;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -134,11 +134,6 @@ class Q_GUI_EXPORT QSinglePointEvent : public QPointerEvent
|
||||
Q_PROPERTY(QObject *exclusivePointGrabber READ exclusivePointGrabber WRITE setExclusivePointGrabber)
|
||||
|
||||
public:
|
||||
QSinglePointEvent(Type type, const QPointingDevice *dev, const QPointF &localPos,
|
||||
const QPointF &scenePos, const QPointF &globalPos,
|
||||
Qt::MouseButton button = Qt::NoButton, Qt::MouseButtons buttons = Qt::NoButton,
|
||||
Qt::KeyboardModifiers modifiers = Qt::NoModifier);
|
||||
|
||||
inline Qt::MouseButton button() const { return m_button; }
|
||||
inline Qt::MouseButtons buttons() const { return m_mouseState; }
|
||||
|
||||
@ -162,6 +157,11 @@ protected:
|
||||
QSinglePointEvent(Type type, const QPointingDevice *dev, const QEventPoint &point,
|
||||
Qt::MouseButton button, Qt::MouseButtons buttons,
|
||||
Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source);
|
||||
QSinglePointEvent(Type type, const QPointingDevice *dev, const QPointF &localPos,
|
||||
const QPointF &scenePos, const QPointF &globalPos,
|
||||
Qt::MouseButton button, Qt::MouseButtons buttons,
|
||||
Qt::KeyboardModifiers modifiers,
|
||||
Qt::MouseEventSource source = Qt::MouseEventNotSynthesized);
|
||||
|
||||
Qt::MouseButton m_button = Qt::NoButton;
|
||||
Qt::MouseButtons m_mouseState = Qt::NoButton;
|
||||
|
Loading…
Reference in New Issue
Block a user