diff options
author | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2014-11-24 13:37:06 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2014-11-24 13:39:13 +0100 |
commit | 34aba4724f196e34ed02cf50073f41968f119bb6 (patch) | |
tree | 0ebdfcabda989ab76ee6de53c6461553c7a767a5 /tests/auto/other/qaccessibility/tst_qaccessibility.cpp | |
parent | b86b2a742afae118bf974c82ba966ddb0cae4afb (diff) | |
parent | b1cf07f495e10c93e53651ac03e46ebdaea0a97e (diff) |
Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
src/corelib/io/qiodevice.cpp
src/plugins/bearer/linux_common/qofonoservice_linux.cpp
src/plugins/bearer/linux_common/qofonoservice_linux_p.h
src/plugins/platforms/android/qandroidplatformtheme.cpp
src/tools/bootstrap/bootstrap.pro
src/widgets/styles/qmacstyle_mac.mm
Change-Id: Ia02aab6c4598ce74e9c30bb4666d5e2ef000f99b
Diffstat (limited to 'tests/auto/other/qaccessibility/tst_qaccessibility.cpp')
-rw-r--r-- | tests/auto/other/qaccessibility/tst_qaccessibility.cpp | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp index 1c8121f142..af0a0b446e 100644 --- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp @@ -2648,57 +2648,67 @@ void tst_QAccessibility::abstractScrollAreaTest() // Horizontal scrollBar. abstractScrollArea.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn); - QCOMPARE(interface->childCount(), 2); QWidget *horizontalScrollBar = abstractScrollArea.horizontalScrollBar(); + + // On OS X >= 10.9 the scrollbar will be hidden unless explicitly enabled in the preferences + bool scrollBarsVisible = !horizontalScrollBar->style()->styleHint(QStyle::SH_ScrollBar_Transient, 0, horizontalScrollBar); + int childCount = scrollBarsVisible ? 2 : 1; + QCOMPARE(interface->childCount(), childCount); QWidget *horizontalScrollBarContainer = horizontalScrollBar->parentWidget(); - QVERIFY(verifyChild(horizontalScrollBarContainer, interface, 1, globalGeometry)); + if (scrollBarsVisible) + QVERIFY(verifyChild(horizontalScrollBarContainer, interface, 1, globalGeometry)); // Horizontal scrollBar widgets. QLabel *secondLeftLabel = new QLabel(QLatin1String("L2")); abstractScrollArea.addScrollBarWidget(secondLeftLabel, Qt::AlignLeft); - QCOMPARE(interface->childCount(), 2); + QCOMPARE(interface->childCount(), childCount); QLabel *firstLeftLabel = new QLabel(QLatin1String("L1")); abstractScrollArea.addScrollBarWidget(firstLeftLabel, Qt::AlignLeft); - QCOMPARE(interface->childCount(), 2); + QCOMPARE(interface->childCount(), childCount); QLabel *secondRightLabel = new QLabel(QLatin1String("R2")); abstractScrollArea.addScrollBarWidget(secondRightLabel, Qt::AlignRight); - QCOMPARE(interface->childCount(), 2); + QCOMPARE(interface->childCount(), childCount); QLabel *firstRightLabel = new QLabel(QLatin1String("R1")); abstractScrollArea.addScrollBarWidget(firstRightLabel, Qt::AlignRight); - QCOMPARE(interface->childCount(), 2); + QCOMPARE(interface->childCount(), childCount); // Vertical scrollBar. abstractScrollArea.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); - QCOMPARE(interface->childCount(), 3); + if (scrollBarsVisible) + ++childCount; + QCOMPARE(interface->childCount(), childCount); QWidget *verticalScrollBar = abstractScrollArea.verticalScrollBar(); QWidget *verticalScrollBarContainer = verticalScrollBar->parentWidget(); - QVERIFY(verifyChild(verticalScrollBarContainer, interface, 2, globalGeometry)); + if (scrollBarsVisible) + QVERIFY(verifyChild(verticalScrollBarContainer, interface, 2, globalGeometry)); // Vertical scrollBar widgets. QLabel *secondTopLabel = new QLabel(QLatin1String("T2")); abstractScrollArea.addScrollBarWidget(secondTopLabel, Qt::AlignTop); - QCOMPARE(interface->childCount(), 3); + QCOMPARE(interface->childCount(), childCount); QLabel *firstTopLabel = new QLabel(QLatin1String("T1")); abstractScrollArea.addScrollBarWidget(firstTopLabel, Qt::AlignTop); - QCOMPARE(interface->childCount(), 3); + QCOMPARE(interface->childCount(), childCount); QLabel *secondBottomLabel = new QLabel(QLatin1String("B2")); abstractScrollArea.addScrollBarWidget(secondBottomLabel, Qt::AlignBottom); - QCOMPARE(interface->childCount(), 3); + QCOMPARE(interface->childCount(), childCount); QLabel *firstBottomLabel = new QLabel(QLatin1String("B1")); abstractScrollArea.addScrollBarWidget(firstBottomLabel, Qt::AlignBottom); - QCOMPARE(interface->childCount(), 3); + QCOMPARE(interface->childCount(), childCount); // CornerWidget. + ++childCount; abstractScrollArea.setCornerWidget(new QLabel(QLatin1String("C"))); - QCOMPARE(interface->childCount(), 4); + QCOMPARE(interface->childCount(), childCount); QWidget *cornerWidget = abstractScrollArea.cornerWidget(); - QVERIFY(verifyChild(cornerWidget, interface, 3, globalGeometry)); + if (scrollBarsVisible) + QVERIFY(verifyChild(cornerWidget, interface, 3, globalGeometry)); QCOMPARE(verifyHierarchy(interface), 0); |