Convert features.wheelevent to QT_CONFIG

Change-Id: I46083a9115c199d1ebe024ed5f64b160a27462f1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
Stephan Binner 2017-05-30 22:22:22 +02:00
parent fdbf400b27
commit 5ede5706a8
63 changed files with 110 additions and 110 deletions

View File

@ -171,7 +171,7 @@ void MandelbrotWidget::keyPressEvent(QKeyEvent *event)
}
//! [11]
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
//! [12]
void MandelbrotWidget::wheelEvent(QWheelEvent *event)
{

View File

@ -68,7 +68,7 @@ protected:
void paintEvent(QPaintEvent *event) override;
void resizeEvent(QResizeEvent *event) override;
void keyPressEvent(QKeyEvent *event) override;
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *event) override;
#endif
void mousePressEvent(QMouseEvent *event) override;

View File

@ -64,7 +64,7 @@
#endif
#include <qmath.h>
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void GraphicsView::wheelEvent(QWheelEvent *e)
{
if (e->modifiers() & Qt::ControlModifier) {

View File

@ -69,7 +69,7 @@ public:
GraphicsView(View *v) : QGraphicsView(), view(v) { }
protected:
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *) override;
#endif

View File

@ -184,7 +184,7 @@ void GraphWidget::timerEvent(QTimerEvent *event)
}
//! [4]
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
//! [5]
void GraphWidget::wheelEvent(QWheelEvent *event)
{

View File

@ -73,7 +73,7 @@ public slots:
protected:
void keyPressEvent(QKeyEvent *event) override;
void timerEvent(QTimerEvent *event) override;
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *event) override;
#endif
void drawBackground(QPainter *painter, const QRectF &rect) override;

View File

@ -260,7 +260,7 @@ void XFormView::timerEvent(QTimerEvent *e)
}
}
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void XFormView::wheelEvent(QWheelEvent *e)
{
m_scale += e->delta() / qreal(600);

View File

@ -125,7 +125,7 @@ signals:
protected:
void timerEvent(QTimerEvent *e) override;
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *) override;
#endif

View File

@ -89,7 +89,7 @@ void ButtonTester::mouseDoubleClickEvent(QMouseEvent *e)
this->setText(result);
}
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void ButtonTester::wheelEvent (QWheelEvent *e)
{
QString result;

View File

@ -64,7 +64,7 @@ protected:
void mousePressEvent(QMouseEvent *event) override;
void mouseReleaseEvent(QMouseEvent *event) override;
void mouseDoubleClickEvent(QMouseEvent *event) override;
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent * event) override;
#endif
int buttonByNumber(const Qt::MouseButton button);

View File

@ -767,7 +767,7 @@ QHoverEvent::~QHoverEvent()
\sa pos(), pixelDelta(), angleDelta()
*/
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
QWheelEvent::QWheelEvent(const QPointF &pos, int delta,
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers,
Qt::Orientation orient)
@ -952,7 +952,7 @@ QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos,
invertedScrolling(inverted)
{}
#endif // QT_NO_WHEELEVENT
#endif // QT_CONFIG(wheelevent)
/*!
\fn QPoint QWheelEvent::pixelDelta() const
@ -3956,13 +3956,13 @@ QDebug operator<<(QDebug dbg, const QEvent *e)
dbg << ')';
}
break;
# ifndef QT_NO_WHEELEVENT
# if QT_CONFIG(wheelevent)
case QEvent::Wheel: {
const QWheelEvent *we = static_cast<const QWheelEvent *>(e);
dbg << "QWheelEvent(" << "pixelDelta=" << we->pixelDelta() << ", angleDelta=" << we->angleDelta() << ')';
}
break;
# endif // !QT_NO_WHEELEVENT
# endif // QT_CONFIG(wheelevent)
case QEvent::KeyPress:
case QEvent::KeyRelease:
case QEvent::ShortcutOverride:

View File

@ -169,7 +169,7 @@ protected:
QPointF p, op;
};
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
class Q_GUI_EXPORT QWheelEvent : public QInputEvent
{
public:

View File

@ -1997,7 +1997,7 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo
void QGuiApplicationPrivate::processWheelEvent(QWindowSystemInterfacePrivate::WheelEvent *e)
{
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
QWindow *window = e->window.data();
QPointF globalPoint = e->globalPos;
QPointF localPoint = e->localPos;
@ -2027,7 +2027,7 @@ void QGuiApplicationPrivate::processWheelEvent(QWindowSystemInterfacePrivate::Wh
QGuiApplication::sendSpontaneousEvent(window, &ev);
#else
Q_UNUSED(e);
#endif /* ifndef QT_NO_WHEELEVENT */
#endif // QT_CONFIG(wheelevent)
}
// Remember, Qt convention is: keyboard state is state *before*

