aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick/qquicktableview/tst_qquicktableview.cpp')
-rw-r--r--tests/auto/quick/qquicktableview/tst_qquicktableview.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp b/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp
index e25a7b72bb..29eb61b7ad 100644
--- a/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp
+++ b/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp
@@ -56,10 +56,9 @@ static const char *kModelDataBindingProp = "modelDataBinding";
Q_DECLARE_METATYPE(QMarginsF);
#define LOAD_TABLEVIEW(fileName) \
- QScopedPointer<QQuickView> view(createView()); \
view->setSource(testFileUrl(fileName)); \
view->show(); \
- QVERIFY(QTest::qWaitForWindowActive(view.data())); \
+ QVERIFY(QTest::qWaitForWindowActive(view)); \
auto tableView = view->rootObject()->property(kTableViewPropName).value<QQuickTableView *>(); \
QVERIFY(tableView); \
auto tableViewPrivate = QQuickTableViewPrivate::get(tableView); \
@@ -78,8 +77,12 @@ public:
QQuickTableViewAttached *getAttachedObject(const QObject *object) const;
QPoint getContextRowAndColumn(const QQuickItem *item) const;
+private:
+ QQuickView *view = nullptr;
+
private slots:
void initTestCase() override;
+ void cleanupTestCase();
void setAndGetModel_data();
void setAndGetModel();
@@ -141,6 +144,12 @@ void tst_QQuickTableView::initTestCase()
{
QQmlDataTest::initTestCase();
qmlRegisterType<TestModel>("TestModel", 0, 1, "TestModel");
+ view = createView();
+}
+
+void tst_QQuickTableView::cleanupTestCase()
+{
+ delete view;
}
QQuickTableViewAttached *tst_QQuickTableView::getAttachedObject(const QObject *object) const