diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-11-05 22:52:50 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-11-05 22:52:50 (GMT) |
commit | 7f6deb2d42933f59adbebc95b872e670978de3e6 (patch) | |
tree | 329bc78a9766c296186605fab85acecb16293dbe /tests/auto/qheaderview | |
parent | 84c519862aa3a089471af6fd2174b16a88c10844 (diff) | |
parent | 58bac5551cbeed83a99e257226bb7b40d363bab9 (diff) | |
download | Qt-7f6deb2d42933f59adbebc95b872e670978de3e6.zip Qt-7f6deb2d42933f59adbebc95b872e670978de3e6.tar.gz Qt-7f6deb2d42933f59adbebc95b872e670978de3e6.tar.bz2 |
Merge branch 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration into master-integration
* 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration: (72 commits)
Fix opening a network session multiple times in succession.
Fix synchronous dispatch in ICD in non-main threads.
Russian translation update
QNAM HTTP: Download last chunk properly when readBufferSize() limited
Remove code changes that were NOT intended as part of the fix
Prevent access to non-existent memory in QGL2PEXVertexArray
Wordwrap QInputDialog label in Symbian
Prevent excessive seeks in xbm detection
Use qtmain.lib to provide entry point for all Symbian applications
Give the toplevel widget a layout
Doc: Correcting character escape bug
fix tests when using Qt in a namespace
Fix tst_symbols auto test
Doc: Clarified the lifetime of the session bus connection.
Doc: Added a snippet showing the default BorderImage tiling behavior.
Doc: using pointer member variables and language change
Doc: Added more instructions to help with device file permissions.
Doc: Mentioned default values for the BorderImage tile modes.
Document the difference between +0.0 and -0.0 for QPointF and QSizeF.
trivial: fix build
...
Diffstat (limited to 'tests/auto/qheaderview')
-rw-r--r-- | tests/auto/qheaderview/tst_qheaderview.cpp | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/tests/auto/qheaderview/tst_qheaderview.cpp b/tests/auto/qheaderview/tst_qheaderview.cpp index da0a0bb..5252ec6 100644 --- a/tests/auto/qheaderview/tst_qheaderview.cpp +++ b/tests/auto/qheaderview/tst_qheaderview.cpp @@ -196,6 +196,7 @@ private slots: void QTBUG12268_hiddenMovedSectionSorting(); protected: + QWidget *topLevel; QHeaderView *view; QStandardItemModel *model; }; @@ -345,7 +346,8 @@ void tst_QHeaderView::cleanupTestCase() void tst_QHeaderView::init() { - view = new QHeaderView(Qt::Vertical); + topLevel = new QWidget(); + view = new QHeaderView(Qt::Vertical,topLevel); // Some initial value tests before a model is added QCOMPARE(view->length(), 0); QVERIFY(view->sizeHint() == QSize(0,0)); @@ -373,7 +375,8 @@ void tst_QHeaderView::init() QSignalSpy spy(view, SIGNAL(sectionCountChanged(int, int))); view->setModel(model); QCOMPARE(spy.count(), 1); - view->show(); + view->resize(200,200); + topLevel->show(); } void tst_QHeaderView::cleanup() @@ -508,7 +511,7 @@ void tst_QHeaderView::stretch() view->resize(viewSize); view->setStretchLastSection(true); QCOMPARE(view->stretchLastSection(), true); - view->show(); + topLevel->show(); QCOMPARE(view->width(), viewSize.width()); QCOMPARE(view->visualIndexAt(view->viewport()->height() - 5), 3); @@ -674,7 +677,7 @@ void tst_QHeaderView::visualIndexAt() QFETCH(QList<int>, visual); view->setStretchLastSection(true); - view->show(); + topLevel->show(); for (int i = 0; i < hidden.count(); ++i) view->setSectionHidden(hidden.at(i), true); @@ -682,6 +685,8 @@ void tst_QHeaderView::visualIndexAt() for (int j = 0; j < from.count(); ++j) view->moveSection(from.at(j), to.at(j)); + QTest::qWait(100); + for (int k = 0; k < coordinate.count(); ++k) QCOMPARE(view->visualIndexAt(coordinate.at(k)), visual.at(k)); } @@ -696,7 +701,7 @@ void tst_QHeaderView::length() view->setFont(font); #endif view->setStretchLastSection(true); - view->show(); + topLevel->show(); //minimumSectionSize should be the size of the last section of the widget is not tall enough int length = view->minimumSectionSize(); @@ -708,7 +713,7 @@ void tst_QHeaderView::length() QCOMPARE(length, view->length()); view->setStretchLastSection(false); - view->show(); + topLevel->show(); QVERIFY(length != view->length()); @@ -759,7 +764,7 @@ void tst_QHeaderView::logicalIndexAt() QCOMPARE(view->logicalIndexAt(0), 0); QCOMPARE(view->logicalIndexAt(1), 0); - view->show(); + topLevel->show(); view->setStretchLastSection(true); // First item QCOMPARE(view->logicalIndexAt(0), 0); @@ -1062,7 +1067,7 @@ void tst_QHeaderView::resizeWithResizeModes() view->resizeSection(i, sections.at(i)); view->setResizeMode(i, (QHeaderView::ResizeMode)modes.at(i)); } - view->show(); + topLevel->show(); view->resize(size, size); for (int j = 0; j < expected.count(); ++j) QCOMPARE(view->sectionSize(j), expected.at(j)); @@ -1160,7 +1165,7 @@ void tst_QHeaderView::resizeSection() view->resize(400, 400); - view->show(); + topLevel->show(); view->setMovable(true); view->setStretchLastSection(false); @@ -2035,14 +2040,14 @@ void tst_QHeaderView::QTBUG7833_sectionClicked() QTest::mouseClick(tv.horizontalHeader()->viewport(), Qt::LeftButton, Qt::NoModifier, - QPoint(tv.horizontalHeader()->sectionViewportPosition(11) + 5, 5)); + QPoint(tv.horizontalHeader()->sectionViewportPosition(11) + tv.horizontalHeader()->sectionSize(11)/2, 5)); QCOMPARE(clickedSpy.count(), 1); QCOMPARE(pressedSpy.count(), 1); QCOMPARE(clickedSpy.at(0).at(0).toInt(), 11); QCOMPARE(pressedSpy.at(0).at(0).toInt(), 11); QTest::mouseClick(tv.horizontalHeader()->viewport(), Qt::LeftButton, Qt::NoModifier, - QPoint(tv.horizontalHeader()->sectionViewportPosition(8) + 5, 5)); + QPoint(tv.horizontalHeader()->sectionViewportPosition(8) + tv.horizontalHeader()->sectionSize(0)/2, 5)); QCOMPARE(clickedSpy.count(), 2); QCOMPARE(pressedSpy.count(), 2); @@ -2050,7 +2055,7 @@ void tst_QHeaderView::QTBUG7833_sectionClicked() QCOMPARE(pressedSpy.at(1).at(0).toInt(), 8); QTest::mouseClick(tv.horizontalHeader()->viewport(), Qt::LeftButton, Qt::NoModifier, - QPoint(tv.horizontalHeader()->sectionViewportPosition(0) + 5, 5)); + QPoint(tv.horizontalHeader()->sectionViewportPosition(0) + tv.horizontalHeader()->sectionSize(0)/2, 5)); QCOMPARE(clickedSpy.count(), 3); QCOMPARE(pressedSpy.count(), 3); |