diff options
author | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2011-01-17 15:06:10 (GMT) |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2011-01-17 15:06:10 (GMT) |
commit | 97668bd920685d25faf82bfde2027305e67b202e (patch) | |
tree | 9e2f1efc273ffde3c80df5ddedd19d3b448208b9 /tests/auto/qwidget | |
parent | 72aa2eb43b0cf5a6eef940da05ac58f605794ffb (diff) | |
parent | 77c4df1325c4bae10c99978a325febada9fd82d0 (diff) | |
download | Qt-97668bd920685d25faf82bfde2027305e67b202e.zip Qt-97668bd920685d25faf82bfde2027305e67b202e.tar.gz Qt-97668bd920685d25faf82bfde2027305e67b202e.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-water-staging into alien-squached
Conflicts:
src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
src/gui/kernel/qcocoaview_mac.mm
src/gui/kernel/qwidget_mac.mm
Diffstat (limited to 'tests/auto/qwidget')
-rw-r--r-- | tests/auto/qwidget/tst_qwidget.cpp | 41 | ||||
-rw-r--r-- | tests/auto/qwidget/tst_qwidget_mac_helpers.h | 2 | ||||
-rw-r--r-- | tests/auto/qwidget/tst_qwidget_mac_helpers.mm | 2 |
3 files changed, 25 insertions, 20 deletions
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index a518470..0d67d41 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** @@ -4353,7 +4353,6 @@ class WinIdChangeWidget : public QWidget { public: WinIdChangeWidget(QWidget *p = 0) : QWidget(p) - , m_winIdChangeEventCount(0) { } @@ -4361,13 +4360,14 @@ protected: bool event(QEvent *e) { if (e->type() == QEvent::WinIdChange) { - ++m_winIdChangeEventCount; + m_winIdList.append(internalWinId()); return true; } return QWidget::event(e); } public: - int m_winIdChangeEventCount; + QList<WId> m_winIdList; + int winIdChangeEventCount() const { return m_winIdList.count(); } }; void tst_QWidget::winIdChangeEvent() @@ -4378,7 +4378,7 @@ void tst_QWidget::winIdChangeEvent() const WId winIdBefore = widget.internalWinId(); const WId winIdAfter = widget.winId(); QVERIFY(winIdBefore != winIdAfter); - QCOMPARE(widget.m_winIdChangeEventCount, 1); + QCOMPARE(widget.winIdChangeEventCount(), 1); } { @@ -4387,11 +4387,13 @@ void tst_QWidget::winIdChangeEvent() QWidget parent1, parent2; WinIdChangeWidget child(&parent1); const WId winIdBefore = child.winId(); - QCOMPARE(child.m_winIdChangeEventCount, 1); + QCOMPARE(child.winIdChangeEventCount(), 1); child.setParent(&parent2); const WId winIdAfter = child.internalWinId(); QVERIFY(winIdBefore != winIdAfter); - QCOMPARE(child.m_winIdChangeEventCount, 2); + QCOMPARE(child.winIdChangeEventCount(), 3); + // winId is set to zero during reparenting + QVERIFY(0 == child.m_winIdList[1]); } { @@ -4401,15 +4403,16 @@ void tst_QWidget::winIdChangeEvent() QWidget parent(&grandparent1); WinIdChangeWidget child(&parent); const WId winIdBefore = child.winId(); - QCOMPARE(child.m_winIdChangeEventCount, 1); + QCOMPARE(child.winIdChangeEventCount(), 1); parent.setParent(&grandparent2); const WId winIdAfter = child.internalWinId(); #ifdef Q_OS_SYMBIAN QVERIFY(winIdBefore != winIdAfter); - QCOMPARE(child.m_winIdChangeEventCount, 2); + QVERIFY(winIdAfter != 0); + QCOMPARE(child.winIdChangeEventCount(), 2); #else QCOMPARE(winIdBefore, winIdAfter); - QCOMPARE(child.m_winIdChangeEventCount, 1); + QCOMPARE(child.winIdChangeEventCount(), 1); #endif } @@ -4421,7 +4424,7 @@ void tst_QWidget::winIdChangeEvent() child.setParent(&parent2); const WId winIdAfter = child.internalWinId(); QCOMPARE(winIdBefore, winIdAfter); - QCOMPARE(child.m_winIdChangeEventCount, 0); + QCOMPARE(child.winIdChangeEventCount(), 0); } { @@ -4430,12 +4433,14 @@ void tst_QWidget::winIdChangeEvent() WinIdChangeWidget child(&parent); child.winId(); const WId winIdBefore = child.internalWinId(); - QCOMPARE(child.m_winIdChangeEventCount, 1); + QCOMPARE(child.winIdChangeEventCount(), 1); const Qt::WindowFlags flags = child.windowFlags(); child.setWindowFlags(flags | Qt::Window); const WId winIdAfter = child.internalWinId(); QVERIFY(winIdBefore != winIdAfter); - QCOMPARE(child.m_winIdChangeEventCount, 2); + QCOMPARE(child.winIdChangeEventCount(), 3); + // winId is set to zero during reparenting + QVERIFY(0 == child.m_winIdList[1]); } } @@ -10013,7 +10018,7 @@ void tst_QWidget::cbaVisibility() // Verify window decorations i.e. status pane and CBA are visible. CEikStatusPane* statusPane = CEikonEnv::Static()->AppUiFactory()->StatusPane(); QVERIFY(statusPane->IsVisible()); - CEikButtonGroupContainer* buttonGroup = CEikonEnv::Static()->AppUiFactory()->Cba(); + CEikButtonGroupContainer* buttonGroup = CEikButtonGroupContainer::Current(); QVERIFY(buttonGroup->IsVisible()); } @@ -10030,7 +10035,7 @@ void tst_QWidget::fullScreenWindowModeTransitions() const QRect fullScreenGeometry = qApp->desktop()->screenGeometry(&widget); const QRect maximumScreenGeometry = qApp->desktop()->availableGeometry(&widget); CEikStatusPane *statusPane = CEikonEnv::Static()->AppUiFactory()->StatusPane(); - CEikButtonGroupContainer *buttonGroup = CEikonEnv::Static()->AppUiFactory()->Cba(); + CEikButtonGroupContainer *buttonGroup = CEikButtonGroupContainer::Current(); //Enter widget.showNormal(); @@ -10084,7 +10089,7 @@ void tst_QWidget::maximizedWindowModeTransitions() const QRect fullScreenGeometry = qApp->desktop()->screenGeometry(&widget); const QRect maximumScreenGeometry = qApp->desktop()->availableGeometry(&widget); CEikStatusPane *statusPane = CEikonEnv::Static()->AppUiFactory()->StatusPane(); - CEikButtonGroupContainer *buttonGroup = CEikonEnv::Static()->AppUiFactory()->Cba(); + CEikButtonGroupContainer *buttonGroup = CEikButtonGroupContainer::Current(); //Enter widget.showNormal(); @@ -10140,7 +10145,7 @@ void tst_QWidget::minimizedWindowModeTransitions() const QRect fullScreenGeometry = qApp->desktop()->screenGeometry(&widget); const QRect maximumScreenGeometry = qApp->desktop()->availableGeometry(&widget); CEikStatusPane *statusPane = CEikonEnv::Static()->AppUiFactory()->StatusPane(); - CEikButtonGroupContainer *buttonGroup = CEikonEnv::Static()->AppUiFactory()->Cba(); + CEikButtonGroupContainer *buttonGroup = CEikButtonGroupContainer::Current(); //Enter widget.showNormal(); @@ -10196,7 +10201,7 @@ void tst_QWidget::normalWindowModeTransitions() const QRect fullScreenGeometry = qApp->desktop()->screenGeometry(&widget); const QRect maximumScreenGeometry = qApp->desktop()->availableGeometry(&widget); CEikStatusPane *statusPane = CEikonEnv::Static()->AppUiFactory()->StatusPane(); - CEikButtonGroupContainer *buttonGroup = CEikonEnv::Static()->AppUiFactory()->Cba(); + CEikButtonGroupContainer *buttonGroup = CEikButtonGroupContainer::Current(); //Enter widget.showMaximized(); diff --git a/tests/auto/qwidget/tst_qwidget_mac_helpers.h b/tests/auto/qwidget/tst_qwidget_mac_helpers.h index b341971..d4f16b9 100644 --- a/tests/auto/qwidget/tst_qwidget_mac_helpers.h +++ b/tests/auto/qwidget/tst_qwidget_mac_helpers.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/auto/qwidget/tst_qwidget_mac_helpers.mm b/tests/auto/qwidget/tst_qwidget_mac_helpers.mm index e1f23b0..fce0b46 100644 --- a/tests/auto/qwidget/tst_qwidget_mac_helpers.mm +++ b/tests/auto/qwidget/tst_qwidget_mac_helpers.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** |