diff options
Diffstat (limited to 'tests/auto/qabstractitemview/tst_qabstractitemview.cpp')
-rw-r--r-- | tests/auto/qabstractitemview/tst_qabstractitemview.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/tests/auto/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/qabstractitemview/tst_qabstractitemview.cpp index a35270a..67aac6f 100644 --- a/tests/auto/qabstractitemview/tst_qabstractitemview.cpp +++ b/tests/auto/qabstractitemview/tst_qabstractitemview.cpp @@ -211,7 +211,7 @@ private slots: void noFallbackToRoot(); void setCurrentIndex_data(); void setCurrentIndex(); - + void task221955_selectedEditor(); void task250754_fontChange(); }; @@ -453,7 +453,7 @@ void tst_QAbstractItemView::basic_tests(TestView *view) view->setDragEnabled(true); QCOMPARE(view->dragEnabled(), true); #endif - + // setAlternatingRowColors view->setAlternatingRowColors(false); QCOMPARE(view->alternatingRowColors(), false); @@ -566,7 +566,7 @@ void tst_QAbstractItemView::basic_tests(TestView *view) view->tst_setState(TestView::CollapsingState); QVERIFY(view->tst_state()==TestView::CollapsingState); #endif - + view->tst_startAutoScroll(); view->tst_stopAutoScroll(); view->tst_doAutoScroll(); @@ -951,12 +951,12 @@ void tst_QAbstractItemView::dragAndDropOnChild() class TestModel : public QStandardItemModel { public: - TestModel(int rows, int columns) : QStandardItemModel(rows, columns) + TestModel(int rows, int columns) : QStandardItemModel(rows, columns) { setData_count = 0; } - virtual bool setData(const QModelIndex &/*index*/, const QVariant &/*value*/, int /*role = Qt::EditRole*/) + virtual bool setData(const QModelIndex &/*index*/, const QVariant &/*value*/, int /*role = Qt::EditRole*/) { ++setData_count; return true; @@ -973,20 +973,20 @@ void tst_QAbstractItemView::setItemDelegate_data() // default is rows, a -1 will switch to columns QTest::addColumn<IntList>("rowsOrColumnsWithDelegate"); QTest::addColumn<QPoint>("cellToEdit"); - QTest::newRow("4 columndelegates") - << (IntList() << -1 << 0 << 1 << 2 << 3) + QTest::newRow("4 columndelegates") + << (IntList() << -1 << 0 << 1 << 2 << 3) << QPoint(0, 0); - QTest::newRow("2 identical rowdelegates on the same row") - << (IntList() << 0 << 0) + QTest::newRow("2 identical rowdelegates on the same row") + << (IntList() << 0 << 0) << QPoint(0, 0); - QTest::newRow("2 identical columndelegates on the same column") - << (IntList() << -1 << 2 << 2) + QTest::newRow("2 identical columndelegates on the same column") + << (IntList() << -1 << 2 << 2) << QPoint(2, 0); - QTest::newRow("2 duplicate delegates, 1 row and 1 column") - << (IntList() << 0 << -1 << 2) + QTest::newRow("2 duplicate delegates, 1 row and 1 column") + << (IntList() << 0 << -1 << 2) << QPoint(2, 0); - QTest::newRow("4 duplicate delegates, 2 row and 2 column") - << (IntList() << 0 << 0 << -1 << 2 << 2) + QTest::newRow("4 duplicate delegates, 2 row and 2 column") + << (IntList() << 0 << 0 << -1 << 2 << 2) << QPoint(2, 0); } @@ -1008,7 +1008,7 @@ void tst_QAbstractItemView::setItemDelegate() if (row) { v.setItemDelegateForRow(rc, delegate); } else { - v.setItemDelegateForColumn(rc, delegate); + v.setItemDelegateForColumn(rc, delegate); } } } @@ -1126,42 +1126,42 @@ void tst_QAbstractItemView::setCurrentIndex() void tst_QAbstractItemView::task221955_selectedEditor() { QPushButton *button; - + QTreeWidget tree; tree.setColumnCount(2); tree.addTopLevelItem(new QTreeWidgetItem(QStringList() << "Foo" <<"1")); tree.addTopLevelItem(new QTreeWidgetItem(QStringList() << "Bar" <<"2")); tree.addTopLevelItem(new QTreeWidgetItem(QStringList() << "Baz" <<"3")); - + QTreeWidgetItem *dummy = new QTreeWidgetItem(); tree.addTopLevelItem(dummy); tree.setItemWidget(dummy, 0, button = new QPushButton("More...")); button->setAutoFillBackground(true); // as recommended in doc - + tree.show(); tree.setFocus(); tree.setCurrentIndex(tree.model()->index(1,0)); QTest::qWait(100); QApplication::setActiveWindow(&tree); - + QVERIFY(! tree.selectionModel()->selectedIndexes().contains(tree.model()->index(3,0))); //We set the focus to the button, the index need to be selected - button->setFocus(); + button->setFocus(); QTest::qWait(100); QVERIFY(tree.selectionModel()->selectedIndexes().contains(tree.model()->index(3,0))); - + tree.setCurrentIndex(tree.model()->index(1,0)); QVERIFY(! tree.selectionModel()->selectedIndexes().contains(tree.model()->index(3,0))); - + //Same thing but with the flag NoSelection, nothing can be selected. tree.setFocus(); tree.setSelectionMode(QAbstractItemView::NoSelection); tree.clearSelection(); QVERIFY(tree.selectionModel()->selectedIndexes().isEmpty()); QTest::qWait(10); - button->setFocus(); + button->setFocus(); QTest::qWait(50); QVERIFY(tree.selectionModel()->selectedIndexes().isEmpty()); } @@ -1202,7 +1202,7 @@ void tst_QAbstractItemView::task250754_fontChange() QTest::qWait(30); //now with the huge items, the scrollbar must be visible QVERIFY(tree.verticalScrollBar()->isVisible()); - + qApp->setStyleSheet(app_css); } |