View File

@ -2220,7 +2220,7 @@ bool QWindow::event(QEvent *ev)
#endif
break; }
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
case QEvent::Wheel:
wheelEvent(static_cast<QWheelEvent*>(ev));
break;
@ -2418,7 +2418,7 @@ void QWindow::mouseMoveEvent(QMouseEvent *ev)
ev->ignore();
}
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
/*!
Override this to handle mouse wheel or other wheel events (\a ev).
*/
@ -2426,7 +2426,7 @@ void QWindow::wheelEvent(QWheelEvent *ev)
{
ev->ignore();
}
#endif //QT_NO_WHEELEVENT
#endif // QT_CONFIG(wheelevent)
/*!
Override this to handle touch events (\a ev).

View File

@ -71,7 +71,7 @@ class QShowEvent;
class QHideEvent;
class QKeyEvent;
class QMouseEvent;
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
class QWheelEvent;
#endif
class QTouchEvent;
@ -344,7 +344,7 @@ protected:
virtual void mouseReleaseEvent(QMouseEvent *);
virtual void mouseDoubleClickEvent(QMouseEvent *);
virtual void mouseMoveEvent(QMouseEvent *);
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
virtual void wheelEvent(QWheelEvent *);
#endif
virtual void touchEvent(QTouchEvent *);

View File

@ -37,7 +37,7 @@
**
****************************************************************************/
#include <QtCore/qglobal.h>
#include <QtGui/qtguiglobal.h>
#include "qnsview.h"
#include "qcocoawindow.h"
@ -1388,7 +1388,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
}
#endif // QT_NO_GESTURES
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
- (void)scrollWheel:(NSEvent *)theEvent
{
if (!m_platformWindow)
@ -1469,7 +1469,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
QWindowSystemInterface::handleWheelEvent(m_platformWindow->window(), qt_timestamp, qt_windowPoint, qt_screenPoint, pixelDelta, angleDelta, currentWheelModifiers, ph, source, isInverted);
}
#endif //QT_NO_WHEELEVENT
#endif // QT_CONFIG(wheelevent)
- (int) convertKeyCode : (QChar)keyChar
{

View File

@ -1273,7 +1273,7 @@ void QGraphicsProxyWidget::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event
/*!
\reimp
*/
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void QGraphicsProxyWidget::wheelEvent(QGraphicsSceneWheelEvent *event)
{
Q_D(QGraphicsProxyWidget);

View File

@ -103,7 +103,7 @@ protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void wheelEvent(QGraphicsSceneWheelEvent *event) Q_DECL_OVERRIDE;
#endif

View File

@ -3409,7 +3409,7 @@ void QGraphicsView::mouseReleaseEvent(QMouseEvent *event)
#endif
}
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
/*!
\reimp
*/
@ -3437,7 +3437,7 @@ void QGraphicsView::wheelEvent(QWheelEvent *event)
if (!event->isAccepted())
QAbstractScrollArea::wheelEvent(event);
}
#endif // QT_NO_WHEELEVENT
#endif // QT_CONFIG(wheelevent)
/*!
\reimp

View File

@ -259,7 +259,7 @@ protected:
void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
#endif
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;

View File

@ -801,7 +801,7 @@ void QListView::mouseReleaseEvent(QMouseEvent *e)
}
}
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
/*!
\reimp
*/
@ -828,7 +828,7 @@ void QListView::wheelEvent(QWheelEvent *e)
QApplication::sendEvent(d->hbar, e);
}
}
#endif // QT_NO_WHEELEVENT
#endif // QT_CONFIG(wheelevent)
/*!
\reimp

View File

@ -153,7 +153,7 @@ protected:
void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *e) Q_DECL_OVERRIDE;
#endif

View File

@ -407,7 +407,7 @@ QWidget *QApplicationPrivate::main_widget = 0; // main application widget
QWidget *QApplicationPrivate::focus_widget = 0; // has keyboard input focus
QWidget *QApplicationPrivate::hidden_focus_widget = 0; // will get keyboard input focus after show()
QWidget *QApplicationPrivate::active_window = 0; // toplevel with keyboard focus
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
QPointer<QWidget> QApplicationPrivate::wheel_widget;
#endif
bool qt_in_tab_key_event = false;
@ -2984,7 +2984,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
case QEvent::KeyPress:
case QEvent::KeyRelease:
case QEvent::MouseMove:
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
case QEvent::Wheel:
#endif
case QEvent::TouchBegin:
@ -3227,7 +3227,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
d->hoverGlobalPos = mouse->globalPos();
}
break;
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
case QEvent::Wheel:
{
QWidget* w = static_cast<QWidget *>(receiver);
@ -4041,7 +4041,7 @@ int QApplication::keyboardInputInterval()
\sa QStyleHints::wheelScrollLines()
*/
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
int QApplication::wheelScrollLines()
{
return styleHints()->wheelScrollLines();

View File

@ -76,7 +76,7 @@ class Q_WIDGETS_EXPORT QApplication : public QGuiApplication
Q_PROPERTY(int cursorFlashTime READ cursorFlashTime WRITE setCursorFlashTime)
Q_PROPERTY(int doubleClickInterval READ doubleClickInterval WRITE setDoubleClickInterval)
Q_PROPERTY(int keyboardInputInterval READ keyboardInputInterval WRITE setKeyboardInputInterval)
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
Q_PROPERTY(int wheelScrollLines READ wheelScrollLines WRITE setWheelScrollLines)
#endif
Q_PROPERTY(QSize globalStrut READ globalStrut WRITE setGlobalStrut)
@ -154,7 +154,7 @@ public:
static void setKeyboardInputInterval(int);
static int keyboardInputInterval();
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
static void setWheelScrollLines(int);
static int wheelScrollLines();
#endif

View File

@ -195,7 +195,7 @@ public:
static QWidget *focus_widget;
static QWidget *hidden_focus_widget;
static QWidget *active_window;
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
static int wheel_scroll_lines;
static QPointer<QWidget> wheel_widget;
#endif

View File

@ -8777,7 +8777,7 @@ bool QWidget::event(QEvent *event)
case QEvent::ContextMenu:
case QEvent::KeyPress:
case QEvent::KeyRelease:
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
case QEvent::Wheel:
#endif
return false;
@ -8801,7 +8801,7 @@ bool QWidget::event(QEvent *event)
case QEvent::MouseButtonDblClick:
mouseDoubleClickEvent((QMouseEvent*)event);
break;
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
case QEvent::Wheel:
wheelEvent((QWheelEvent*)event);
break;
@ -9418,7 +9418,7 @@ void QWidget::mouseDoubleClickEvent(QMouseEvent *event)
mousePressEvent(event);
}
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
/*!
This event handler, for event \a event, can be reimplemented in a
subclass to receive wheel events for the widget.
@ -9437,7 +9437,7 @@ void QWidget::wheelEvent(QWheelEvent *event)
{
event->ignore();
}
#endif // QT_NO_WHEELEVENT
#endif // QT_CONFIG(wheelevent)
#ifndef QT_NO_TABLETEVENT
/*!

View File

@ -613,7 +613,7 @@ protected:
virtual void mouseReleaseEvent(QMouseEvent *event);
virtual void mouseDoubleClickEvent(QMouseEvent *event);
virtual void mouseMoveEvent(QMouseEvent *event);
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
virtual void wheelEvent(QWheelEvent *event);
#endif
virtual void keyPressEvent(QKeyEvent *event);

View File

@ -265,7 +265,7 @@ bool QWidgetWindow::event(QEvent *event)
handleResizeEvent(static_cast<QResizeEvent *>(event));
return true;
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
case QEvent::Wheel:
handleWheelEvent(static_cast<QWheelEvent *>(event));
return true;
@ -778,7 +778,7 @@ void QWidgetWindow::handleCloseEvent(QCloseEvent *event)
event->setAccepted(is_closing);
}
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void QWidgetWindow::handleWheelEvent(QWheelEvent *event)
{
@ -808,7 +808,7 @@ void QWidgetWindow::handleWheelEvent(QWheelEvent *event)
QGuiApplication::sendSpontaneousEvent(widget, &translated);
}
#endif // QT_NO_WHEELEVENT
#endif // QT_CONFIG(wheelevent)
#ifndef QT_NO_DRAGANDDROP

View File

@ -89,7 +89,7 @@ protected:
void handleTouchEvent(QTouchEvent *);
void handleMoveEvent(QMoveEvent *);
void handleResizeEvent(QResizeEvent *);
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void handleWheelEvent(QWheelEvent *);
#endif
#ifndef QT_NO_DRAGANDDROP

View File

@ -100,10 +100,10 @@ static QEvent *cloneEvent(QEvent *e)
return new QEvent(*e);
case QEvent::HideToParent:
return new QEvent(*e);
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
case QEvent::Wheel:
return new QWheelEvent(*static_cast<QWheelEvent*>(e));
#endif //QT_NO_WHEELEVENT
#endif // QT_CONFIG(wheelevent)
case QEvent::WindowTitleChange:
return new QEvent(*e);
case QEvent::WindowIconChange:

View File

@ -210,7 +210,7 @@ bool QSystemTrayIconSys::event(QEvent *e)
case QEvent::ToolTip:
QApplication::sendEvent(q, e);
break;
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
case QEvent::Wheel:
return QApplication::sendEvent(q, e);
#endif

View File

@ -935,7 +935,7 @@ bool QAbstractButton::event(QEvent *e)
case QEvent::HoverEnter:
case QEvent::HoverLeave:
case QEvent::ContextMenu:
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
case QEvent::Wheel:
#endif
return true;

View File

@ -1188,7 +1188,7 @@ bool QAbstractScrollArea::viewportEvent(QEvent *e)
case QEvent::TouchEnd:
case QEvent::MouseMove:
case QEvent::ContextMenu:
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
case QEvent::Wheel:
#endif
#ifndef QT_NO_DRAGANDDROP
@ -1305,7 +1305,7 @@ void QAbstractScrollArea::mouseMoveEvent(QMouseEvent *e)
\sa QWidget::wheelEvent()
*/
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void QAbstractScrollArea::wheelEvent(QWheelEvent *e)
{
Q_D(QAbstractScrollArea);

View File

@ -116,7 +116,7 @@ protected:
void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE;
void mouseDoubleClickEvent(QMouseEvent *) Q_DECL_OVERRIDE;
void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE;
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *) Q_DECL_OVERRIDE;
#endif
#ifndef QT_NO_CONTEXTMENU

