diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-09-09 14:26:49 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-09-09 14:26:49 (GMT) |
commit | 0d76ad42f5479fb21ad9cd64f7251a421cc6a151 (patch) | |
tree | 9b2ce272d3afcf42f4660c922c6a33af9df3cbf8 /tests/auto | |
parent | 098c952dac34ff2a82e07ccf54056f74f9208ba5 (diff) | |
parent | 5b9479964baa2a8f4b1278a5894ec1dd181e611c (diff) | |
download | Qt-0d76ad42f5479fb21ad9cd64f7251a421cc6a151.zip Qt-0d76ad42f5479fb21ad9cd64f7251a421cc6a151.tar.gz Qt-0d76ad42f5479fb21ad9cd64f7251a421cc6a151.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2:
QList::toVector()/QVector::toStdVector()/QVector::fromStdVector(): use reserve()
When a move is completed, report the source and destination correctly.
Fixed the scrolling of text in QLineEdit with right alignment
Removing Q_ENUMS declaration in QTransform
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qabstractitemmodel/tst_qabstractitemmodel.cpp | 6 | ||||
-rw-r--r-- | tests/auto/qlineedit/tst_qlineedit.cpp | 19 |
2 files changed, 23 insertions, 2 deletions
diff --git a/tests/auto/qabstractitemmodel/tst_qabstractitemmodel.cpp b/tests/auto/qabstractitemmodel/tst_qabstractitemmodel.cpp index 6f158f0..dbcccc9 100644 --- a/tests/auto/qabstractitemmodel/tst_qabstractitemmodel.cpp +++ b/tests/auto/qabstractitemmodel/tst_qabstractitemmodel.cpp @@ -1208,6 +1208,7 @@ void tst_QAbstractItemModel::testMoveToGrandParent() QSignalSpy beforeSpy(m_model, SIGNAL(rowsAboutToBeMoved(const QModelIndex &, int, int, const QModelIndex &, int))); QSignalSpy afterSpy(m_model, SIGNAL(rowsMoved(const QModelIndex &, int, int, const QModelIndex &, int))); + QPersistentModelIndex persistentSource = sourceIndex; ModelMoveCommand *moveCommand = new ModelMoveCommand(m_model, this); moveCommand->setAncestorRowNumbers(QList<int>() << 5); @@ -1228,7 +1229,7 @@ void tst_QAbstractItemModel::testMoveToGrandParent() QCOMPARE(beforeSignal.at(4).toInt(), destRow); QCOMPARE(afterSignal.size(), 5); - QCOMPARE(afterSignal.at(0).value<QModelIndex>(), sourceIndex); + QCOMPARE(afterSignal.at(0).value<QModelIndex>(), static_cast<QModelIndex>(persistentSource)); QCOMPARE(afterSignal.at(1).toInt(), startRow); QCOMPARE(afterSignal.at(2).toInt(), endRow); QCOMPARE(afterSignal.at(3).value<QModelIndex>(), QModelIndex()); @@ -1351,6 +1352,7 @@ void tst_QAbstractItemModel::testMoveToSibling() QSignalSpy beforeSpy(m_model, SIGNAL(rowsAboutToBeMoved(const QModelIndex &, int, int, const QModelIndex &, int))); QSignalSpy afterSpy(m_model, SIGNAL(rowsMoved(const QModelIndex &, int, int, const QModelIndex &, int))); + QPersistentModelIndex persistentDest = destIndex; ModelMoveCommand *moveCommand = new ModelMoveCommand(m_model, this); moveCommand->setNumCols(4); @@ -1374,7 +1376,7 @@ void tst_QAbstractItemModel::testMoveToSibling() QCOMPARE(afterSignal.at(0).value<QModelIndex>(), sourceIndex); QCOMPARE(afterSignal.at(1).toInt(), startRow); QCOMPARE(afterSignal.at(2).toInt(), endRow); - QCOMPARE(afterSignal.at(3).value<QModelIndex>(), destIndex); + QCOMPARE(afterSignal.at(3).value<QModelIndex>(), static_cast<QModelIndex>(persistentDest)); QCOMPARE(afterSignal.at(4).toInt(), destRow); for (int i = 0; i < indexList.size(); i++) diff --git a/tests/auto/qlineedit/tst_qlineedit.cpp b/tests/auto/qlineedit/tst_qlineedit.cpp index 717b32d..bfa9406 100644 --- a/tests/auto/qlineedit/tst_qlineedit.cpp +++ b/tests/auto/qlineedit/tst_qlineedit.cpp @@ -275,6 +275,7 @@ private slots: #endif void taskQTBUG_7395_readOnlyShortcut(); void QTBUG697_paletteCurrentColorGroup(); + void QTBUG13520_textNotVisible(); #ifdef QT3_SUPPORT void validateAndSet_data(); @@ -3034,6 +3035,8 @@ public: }; State state; + + friend class tst_QLineEdit; }; Q_DECLARE_METATYPE(LineEdit::State); @@ -3741,5 +3744,21 @@ void tst_QLineEdit::QTBUG697_paletteCurrentColorGroup() QCOMPARE(img.pixel(10, le.height()/2), QColor(Qt::red).rgb()); } +void tst_QLineEdit::QTBUG13520_textNotVisible() +{ + LineEdit le; + le.setAlignment( Qt::AlignRight | Qt::AlignVCenter);
+ le.show();
+ QTest::qWaitForWindowShown(&le);
+ le.setText("01-ST16-01SIL-MPL001wfgsdfgsdgsdfgsdfgsdfgsdfgsdfg");
+ le.setCursorPosition(0);
+ QTest::qWait(100); //just make sure we get he lineedit correcly painted
+
+ QVERIFY(le.cursorRect().center().x() < le.width() / 2);
+
+ +} + + QTEST_MAIN(tst_QLineEdit) #include "tst_qlineedit.moc" |