OSDN Git Service

build fix for the case when QT_NO_WHEELEVENT is defined
authorIvailo Monev <xakepa10@gmail.com>
Sun, 27 Feb 2022 12:17:58 +0000 (14:17 +0200)
committerIvailo Monev <xakepa10@gmail.com>
Sun, 27 Feb 2022 12:17:58 +0000 (14:17 +0200)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/gui/kernel/qapplication.cpp
src/tools/qtconfig/mainwindow.cpp
tests/auto/qabstractslider/tst_qabstractslider.cpp

index f313243..ddc4f71 100644 (file)
@@ -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;
index d932b20..9ac925c 100644 (file)
@@ -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);
 
index 64375ac..1abc599 100644 (file)
@@ -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()