summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qevent.cpp27
-rw-r--r--src/gui/kernel/qevent.h6
-rw-r--r--src/gui/kernel/qwindowsysteminterface.cpp8
-rw-r--r--src/gui/kernel/qwindowsysteminterface.h5
-rw-r--r--src/gui/kernel/qwindowsysteminterface_p.h4
5 files changed, 16 insertions, 34 deletions
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index 49cc411c4f..96fbc42f72 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -654,7 +654,7 @@ QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos, int delta
event data: \a qt4Delta specifies the rotation, and \a qt4Orientation the
direction.
- The phase() is initialized to QWheelEvent::Changed. Use the other constructor
+ The phase() is initialized to Qt::ScrollUpdate. Use the other constructor
to specify the phase explicitly.
\sa posF(), globalPosF(), angleDelta(), pixelDelta()
@@ -664,7 +664,7 @@ QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos,
QPoint pixelDelta, QPoint angleDelta, int qt4Delta, Qt::Orientation qt4Orientation,
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers)
: QInputEvent(Wheel, modifiers), p(pos), g(globalPos), pixelD(pixelDelta),
- angleD(angleDelta), qt4D(qt4Delta), qt4O(qt4Orientation), mouseState(buttons), ph(Changed)
+ angleD(angleDelta), qt4D(qt4Delta), qt4O(qt4Orientation), mouseState(buttons), ph(Qt::ScrollUpdate)
{}
/*!
@@ -685,14 +685,14 @@ QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos,
event data: \a qt4Delta specifies the rotation, and \a qt4Orientation the
direction.
- The phase of the event is specified by \a phase.
+ The scrolling phase of the event is specified by \a phase.
\sa posF(), globalPosF(), angleDelta(), pixelDelta(), phase()
*/
QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos,
QPoint pixelDelta, QPoint angleDelta, int qt4Delta, Qt::Orientation qt4Orientation,
- Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Phase phase)
+ Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::ScrollPhase phase)
: QInputEvent(Wheel, modifiers), p(pos), g(globalPos), pixelD(pixelDelta),
angleD(angleDelta), qt4D(qt4Delta), qt4O(qt4Orientation), mouseState(buttons), ph(phase)
{}
@@ -827,25 +827,10 @@ QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos,
*/
/*!
- \enum QWheelEvent::Phase
+ \fn Qt::ScrollPhase QWheelEvent::phase() const
\since 5.2
- This enum describes the phase of a wheel event.
-
- \value Started Scrolling has started, but the scrolling
- distance did not yet change.
-
- \value Changed The scrolling distance has changed (default).
-
- \value Ended Scrolling has ended, but the scrolling distance
- did not change anymore.
-*/
-
-/*!
- \fn QWheelEvent::Phase QWheelEvent::phase() const
- \since 5.2
-
- Returns the phase of this wheel event.
+ Returns the scrolling phase of this wheel event.
*/
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h
index 2de88cf010..0c1cf70420 100644
--- a/src/gui/kernel/qevent.h
+++ b/src/gui/kernel/qevent.h
@@ -167,8 +167,6 @@ protected:
class Q_GUI_EXPORT QWheelEvent : public QInputEvent
{
public:
- enum Phase { Started, Changed, Ended };
-
QWheelEvent(const QPointF &pos, int delta,
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers,
Qt::Orientation orient = Qt::Vertical);
@@ -180,7 +178,7 @@ public:
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
QWheelEvent(const QPointF &pos, const QPointF& globalPos,
QPoint pixelDelta, QPoint angleDelta, int qt4Delta, Qt::Orientation qt4Orientation,
- Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Phase phase);
+ Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::ScrollPhase phase);
~QWheelEvent();
@@ -204,7 +202,7 @@ public:
inline Qt::MouseButtons buttons() const { return mouseState; }
- inline Phase phase() const { return Phase(ph); }
+ inline Qt::ScrollPhase phase() const { return Qt::ScrollPhase(ph); }
protected:
QPointF p;
diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp
index b094ccb33b..7b57313645 100644
--- a/src/gui/kernel/qwindowsysteminterface.cpp
+++ b/src/gui/kernel/qwindowsysteminterface.cpp
@@ -298,13 +298,13 @@ void QWindowSystemInterface::handleWheelEvent(QWindow *tlw, ulong timestamp, con
handleWheelEvent(tlw, timestamp, local, global, QPoint(), point, mods);
}
-void QWindowSystemInterface::handleWheelEvent(QWindow *w, const QPointF & local, const QPointF & global, QPoint pixelDelta, QPoint angleDelta, Qt::KeyboardModifiers mods, QWheelEvent::Phase phase)
+void QWindowSystemInterface::handleWheelEvent(QWindow *w, const QPointF & local, const QPointF & global, QPoint pixelDelta, QPoint angleDelta, Qt::KeyboardModifiers mods, Qt::ScrollPhase phase)
{
unsigned long time = QWindowSystemInterfacePrivate::eventTime.elapsed();
handleWheelEvent(w, time, local, global, pixelDelta, angleDelta, mods, phase);
}
-void QWindowSystemInterface::handleWheelEvent(QWindow *tlw, ulong timestamp, const QPointF & local, const QPointF & global, QPoint pixelDelta, QPoint angleDelta, Qt::KeyboardModifiers mods, QWheelEvent::Phase phase)
+void QWindowSystemInterface::handleWheelEvent(QWindow *tlw, ulong timestamp, const QPointF & local, const QPointF & global, QPoint pixelDelta, QPoint angleDelta, Qt::KeyboardModifiers mods, Qt::ScrollPhase phase)
{
// Qt 4 sends two separate wheel events for horizontal and vertical
// deltas. For Qt 5 we want to send the deltas in one event, but at the
@@ -315,9 +315,9 @@ void QWindowSystemInterface::handleWheelEvent(QWindow *tlw, ulong timestamp, con
// Angle deltas must always be sent in addition to pixel deltas.
QWindowSystemInterfacePrivate::WheelEvent *e;
- // Pass QWheelEvent::Started and QWheelEvent::Ended through
+ // Pass Qt::ScrollBegin and Qt::ScrollEnd through
// even if the wheel delta is null.
- if (angleDelta.isNull() && phase == QWheelEvent::Changed)
+ if (angleDelta.isNull() && phase == Qt::ScrollUpdate)
return;
// Simple case: vertical deltas only:
diff --git a/src/gui/kernel/qwindowsysteminterface.h b/src/gui/kernel/qwindowsysteminterface.h
index f9efdbf8ce..cac943cda1 100644
--- a/src/gui/kernel/qwindowsysteminterface.h
+++ b/src/gui/kernel/qwindowsysteminterface.h
@@ -61,7 +61,6 @@
#include <QtGui/QTouchEvent>
#include <QtCore/QEventLoop>
#include <QtGui/QVector2D>
-#include <QtGui/QWheelEvent>
QT_BEGIN_NAMESPACE
@@ -104,8 +103,8 @@ public:
quint32 nativeModifiers,
const QString& text = QString(), bool autorep = false,
ushort count = 1);
- static void handleWheelEvent(QWindow *w, const QPointF & local, const QPointF & global, QPoint pixelDelta, QPoint angleDelta, Qt::KeyboardModifiers mods = Qt::NoModifier, QWheelEvent::Phase phase = QWheelEvent::Changed);
- static void handleWheelEvent(QWindow *w, ulong timestamp, const QPointF & local, const QPointF & global, QPoint pixelDelta, QPoint angleDelta, Qt::KeyboardModifiers mods = Qt::NoModifier, QWheelEvent::Phase phase = QWheelEvent::Changed);
+ static void handleWheelEvent(QWindow *w, const QPointF & local, const QPointF & global, QPoint pixelDelta, QPoint angleDelta, Qt::KeyboardModifiers mods = Qt::NoModifier, Qt::ScrollPhase phase = Qt::ScrollUpdate);
+ static void handleWheelEvent(QWindow *w, ulong timestamp, const QPointF & local, const QPointF & global, QPoint pixelDelta, QPoint angleDelta, Qt::KeyboardModifiers mods = Qt::NoModifier, Qt::ScrollPhase phase = Qt::ScrollUpdate);
// Wheel event compatibility functions. Will be removed: do not use.
static void handleWheelEvent(QWindow *w, const QPointF & local, const QPointF & global, int d, Qt::Orientation o, Qt::KeyboardModifiers mods = Qt::NoModifier);
diff --git a/src/gui/kernel/qwindowsysteminterface_p.h b/src/gui/kernel/qwindowsysteminterface_p.h
index 7dbc3ad8ed..46479701cc 100644
--- a/src/gui/kernel/qwindowsysteminterface_p.h
+++ b/src/gui/kernel/qwindowsysteminterface_p.h
@@ -218,7 +218,7 @@ public:
class WheelEvent : public InputEvent {
public:
WheelEvent(QWindow *w, ulong time, const QPointF & local, const QPointF & global, QPoint pixelD, QPoint angleD, int qt4D, Qt::Orientation qt4O,
- Qt::KeyboardModifiers mods, QWheelEvent::Phase phase = QWheelEvent::Changed)
+ Qt::KeyboardModifiers mods, Qt::ScrollPhase phase = Qt::ScrollUpdate)
: InputEvent(w, time, Wheel, mods), pixelDelta(pixelD), angleDelta(angleD), qt4Delta(qt4D), qt4Orientation(qt4O), localPos(local), globalPos(global), phase(phase) { }
QPoint pixelDelta;
QPoint angleDelta;
@@ -226,7 +226,7 @@ public:
Qt::Orientation qt4Orientation;
QPointF localPos;
QPointF globalPos;
- QWheelEvent::Phase phase;
+ Qt::ScrollPhase phase;
};
class KeyEvent : public InputEvent {