View File

@ -710,7 +710,7 @@ bool QAbstractSliderPrivate::scrollByDelta(Qt::Orientation orientation, Qt::Keyb
// offset), we might end up with a fraction (e.g. scroll 1.3 lines). We can
// only scroll whole lines, so we keep the reminder until next event.
qreal stepsToScrollF =
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
QApplication::wheelScrollLines() *
#endif
offset * effectiveSingleStep();
@ -759,7 +759,7 @@ bool QAbstractSliderPrivate::scrollByDelta(Qt::Orientation orientation, Qt::Keyb
/*!
\reimp
*/
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void QAbstractSlider::wheelEvent(QWheelEvent * e)
{
Q_D(QAbstractSlider);

View File

@ -146,7 +146,7 @@ protected:
void keyPressEvent(QKeyEvent *ev) Q_DECL_OVERRIDE;
void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE;
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *e) Q_DECL_OVERRIDE;
#endif
void changeEvent(QEvent *e) Q_DECL_OVERRIDE;

View File

@ -1119,7 +1119,7 @@ void QAbstractSpinBox::keyReleaseEvent(QKeyEvent *event)
\reimp
*/
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void QAbstractSpinBox::wheelEvent(QWheelEvent *event)
{
Q_D(QAbstractSpinBox);

View File

@ -137,7 +137,7 @@ protected:
void resizeEvent(QResizeEvent *event) override;
void keyPressEvent(QKeyEvent *event) override;
void keyReleaseEvent(QKeyEvent *event) override;
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *event) override;
#endif
void focusInEvent(QFocusEvent *event) override;

View File

@ -957,7 +957,7 @@ protected:
void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
#endif
void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
@ -1412,7 +1412,7 @@ void QCalendarView::keyPressEvent(QKeyEvent *event)
QTableView::keyPressEvent(event);
}
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void QCalendarView::wheelEvent(QWheelEvent *event)
{
const int numDegrees = event->delta() / 8;

View File

@ -3285,7 +3285,7 @@ void QComboBox::keyReleaseEvent(QKeyEvent *e)
/*!
\reimp
*/
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void QComboBox::wheelEvent(QWheelEvent *e)
{
#ifdef Q_OS_DARWIN

View File

@ -234,7 +234,7 @@ protected:
void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE;
void keyReleaseEvent(QKeyEvent *e) Q_DECL_OVERRIDE;
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *e) Q_DECL_OVERRIDE;
#endif
#ifndef QT_NO_CONTEXTMENU

View File

@ -1194,7 +1194,7 @@ void QDateTimeEdit::keyPressEvent(QKeyEvent *event)
\reimp
*/
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void QDateTimeEdit::wheelEvent(QWheelEvent *event)
{
QAbstractSpinBox::wheelEvent(event);

View File

@ -177,7 +177,7 @@ public Q_SLOTS:
protected:
void keyPressEvent(QKeyEvent *event) override;
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *event) override;
#endif
void focusInEvent(QFocusEvent *event) override;

View File

@ -2797,7 +2797,7 @@ void QMenu::paintEvent(QPaintEvent *e)
style()->drawControl(QStyle::CE_MenuEmptyArea, &menuOpt, &p, this);
}
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
/*!
\reimp
*/

View File

@ -237,7 +237,7 @@ protected:
void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE;
void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE;
void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE;
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *) Q_DECL_OVERRIDE;
#endif
void enterEvent(QEvent *) Q_DECL_OVERRIDE;

