summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2021-11-10 15:04:58 +0100
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2021-11-15 09:30:25 +0100
commit6ff07ec23b562d78f7fa19b5c6ada72724dc81a1 (patch)
tree030cc3b13cc2ede42214a5cf9eb9957a187c7bec /tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp
parenteab40726be98616b7edac3a600e97b39fc6227cd (diff)
macOS: make the slider knob big enough for BigSur and Monterey
The slider is very touch friendly from macOS 11 on, and the knob is quite large. Give it some extra pixels, and adjust the test accordingly. Pick-to: 6.2 Task-number: QTBUG-98093 Change-Id: Iedf6db1081cdd4013ca29ce760aea1e0361b1123 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp')
-rw-r--r--tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp b/tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp
index e9802cd716..fd784f9ced 100644
--- a/tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp
+++ b/tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp
@@ -83,6 +83,10 @@ private:
#define SIZE(x, y, z) \
((size == QStyleHelper::SizeLarge) ? (x) : (size == QStyleHelper::SizeSmall) ? (y) : (z))
+static bool bigSurOrAbove() {
+ return QOperatingSystemVersion::current() >= QOperatingSystemVersion::MacOSBigSur;
+}
+
void tst_QMacStyle::sizeHints_data()
{
QTest::addColumn<QStyleHelper::WidgetSizePolicy>("size");
@@ -133,7 +137,7 @@ void tst_QMacStyle::sizeHints()
QCOMPARE(sh(&comboBox3).height(), SIZE(32, -1, -1));
QSlider slider1(Qt::Horizontal, &w);
- QCOMPARE(sh(&slider1).height(), SIZE(15, 12, 10));
+ QCOMPARE(sh(&slider1).height(), SIZE(bigSurOrAbove() ? 18 : 15, 12, 10));
slider1.setTickPosition(QSlider::TicksAbove);
QCOMPARE(sh(&slider1).height(), SIZE(24, 17, 16)); // Builder
@@ -142,7 +146,7 @@ void tst_QMacStyle::sizeHints()
QCOMPARE(sh(&slider1).height(), SIZE(24, 17, 16)); // Builder
slider1.setTickPosition(QSlider::TicksBothSides);
- QVERIFY(sh(&slider1).height() > SIZE(15, 12, 10)); // common sense
+ QVERIFY(sh(&slider1).height() > SIZE(bigSurOrAbove() ? 18 : 15, 12, 10)); // common sense
QPushButton ok1("OK", &w);
QPushButton cancel1("Cancel", &w);