diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2018-03-24 07:48:40 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2018-04-04 09:03:08 +0000 |
commit | f249c3d30de43e6f0e4f8905f8a4090a912b0a08 (patch) | |
tree | df67d9ca7f3628dfe288621c1a990419347ce0d9 /src/quicktemplates2/qquickscrollview.cpp | |
parent | 5e6b1e2950aa96b53c2fe77185f8d3bf420d27e9 (diff) |
Use Q_PRIVATE_PROPERTY for QQmlListProperty
Hide QQmlListProperty, which is close to unusable in C++, from the
templates C++ API.
Change-Id: I9720fc3297fc625076a8a7553245852b641bc65a
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickscrollview.cpp')
-rw-r--r-- | src/quicktemplates2/qquickscrollview.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/quicktemplates2/qquickscrollview.cpp b/src/quicktemplates2/qquickscrollview.cpp index 30750aa898..1c81eb7044 100644 --- a/src/quicktemplates2/qquickscrollview.cpp +++ b/src/quicktemplates2/qquickscrollview.cpp @@ -108,6 +108,9 @@ class QQuickScrollViewPrivate : public QQuickControlPrivate public: QQuickScrollViewPrivate(); + QQmlListProperty<QObject> contentData(); + QQmlListProperty<QQuickItem> contentChildren(); + QQuickItem *getContentItem() override; QQuickFlickable *ensureFlickable(bool content); @@ -433,10 +436,10 @@ void QQuickScrollView::setContentHeight(qreal height) \sa Item::data, contentChildren */ -QQmlListProperty<QObject> QQuickScrollView::contentData() +QQmlListProperty<QObject> QQuickScrollViewPrivate::contentData() { - Q_D(QQuickScrollView); - return QQmlListProperty<QObject>(this, d, + Q_Q(QQuickScrollView); + return QQmlListProperty<QObject>(q, this, QQuickScrollViewPrivate::contentData_append, QQuickScrollViewPrivate::contentData_count, QQuickScrollViewPrivate::contentData_at, @@ -454,10 +457,10 @@ QQmlListProperty<QObject> QQuickScrollView::contentData() \sa Item::children, contentData */ -QQmlListProperty<QQuickItem> QQuickScrollView::contentChildren() +QQmlListProperty<QQuickItem> QQuickScrollViewPrivate::contentChildren() { - Q_D(QQuickScrollView); - return QQmlListProperty<QQuickItem>(this, d, + Q_Q(QQuickScrollView); + return QQmlListProperty<QQuickItem>(q, this, QQuickScrollViewPrivate::contentChildren_append, QQuickScrollViewPrivate::contentChildren_count, QQuickScrollViewPrivate::contentChildren_at, @@ -580,3 +583,5 @@ QAccessible::Role QQuickScrollView::accessibleRole() const #endif QT_END_NAMESPACE + +#include "moc_qquickscrollview_p.cpp" |