View File

@ -2296,7 +2296,7 @@ void QPlainTextEdit::changeEvent(QEvent *e)
/*! \reimp
*/
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void QPlainTextEdit::wheelEvent(QWheelEvent *e)
{
Q_D(QPlainTextEdit);

View File

@ -250,7 +250,7 @@ protected:
virtual void focusOutEvent(QFocusEvent *e) Q_DECL_OVERRIDE;
virtual void showEvent(QShowEvent *) Q_DECL_OVERRIDE;
virtual void changeEvent(QEvent *e) Q_DECL_OVERRIDE;
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
virtual void wheelEvent(QWheelEvent *e) Q_DECL_OVERRIDE;
#endif

View File

@ -493,7 +493,7 @@ bool QScrollBar::event(QEvent *event)
/*!
\reimp
*/
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void QScrollBar::wheelEvent(QWheelEvent *event)
{
event->ignore();

View File

@ -64,7 +64,7 @@ public:
bool event(QEvent *event) Q_DECL_OVERRIDE;
protected:
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *) Q_DECL_OVERRIDE;
#endif
void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;

View File

@ -2181,7 +2181,7 @@ void QTabBar::keyPressEvent(QKeyEvent *event)
/*!\reimp
*/
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void QTabBar::wheelEvent(QWheelEvent *event)
{
#ifndef Q_OS_MAC
@ -2193,7 +2193,7 @@ void QTabBar::wheelEvent(QWheelEvent *event)
Q_UNUSED(event)
#endif
}
#endif //QT_NO_WHEELEVENT
#endif // QT_CONFIG(wheelevent)
void QTabBarPrivate::setCurrentNextEnabledIndex(int offset)
{

View File

@ -203,7 +203,7 @@ protected:
void mousePressEvent (QMouseEvent *) Q_DECL_OVERRIDE;
void mouseMoveEvent (QMouseEvent *) Q_DECL_OVERRIDE;
void mouseReleaseEvent (QMouseEvent *) Q_DECL_OVERRIDE;
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
#endif
void keyPressEvent(QKeyEvent *) Q_DECL_OVERRIDE;

View File

@ -1831,7 +1831,7 @@ void QTextEdit::changeEvent(QEvent *e)
/*! \reimp
*/
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void QTextEdit::wheelEvent(QWheelEvent *e)
{
Q_D(QTextEdit);

View File

@ -288,7 +288,7 @@ protected:
virtual void focusOutEvent(QFocusEvent *e) Q_DECL_OVERRIDE;
virtual void showEvent(QShowEvent *) Q_DECL_OVERRIDE;
virtual void changeEvent(QEvent *e) Q_DECL_OVERRIDE;
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
virtual void wheelEvent(QWheelEvent *e) Q_DECL_OVERRIDE;
#endif

View File

@ -112,7 +112,7 @@ private slots:
void resizeEvent_data();
void resizeEvent();
void paintEvent();
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void wheelEvent();
#endif
void sizeHint_data();
@ -254,7 +254,7 @@ public:
int focusOut;
};
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
class WheelWidget : public QWidget
{
public:
@ -264,7 +264,7 @@ public:
bool wheelEventCalled;
};
#endif // !QT_NO_WHEELEVENT
#endif // QT_CONFIG(wheelevent)
// This will be called before the first test function is executed.
// It is only called once.
@ -1297,7 +1297,7 @@ void tst_QGraphicsProxyWidget::paintEvent()
}
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void tst_QGraphicsProxyWidget::wheelEvent()
{
QGraphicsScene scene;
@ -1321,7 +1321,7 @@ void tst_QGraphicsProxyWidget::wheelEvent()
QVERIFY(event.isAccepted());
QVERIFY(wheelWidget->wheelEventCalled);
}
#endif // !QT_NO_WHEELEVENT
#endif // QT_CONFIG(wheelevent)
Q_DECLARE_METATYPE(Qt::SizeHint)
void tst_QGraphicsProxyWidget::sizeHint_data()

View File

@ -199,7 +199,7 @@ private slots:
void mapFromScenePoly();
void mapFromScenePath();
void sendEvent();
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void wheelEvent();
#endif
#ifndef QT_NO_CURSOR
@ -2188,7 +2188,7 @@ void tst_QGraphicsView::sendEvent()
QCOMPARE(item->events.last(), QEvent::KeyPress);
}
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
class MouseWheelScene : public QGraphicsScene
{
public:
@ -2245,7 +2245,7 @@ void tst_QGraphicsView::wheelEvent()
QCOMPARE(spy.count(), 2);
QVERIFY(widget->hasFocus());
}
#endif // !QT_NO_WHEELEVENT
#endif // QT_CONFIG(wheelevent)
#ifndef QT_NO_CURSOR
void tst_QGraphicsView::cursor()

