diff options
author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2018-08-13 14:51:16 +0200 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2018-08-13 20:08:45 +0000 |
commit | 414d8f65786ed3d2020dd85965224a59068a0d5d (patch) | |
tree | 2949cd456d6951dc47213f692484d51f11bf3ca6 | |
parent | c7ec614a8443a559a722b83ccf1c370fb1ee5a42 (diff) |
QQuickTableView: rename attached prop tableView to view
ListView calls the same attached property for 'view'. So
do the same for TableView.
Change-Id: I99034869813750e2fab56fe6ffcc4b4a6a4d9c52
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r-- | src/quick/items/qquicktableview.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/qquicktableview_p.h | 17 | ||||
-rw-r--r-- | tests/auto/quick/qquicktableview/tst_qquicktableview.cpp | 1 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/quick/items/qquicktableview.cpp b/src/quick/items/qquicktableview.cpp index 6a7bc78c4d..3925fe95cf 100644 --- a/src/quick/items/qquicktableview.cpp +++ b/src/quick/items/qquicktableview.cpp @@ -1173,7 +1173,7 @@ void QQuickTableViewPrivate::initItemCallback(int modelIndex, QObject *object) item->setParentItem(q->contentItem()); if (auto attached = getAttachedObject(object)) - attached->setTableView(q); + attached->setView(q); } void QQuickTableViewPrivate::itemPooledCallback(int modelIndex, QObject *object) diff --git a/src/quick/items/qquicktableview_p.h b/src/quick/items/qquicktableview_p.h index 1ad74fa438..7e0f9ba8c6 100644 --- a/src/quick/items/qquicktableview_p.h +++ b/src/quick/items/qquicktableview_p.h @@ -159,28 +159,27 @@ private: class Q_QUICK_PRIVATE_EXPORT QQuickTableViewAttached : public QObject { Q_OBJECT - - Q_PROPERTY(QQuickTableView *tableView READ tableView NOTIFY tableViewChanged) + Q_PROPERTY(QQuickTableView *view READ view NOTIFY viewChanged) public: QQuickTableViewAttached(QObject *parent) : QObject(parent) {} - QQuickTableView *tableView() const { return m_tableview; } - void setTableView(QQuickTableView *newTableView) { - if (newTableView == m_tableview) + QQuickTableView *view() const { return m_view; } + void setView(QQuickTableView *newTableView) { + if (newTableView == m_view) return; - m_tableview = newTableView; - Q_EMIT tableViewChanged(); + m_view = newTableView; + Q_EMIT viewChanged(); } Q_SIGNALS: - void tableViewChanged(); + void viewChanged(); void pooled(); void reused(); private: - QPointer<QQuickTableView> m_tableview; + QPointer<QQuickTableView> m_view; friend class QQuickTableViewPrivate; }; diff --git a/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp b/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp index eefa0411b7..c91085b0ff 100644 --- a/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp +++ b/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp @@ -831,6 +831,7 @@ void tst_QQuickTableView::checkInitialAttachedProperties() QCOMPARE(contextCell.x(), cell.x()); QCOMPARE(contextIndex, index); QCOMPARE(contextModelData, QStringLiteral("%1").arg(cell.y())); + QCOMPARE(getAttachedObject(item)->view(), tableView); } } |