summaryrefslogtreecommitdiffstats
path: root/tests/auto/qwidget/tst_qwidget.cpp
diff options
context:
space:
mode:
authorDavid Boddie <david.boddie@nokia.com>2010-12-06 18:00:42 (GMT)
committerDavid Boddie <david.boddie@nokia.com>2010-12-06 18:00:42 (GMT)
commit34bfad76d1afe4a0ee27496e740c8566387dc16c (patch)
treec4304699a1a2d4a729bddfb3102a5ba3ad9a2cd8 /tests/auto/qwidget/tst_qwidget.cpp
parent16c3df54960b776f35f59288b888e829e7e81002 (diff)
parent608b66b5af75ae6982be428439eea735c00cc455 (diff)
downloadQt-34bfad76d1afe4a0ee27496e740c8566387dc16c.zip
Qt-34bfad76d1afe4a0ee27496e740c8566387dc16c.tar.gz
Qt-34bfad76d1afe4a0ee27496e740c8566387dc16c.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-doc-team into 4.7
Diffstat (limited to 'tests/auto/qwidget/tst_qwidget.cpp')
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp29
1 files changed, 17 insertions, 12 deletions
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index 09af941..5521873 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -4389,7 +4389,6 @@ class WinIdChangeWidget : public QWidget {
public:
WinIdChangeWidget(QWidget *p = 0)
: QWidget(p)
- , m_winIdChangeEventCount(0)
{
}
@@ -4397,13 +4396,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()
@@ -4414,7 +4414,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);
}
{
@@ -4423,11 +4423,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]);
}
{
@@ -4437,15 +4439,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
}
@@ -4457,7 +4460,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);
}
{
@@ -4466,12 +4469,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]);
}
}