View File

@ -180,7 +180,7 @@ private slots:
void task191545_dragSelectRows();
void taskQTBUG_5062_spansInconsistency();
void taskQTBUG_4516_clickOnRichTextLabel();
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void taskQTBUG_5237_wheelEventOnHeader();
#endif
void taskQTBUG_8585_crashForNoGoodReason();
@ -190,7 +190,7 @@ private slots:
void taskQTBUG_30653_doItemsLayout();
void taskQTBUG_50171_selectRowAfterSwapColumns();
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void mouseWheel_data();
void mouseWheel();
#endif
@ -3966,7 +3966,7 @@ void tst_QTableView::task248688_autoScrollNavigation()
}
}
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void tst_QTableView::mouseWheel_data()
{
QTest::addColumn<int>("scrollMode");
@ -4019,7 +4019,7 @@ void tst_QTableView::mouseWheel()
QApplication::sendEvent(view.viewport(), &verticalEvent);
QVERIFY(qAbs(view.verticalScrollBar()->value() - verticalPosition) < 15);
}
#endif // !QT_NO_WHEELEVENT
#endif // QT_CONFIG(wheelevent)
void tst_QTableView::addColumnWhileEditing()
{
@ -4283,7 +4283,7 @@ void tst_QTableView::changeHeaderData()
QVERIFY(view.verticalHeader()->width() > textWidth);
}
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void tst_QTableView::taskQTBUG_5237_wheelEventOnHeader()
{
QTableView view;

View File

@ -140,7 +140,7 @@ private slots:
void execAfterExit();
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void wheelScrollLines();
#endif
@ -1773,7 +1773,7 @@ void tst_QApplication::execAfterExit()
QCOMPARE(exitCode, 0);
}
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void tst_QApplication::wheelScrollLines()
{
int argc = 1;
@ -1781,7 +1781,7 @@ void tst_QApplication::wheelScrollLines()
// If wheelScrollLines returns 0, the mose wheel will be disabled.
QVERIFY(app.wheelScrollLines() > 0);
}
#endif // !QT_NO_WHEELEVENT
#endif // QT_CONFIG(wheelevent)
void tst_QApplication::style()
{

View File

@ -74,7 +74,7 @@ private slots:
void minimum_maximum();
void keyPressed_data();
void keyPressed();
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void wheelEvent_data();
void wheelEvent();
void fineGrainedWheelEvent_data();
@ -690,7 +690,7 @@ void tst_QAbstractSlider::keyPressed()
QCOMPARE(slider->sliderPosition(), expectedSliderPositionVerticalInverted);
}
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void tst_QAbstractSlider::wheelEvent_data()
{
QTest::addColumn<int>("initialSliderPosition");
@ -941,7 +941,7 @@ void tst_QAbstractSlider::fineGrainedWheelEvent()
QCOMPARE(slider->sliderPosition(), 1);
}
#endif // !QT_NO_WHEELEVENT
#endif // QT_CONFIG(wheelevent)
void tst_QAbstractSlider::sliderPressedReleased_data()
{

View File

@ -120,11 +120,11 @@ private slots:
void flaggedItems_data();
void flaggedItems();
void pixmapIcon();
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void mouseWheel_data();
void mouseWheel();
void popupWheelHandling();
#endif // !QT_NO_WHEELEVENT
#endif // QT_CONFIG(wheelevent)
void layoutDirection();
void itemListPosition();
void separatorItem_data();
@ -2036,7 +2036,7 @@ void tst_QComboBox::pixmapIcon()
QCOMPARE( box.itemIcon(1).isNull(), false );
}
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
// defined to be 120 by the wheel mouse vendors according to the docs
#define WHEEL_DELTA 120
@ -2133,7 +2133,7 @@ void tst_QComboBox::popupWheelHandling()
QVERIFY(comboBox->view()->isVisible());
QCOMPARE(comboBox->view()->pos(), popupPos);
}
#endif // !QT_NO_WHEELEVENT
#endif // QT_CONFIG(wheelevent)
void tst_QComboBox::layoutDirection()
{

View File

@ -205,7 +205,7 @@ private slots:
void reverseTest();
void ddMMMMyyyy();
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void wheelEvent();
#endif
@ -2998,7 +2998,7 @@ void tst_QDateTimeEdit::ddMMMMyyyy()
QCOMPARE(testWidget->lineEdit()->text(), "01." + QDate::longMonthName(1) + ".200");
}
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void tst_QDateTimeEdit::wheelEvent()
{
testWidget->setDisplayFormat("dddd/MM");
@ -3011,7 +3011,7 @@ void tst_QDateTimeEdit::wheelEvent()
qApp->sendEvent(testWidget, &w);
QCOMPARE(testWidget->date(), QDate(2000, 3, 22));
}
#endif // !QT_NO_WHEELEVENT
#endif // QT_CONFIG(wheelevent)
void tst_QDateTimeEdit::specialValueCornerCase()
{

View File

@ -50,7 +50,7 @@ class tst_QScrollBar : public QObject
private slots:
void scrollSingleStep();
void task_209492();
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void QTBUG_27308();
#endif
void QTBUG_42871();
@ -143,7 +143,7 @@ void tst_QScrollBar::task_209492()
QCOMPARE(spy.count(), 1);
}
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
#define WHEEL_DELTA 120 // copied from tst_QAbstractSlider / tst_QComboBox
void tst_QScrollBar::QTBUG_27308()
{

View File

@ -69,7 +69,7 @@ public:
{
return QSpinBox::valueFromText(text);
}
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *event)
{
QSpinBox::wheelEvent(event);
@ -1218,7 +1218,7 @@ void tst_QSpinBox::setGroupSeparatorShown()
void tst_QSpinBox::wheelEvents()
{
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
SpinBox spinBox;
spinBox.setRange(-20, 20);
spinBox.setValue(0);

View File

@ -199,7 +199,7 @@ private slots:
void findWithRegExpReturnsFalseIfNoMoreResults();
#endif
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
void wheelEvent();
#endif
@ -2566,7 +2566,7 @@ void tst_QTextEdit::findWithRegExpReturnsFalseIfNoMoreResults()
}
#endif
#ifndef QT_NO_WHEELEVENT
#if QT_CONFIG(wheelevent)
class TextEdit : public QTextEdit
{