diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-05-01 17:53:57 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-05-02 14:20:47 +0000 |
commit | 1ff97a7dad3b3316f5578dc1ffcbfc40df494bdf (patch) | |
tree | 17b30b1cfd85660dba4ad4d35e8f7af6ede4f99d /tests/auto/quick/qquicktableview/tst_qquicktableview.cpp | |
parent | 7ab47893a5647ecd2fc12e9e4e7504969b4185bb (diff) |
Revert "tests, qquicktableview: add countDelegateItems()"
This reverts commit 1cfd61f63609c4930db6130d2f63f678c420762d.
The commit came in during a time where tests aren't run, and fails
at least on some of our linux platforms.
Change-Id: Idd5c68b0fdec06ca93a9bab9604ad64974ee00e3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/quick/qquicktableview/tst_qquicktableview.cpp')
-rw-r--r-- | tests/auto/quick/qquicktableview/tst_qquicktableview.cpp | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp b/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp index 6cf45eadb7..3a615e1c3b 100644 --- a/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp +++ b/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp @@ -65,14 +65,10 @@ class tst_QQuickTableView : public QQmlDataTest public: tst_QQuickTableView(); - QList<QQuickItem *> findDelegateItems(QQuickTableView *tableView); - private slots: void initTestCase() override; void setAndGetQAIM(); - void countDelegateItems_data(); - void countDelegateItems(); }; tst_QQuickTableView::tst_QQuickTableView() @@ -85,14 +81,6 @@ void tst_QQuickTableView::initTestCase() qmlRegisterType<TestModel>("TestModel", 0, 1, "TestModel"); } -QList<QQuickItem *> tst_QQuickTableView::findDelegateItems(QQuickTableView *tableView) -{ - static const QString delegateObjectName = QStringLiteral("tableViewDelegate"); - // Call processEvents to process any pending polish event posted for tableView - qApp->processEvents(); - return findItems<QQuickItem>(tableView, delegateObjectName); -} - void tst_QQuickTableView::setAndGetQAIM() { LOAD_TABLEVIEW("plaintableview.qml"); @@ -103,43 +91,6 @@ void tst_QQuickTableView::setAndGetQAIM() QCOMPARE(&model, returnModel); } -void tst_QQuickTableView::countDelegateItems_data() -{ - QTest::addColumn<QVariant>("model"); - QTest::addColumn<int>("count"); - - QTest::newRow("QAIM 0x0") << TestModelAsVariant(0, 0) << 0; - QTest::newRow("QAIM 1x1") << TestModelAsVariant(1, 1) << 1; - QTest::newRow("QAIM 2x1") << TestModelAsVariant(2, 1) << 2; - QTest::newRow("QAIM 4x1") << TestModelAsVariant(2, 1) << 2; - QTest::newRow("QAIM 1x2") << TestModelAsVariant(1, 2) << 2; - QTest::newRow("QAIM 1x4") << TestModelAsVariant(1, 2) << 2; - QTest::newRow("QAIM 2x2") << TestModelAsVariant(2, 2) << 4; - QTest::newRow("QAIM 4x4") << TestModelAsVariant(4, 4) << 16; - - QTest::newRow("Number model 0") << QVariant::fromValue(0) << 0; - QTest::newRow("Number model 1") << QVariant::fromValue(1) << 1; - QTest::newRow("Number model 4") << QVariant::fromValue(4) << 4; - - QTest::newRow("QStringList 0") << QVariant::fromValue(QStringList()) << 0; - QTest::newRow("QStringList 1") << QVariant::fromValue(QStringList() << "one") << 1; - QTest::newRow("QStringList 4") << QVariant::fromValue(QStringList() << "one" << "two" << "three" << "four") << 4; -} - -void tst_QQuickTableView::countDelegateItems() -{ - // Assign different models of various sizes, and check that the number of - // delegate items in the view matches the size of the model. Note that for - // this test to be valid, all items must be within the visible area of the view. - LOAD_TABLEVIEW("plaintableview.qml"); - QFETCH(QVariant, model); - QFETCH(int, count); - - tableView->setModel(model); - auto const items = findDelegateItems(tableView); - QCOMPARE(items.count(), count); -} - QTEST_MAIN(tst_QQuickTableView) #include "tst_qquicktableview.moc" |