summaryrefslogtreecommitdiffstats
path: root/tests/auto/qwidget
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-11-25 13:32:37 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2010-11-25 13:32:37 (GMT)
commit850ebb63dfe5fbfdb2107d33a1af4460da59b97c (patch)
tree5e0350e3180de97b561be16072ff1444499048d3 /tests/auto/qwidget
parente868e896054061f35b38dd3e7b688d932be40a55 (diff)
parent5200f708c46d4bc737d6706691965c726c063292 (diff)
downloadQt-850ebb63dfe5fbfdb2107d33a1af4460da59b97c.zip
Qt-850ebb63dfe5fbfdb2107d33a1af4460da59b97c.tar.gz
Qt-850ebb63dfe5fbfdb2107d33a1af4460da59b97c.tar.bz2
Merge remote branch 'origin/4.7' into qt-master-from-4.7
Conflicts: qmake/generators/symbian/symmake.cpp src/corelib/global/qglobal.h src/gui/kernel/qwidget_p.h src/gui/painting/qtextureglyphcache.cpp src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h src/plugins/qpluginbase.pri src/qbase.pri tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp tests/auto/qthread/tst_qthread.cpp tests/auto/selftests/expected_cmptest.txt tests/auto/selftests/expected_crashes_3.txt tests/auto/selftests/expected_longstring.txt tests/auto/selftests/expected_maxwarnings.txt tests/auto/selftests/expected_skip.txt tools/assistant/tools/assistant/doc/assistant.qdocconf tools/qdoc3/test/assistant.qdocconf tools/qdoc3/test/designer.qdocconf tools/qdoc3/test/linguist.qdocconf tools/qdoc3/test/qdeclarative.qdocconf tools/qdoc3/test/qmake.qdocconf tools/qdoc3/test/qt-build-docs.qdocconf tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf tools/qdoc3/test/qt.qdocconf tools/qdoc3/test/qt_ja_JP.qdocconf tools/qdoc3/test/qt_zh_CN.qdocconf
Diffstat (limited to 'tests/auto/qwidget')
-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 d230f2c..ae46fe6 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -4376,7 +4376,6 @@ class WinIdChangeWidget : public QWidget {
public:
WinIdChangeWidget(QWidget *p = 0)
: QWidget(p)
- , m_winIdChangeEventCount(0)
{
}
@@ -4384,13 +4383,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()
@@ -4401,7 +4401,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);
}
{
@@ -4410,11 +4410,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]);
}
{
@@ -4424,15 +4426,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
}
@@ -4444,7 +4447,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);
}
{
@@ -4453,12 +4456,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]);
}
}