aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/qmltooling/qmldbg_qtquick2/inspecttool.cpp2
-rw-r--r--src/plugins/qmltooling/qmldbg_qtquick2/inspecttool.h2
-rw-r--r--src/plugins/qmltooling/shared/abstracttool.h2
-rw-r--r--src/plugins/qmltooling/shared/abstractviewinspector.cpp4
-rw-r--r--src/plugins/qmltooling/shared/abstractviewinspector.h2
-rw-r--r--src/qmltest/quicktestevent.cpp4
-rw-r--r--src/qmltest/quicktestevent_p.h2
-rw-r--r--src/quick/items/qquickflickable.cpp2
-rw-r--r--src/quick/items/qquickflickable_p.h2
-rw-r--r--src/quick/items/qquickitem.cpp4
-rw-r--r--src/quick/items/qquickitem.h2
-rw-r--r--src/quick/items/qquickitem_p.h2
-rw-r--r--src/quick/items/qquickmousearea.cpp2
-rw-r--r--src/quick/items/qquickmousearea_p.h2
-rw-r--r--src/quick/items/qquickwindow.cpp4
-rw-r--r--src/quick/items/qquickwindow_p.h2
16 files changed, 39 insertions, 1 deletions
diff --git a/src/plugins/qmltooling/qmldbg_qtquick2/inspecttool.cpp b/src/plugins/qmltooling/qmldbg_qtquick2/inspecttool.cpp
index d05f4b9b59..93cbdf3018 100644
--- a/src/plugins/qmltooling/qmldbg_qtquick2/inspecttool.cpp
+++ b/src/plugins/qmltooling/qmldbg_qtquick2/inspecttool.cpp
@@ -166,6 +166,7 @@ void InspectTool::hoverMoveEvent(QMouseEvent *event)
}
}
+#ifndef QT_NO_WHEELEVENT
void InspectTool::wheelEvent(QWheelEvent *event)
{
if (event->orientation() != Qt::Vertical)
@@ -184,6 +185,7 @@ void InspectTool::wheelEvent(QWheelEvent *event)
}
}
}
+#endif
void InspectTool::keyReleaseEvent(QKeyEvent *event)
{
diff --git a/src/plugins/qmltooling/qmldbg_qtquick2/inspecttool.h b/src/plugins/qmltooling/qmldbg_qtquick2/inspecttool.h
index 5c480697af..5ed243d361 100644
--- a/src/plugins/qmltooling/qmldbg_qtquick2/inspecttool.h
+++ b/src/plugins/qmltooling/qmldbg_qtquick2/inspecttool.h
@@ -79,7 +79,9 @@ public:
void mouseDoubleClickEvent(QMouseEvent *);
void hoverMoveEvent(QMouseEvent *);
+#ifndef QT_NO_WHEELEVENT
void wheelEvent(QWheelEvent *);
+#endif
void keyPressEvent(QKeyEvent *) {}
void keyReleaseEvent(QKeyEvent *);
diff --git a/src/plugins/qmltooling/shared/abstracttool.h b/src/plugins/qmltooling/shared/abstracttool.h
index f29909baf0..6e7d0c09cb 100644
--- a/src/plugins/qmltooling/shared/abstracttool.h
+++ b/src/plugins/qmltooling/shared/abstracttool.h
@@ -74,7 +74,9 @@ public:
virtual void mouseDoubleClickEvent(QMouseEvent *event) = 0;
virtual void hoverMoveEvent(QMouseEvent *event) = 0;
+#ifndef QT_NO_WHEELEVENT
virtual void wheelEvent(QWheelEvent *event) = 0;
+#endif
virtual void keyPressEvent(QKeyEvent *event) = 0;
virtual void keyReleaseEvent(QKeyEvent *keyEvent) = 0;
diff --git a/src/plugins/qmltooling/shared/abstractviewinspector.cpp b/src/plugins/qmltooling/shared/abstractviewinspector.cpp
index ed207c5f26..c1d0cf1343 100644
--- a/src/plugins/qmltooling/shared/abstractviewinspector.cpp
+++ b/src/plugins/qmltooling/shared/abstractviewinspector.cpp
@@ -173,10 +173,12 @@ bool AbstractViewInspector::eventFilter(QObject *obj, QEvent *event)
if (mouseDoubleClickEvent(static_cast<QMouseEvent*>(event)))
return true;
break;
+#ifndef QT_NO_WHEELEVENT
case QEvent::Wheel:
if (wheelEvent(static_cast<QWheelEvent*>(event)))
return true;
break;
+#endif
case QEvent::TouchBegin:
case QEvent::TouchUpdate:
case QEvent::TouchEnd:
@@ -244,12 +246,14 @@ bool AbstractViewInspector::mouseDoubleClickEvent(QMouseEvent *event)
return true;
}
+#ifndef QT_NO_WHEELEVENT
bool AbstractViewInspector::wheelEvent(QWheelEvent *event)
{
foreach (AbstractTool *tool, m_tools)
tool->wheelEvent(event);
return true;
}
+#endif
bool AbstractViewInspector::touchEvent(QTouchEvent *event)
{
diff --git a/src/plugins/qmltooling/shared/abstractviewinspector.h b/src/plugins/qmltooling/shared/abstractviewinspector.h
index d98707eaca..e0524c880c 100644
--- a/src/plugins/qmltooling/shared/abstractviewinspector.h
+++ b/src/plugins/qmltooling/shared/abstractviewinspector.h
@@ -107,7 +107,9 @@ protected:
virtual bool keyPressEvent(QKeyEvent *event);
virtual bool keyReleaseEvent(QKeyEvent *keyEvent);
virtual bool mouseDoubleClickEvent(QMouseEvent *event);
+#ifndef QT_NO_WHEELEVENT
virtual bool wheelEvent(QWheelEvent *event);
+#endif
virtual bool touchEvent(QTouchEvent *event);
virtual void setShowAppOnTop(bool) = 0;
diff --git a/src/qmltest/quicktestevent.cpp b/src/qmltest/quicktestevent.cpp
index 2fccf3cd72..20ede936fa 100644
--- a/src/qmltest/quicktestevent.cpp
+++ b/src/qmltest/quicktestevent.cpp
@@ -146,6 +146,7 @@ namespace QtQuickTest
}
}
+#ifndef QT_NO_WHEELEVENT
static void mouseWheel(QWindow* window, QObject* item, Qt::MouseButtons buttons,
Qt::KeyboardModifiers stateKey,
QPointF _pos, int xDelta, int yDelta, int delay = -1)
@@ -172,6 +173,7 @@ namespace QtQuickTest
if (!qApp->notify(window, &we))
QTest::qWarn("Wheel event not accepted by receiving window");
}
+#endif
};
bool QuickTestEvent::mousePress
@@ -188,6 +190,7 @@ bool QuickTestEvent::mousePress
return true;
}
+#ifndef QT_NO_WHEELEVENT
bool QuickTestEvent::mouseWheel(
QObject *item, qreal x, qreal y, int buttons,
int modifiers, int xDelta, int yDelta, int delay)
@@ -200,6 +203,7 @@ bool QuickTestEvent::mouseWheel(
QPointF(x, y), xDelta, yDelta, delay);
return true;
}
+#endif
bool QuickTestEvent::mouseRelease
(QObject *item, qreal x, qreal y, int button,
diff --git a/src/qmltest/quicktestevent_p.h b/src/qmltest/quicktestevent_p.h
index 9dfa66a54d..f72d9265b5 100644
--- a/src/qmltest/quicktestevent_p.h
+++ b/src/qmltest/quicktestevent_p.h
@@ -69,8 +69,10 @@ public Q_SLOTS:
int modifiers, int delay);
bool mouseMove(QObject *item, qreal x, qreal y, int delay, int buttons);
+#ifndef QT_NO_WHEELEVENT
bool mouseWheel(QObject *item, qreal x, qreal y, int buttons,
int modifiers, int xDelta, int yDelta, int delay);
+#endif
private:
QWindow *eventWindow();
diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp
index 0a3dcd8039..6e5e6b74a0 100644
--- a/src/quick/items/qquickflickable.cpp
+++ b/src/quick/items/qquickflickable.cpp
@@ -1270,6 +1270,7 @@ void QQuickFlickable::mouseReleaseEvent(QMouseEvent *event)
}
}
+#ifndef QT_NO_WHEELEVENT
void QQuickFlickable::wheelEvent(QWheelEvent *event)
{
Q_D(QQuickFlickable);
@@ -1324,6 +1325,7 @@ void QQuickFlickable::wheelEvent(QWheelEvent *event)
if (!event->isAccepted())
QQuickItem::wheelEvent(event);
}
+#endif
bool QQuickFlickablePrivate::isInnermostPressDelay(QQuickItem *i) const
{
diff --git a/src/quick/items/qquickflickable_p.h b/src/quick/items/qquickflickable_p.h
index d5f97ad963..ed4b026be3 100644
--- a/src/quick/items/qquickflickable_p.h
+++ b/src/quick/items/qquickflickable_p.h
@@ -234,7 +234,9 @@ protected:
virtual void mousePressEvent(QMouseEvent *event);
virtual void mouseMoveEvent(QMouseEvent *event);
virtual void mouseReleaseEvent(QMouseEvent *event);
+#ifndef QT_NO_WHEELEVENT
virtual void wheelEvent(QWheelEvent *event);
+#endif
virtual void timerEvent(QTimerEvent *event);
QQuickFlickableVisibleArea *visibleArea();
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index b23ff68abd..afe91e0af4 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -3206,6 +3206,7 @@ void QQuickItem::touchUngrabEvent()
// XXX todo
}
+#ifndef QT_NO_WHEELEVENT
/*!
This event handler can be reimplemented in a subclass to receive
wheel events for an item. The event information is provided by the
@@ -3215,6 +3216,7 @@ void QQuickItem::wheelEvent(QWheelEvent *event)
{
event->ignore();
}
+#endif
/*!
This event handler can be reimplemented in a subclass to receive touch
@@ -4104,11 +4106,13 @@ void QQuickItemPrivate::deliverMouseEvent(QMouseEvent *e)
}
}
+#ifndef QT_NO_WHEELEVENT
void QQuickItemPrivate::deliverWheelEvent(QWheelEvent *e)
{
Q_Q(QQuickItem);
q->wheelEvent(e);
}
+#endif
void QQuickItemPrivate::deliverTouchEvent(QTouchEvent *e)
{
diff --git a/src/quick/items/qquickitem.h b/src/quick/items/qquickitem.h
index bba26be060..dc20310c48 100644
--- a/src/quick/items/qquickitem.h
+++ b/src/quick/items/qquickitem.h
@@ -398,7 +398,9 @@ protected:
virtual void mouseDoubleClickEvent(QMouseEvent *event);
virtual void mouseUngrabEvent(); // XXX todo - params?
virtual void touchUngrabEvent();
+#ifndef QT_NO_WHEELEVENT
virtual void wheelEvent(QWheelEvent *event);
+#endif
virtual void touchEvent(QTouchEvent *event);
virtual void hoverEnterEvent(QHoverEvent *event);
virtual void hoverMoveEvent(QHoverEvent *event);
diff --git a/src/quick/items/qquickitem_p.h b/src/quick/items/qquickitem_p.h
index 363cc93cc4..804b10deac 100644
--- a/src/quick/items/qquickitem_p.h
+++ b/src/quick/items/qquickitem_p.h
@@ -528,7 +528,9 @@ public:
#endif
void deliverFocusEvent(QFocusEvent *);
void deliverMouseEvent(QMouseEvent *);
+#ifndef QT_NO_WHEELEVENT
void deliverWheelEvent(QWheelEvent *);
+#endif
void deliverTouchEvent(QTouchEvent *);
void deliverHoverEvent(QHoverEvent *);
#ifndef QT_NO_DRAGANDDROP
diff --git a/src/quick/items/qquickmousearea.cpp b/src/quick/items/qquickmousearea.cpp
index fd01c80ba5..0edbd1b9a9 100644
--- a/src/quick/items/qquickmousearea.cpp
+++ b/src/quick/items/qquickmousearea.cpp
@@ -938,6 +938,7 @@ void QQuickMouseArea::hoverLeaveEvent(QHoverEvent *event)
setHovered(false);
}
+#ifndef QT_NO_WHEELEVENT
void QQuickMouseArea::wheelEvent(QWheelEvent *event)
{
Q_D(QQuickMouseArea);
@@ -953,6 +954,7 @@ void QQuickMouseArea::wheelEvent(QWheelEvent *event)
if (!we.isAccepted())
QQuickItem::wheelEvent(event);
}
+#endif
void QQuickMouseArea::ungrabMouse()
{
diff --git a/src/quick/items/qquickmousearea_p.h b/src/quick/items/qquickmousearea_p.h
index eb5bddf1db..c2138792ae 100644
--- a/src/quick/items/qquickmousearea_p.h
+++ b/src/quick/items/qquickmousearea_p.h
@@ -222,7 +222,9 @@ protected:
virtual void hoverEnterEvent(QHoverEvent *event);
virtual void hoverMoveEvent(QHoverEvent *event);
virtual void hoverLeaveEvent(QHoverEvent *event);
+#ifndef QT_NO_WHEELEVENT
virtual void wheelEvent(QWheelEvent *event);
+#endif
virtual bool childMouseEventFilter(QQuickItem *i, QEvent *e);
virtual void timerEvent(QTimerEvent *event);
virtual void windowDeactivateEvent();
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index a915430616..2cde3cc434 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -1421,6 +1421,7 @@ bool QQuickWindowPrivate::deliverHoverEvent(QQuickItem *item, const QPointF &sce
return false;
}
+#ifndef QT_NO_WHEELEVENT
bool QQuickWindowPrivate::deliverWheelEvent(QQuickItem *item, QWheelEvent *event)
{
Q_Q(QQuickWindow);
@@ -1457,7 +1458,6 @@ bool QQuickWindowPrivate::deliverWheelEvent(QQuickItem *item, QWheelEvent *event
return false;
}
-#ifndef QT_NO_WHEELEVENT
/*! \reimp */
void QQuickWindow::wheelEvent(QWheelEvent *event)
{
@@ -2058,9 +2058,11 @@ bool QQuickWindow::sendEvent(QQuickItem *item, QEvent *e)
item->mouseUngrabEvent();
}
break;
+#ifndef QT_NO_WHEELEVENT
case QEvent::Wheel:
QQuickItemPrivate::get(item)->deliverWheelEvent(static_cast<QWheelEvent *>(e));
break;
+#endif
case QEvent::HoverEnter:
case QEvent::HoverLeave:
case QEvent::HoverMove:
diff --git a/src/quick/items/qquickwindow_p.h b/src/quick/items/qquickwindow_p.h
index fdf5fe2abb..c8ecd43238 100644
--- a/src/quick/items/qquickwindow_p.h
+++ b/src/quick/items/qquickwindow_p.h
@@ -131,7 +131,9 @@ public:
bool deliverInitialMousePressEvent(QQuickItem *, QMouseEvent *);
bool deliverMouseEvent(QMouseEvent *);
bool sendFilteredMouseEvent(QQuickItem *, QQuickItem *, QEvent *);
+#ifndef QT_NO_WHEELEVENT
bool deliverWheelEvent(QQuickItem *, QWheelEvent *);
+#endif
bool deliverTouchPoints(QQuickItem *, QTouchEvent *, const QList<QTouchEvent::TouchPoint> &, QSet<int> *,
QHash<QQuickItem *, QList<QTouchEvent::TouchPoint> > *);
bool deliverTouchEvent(QTouchEvent *);