From 92e4ec7a146660362f365d8a54e0f017c8f48bd9 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 16 Oct 2012 16:53:09 +0200 Subject: [PATCH] Bring back Mac dependent code in QBoxLayout, QGridLayout MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We also made an accessibility auto-test more stable, so that it would not be influenced by this patch. Task-number: QTCREATORBUG-7966 Change-Id: I6ce4e2361c8847aee5dd1cf5664c29cd2d83e38d Reviewed-by: Jan Arve Sæther --- src/widgets/kernel/qboxlayout.cpp | 4 ++-- src/widgets/kernel/qgridlayout.cpp | 2 +- tests/auto/other/qaccessibility/tst_qaccessibility.cpp | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/widgets/kernel/qboxlayout.cpp b/src/widgets/kernel/qboxlayout.cpp index d05efaa..d16c999 100644 --- a/src/widgets/kernel/qboxlayout.cpp +++ b/src/widgets/kernel/qboxlayout.cpp @@ -162,7 +162,7 @@ void QBoxLayoutPrivate::effectiveMargins(int *left, int *top, int *right, int *b int t = topMargin; int r = rightMargin; int b = bottomMargin; -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC Q_Q(const QBoxLayout); if (horz(dir)) { QBoxLayoutItem *leftBox = 0; @@ -311,7 +311,7 @@ void QBoxLayoutPrivate::setupGeom() if (!empty) { if (fixedSpacing >= 0) { spacing = (previousNonEmptyIndex >= 0) ? fixedSpacing : 0; -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC if (!horz(dir) && previousNonEmptyIndex >= 0) { QBoxLayoutItem *sibling = (dir == QBoxLayout::TopToBottom ? box : list.at(previousNonEmptyIndex)); if (sibling) { diff --git a/src/widgets/kernel/qgridlayout.cpp b/src/widgets/kernel/qgridlayout.cpp index 5dd840e..b5cd746 100644 --- a/src/widgets/kernel/qgridlayout.cpp +++ b/src/widgets/kernel/qgridlayout.cpp @@ -231,7 +231,7 @@ void QGridLayoutPrivate::effectiveMargins(int *left, int *top, int *right, int * int t = topMargin; int r = rightMargin; int b = bottomMargin; -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC int leftMost = INT_MAX; int topMost = INT_MAX; int rightMost = 0; diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp index 08d6797..9d61470 100644 --- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp @@ -1680,6 +1680,7 @@ void tst_QAccessibility::mdiSubWindowTest() const int subWindowCount = 5; for (int i = 0; i < subWindowCount; ++i) { QMdiSubWindow *window = mdiArea.addSubWindow(new QPushButton("QAccessibilityTest")); + window->setAttribute(Qt::WA_LayoutUsesWidgetRect); window->show(); // Parts of this test requires that the sub windows are placed next // to each other. In order to achieve that QMdiArea must have @@ -1759,7 +1760,7 @@ void tst_QAccessibility::mdiSubWindowTest() const QPoint globalWidgetPos = QPoint(globalPos.x() + widgetGeometry.x(), globalPos.y() + widgetGeometry.y()); #ifdef Q_OS_MAC - QEXPECT_FAIL("", "QTBUG-22812", Abort); + QSKIP("QTBUG-22812"); #endif QCOMPARE(childRect(interface), QRect(globalWidgetPos, widgetGeometry.size())); -- 2.7.4