From f07ccf82bfe53408a4e3810212191e9663969b87 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sun, 27 Feb 2022 14:17:58 +0200 Subject: [PATCH] build fix for the case when QT_NO_WHEELEVENT is defined Signed-off-by: Ivailo Monev --- src/gui/kernel/qapplication.cpp | 2 -- src/tools/qtconfig/mainwindow.cpp | 5 +++++ tests/auto/qabstractslider/tst_qabstractslider.cpp | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index f313243d4..ddc4f7133 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -337,8 +337,6 @@ int QApplicationPrivate::mouse_double_click_time = 400; // mouse dbl clic int QApplicationPrivate::keyboard_input_time = 400; // keyboard input interval #ifndef QT_NO_WHEELEVENT int QApplicationPrivate::wheel_scroll_lines = 3; // number of lines to scroll -#else -int QApplicationPrivate::wheel_scroll_lines = 0; #endif bool qt_in_tab_key_event = false; static int drag_time = 500; diff --git a/src/tools/qtconfig/mainwindow.cpp b/src/tools/qtconfig/mainwindow.cpp index d932b20d0..9ac925ccb 100644 --- a/src/tools/qtconfig/mainwindow.cpp +++ b/src/tools/qtconfig/mainwindow.cpp @@ -201,7 +201,12 @@ MainWindow::MainWindow() ui->doubleClickIntervalSpinBox->setValue(QApplication::doubleClickInterval()); ui->cursorFlashTimeSpinBox->setValue(QApplication::cursorFlashTime()); +#ifndef QT_NO_WHEELEVENT ui->wheelScrollLinesSpinBox->setValue(QApplication::wheelScrollLines()); +#else // QT_NO_WHEELEVENT + ui->wheelScrollLinesLabel->hide(); + ui->wheelScrollLinesSpinBox->hide(); +#endif // QT_NO_WHEELEVENT // ############# // resolveLinksCheckBox->setChecked(qt_resolve_symlinks); diff --git a/tests/auto/qabstractslider/tst_qabstractslider.cpp b/tests/auto/qabstractslider/tst_qabstractslider.cpp index 64375ac66..1abc599f3 100644 --- a/tests/auto/qabstractslider/tst_qabstractslider.cpp +++ b/tests/auto/qabstractslider/tst_qabstractslider.cpp @@ -802,6 +802,7 @@ void tst_QAbstractSlider::wheelEvent_data() void tst_QAbstractSlider::wheelEvent() { +#ifndef QT_NO_WHEELEVENT QFETCH(int,initialSliderPosition); QFETCH(int,minimum); QFETCH(int,maximum); @@ -848,6 +849,9 @@ void tst_QAbstractSlider::wheelEvent() QCOMPARE(spy2.count(), expectedSignalCount); if (expectedSignalCount) QVERIFY(actionTriggeredTimeStamp < valueChangedTimeStamp); +#else // QT_NO_WHEELEVENT + QSKIP("Katie compiled without wheel event support (QT_NO_WHEELEVENT)", SkipAll); +#endif // QT_NO_WHEELEVENT } void tst_QAbstractSlider::sliderPressedReleased_data() -- 2.11.0