From f249c3d30de43e6f0e4f8905f8a4090a912b0a08 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Sat, 24 Mar 2018 07:48:40 +0100 Subject: 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 --- src/quicktemplates2/qquickmenubar.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/quicktemplates2/qquickmenubar.cpp') diff --git a/src/quicktemplates2/qquickmenubar.cpp b/src/quicktemplates2/qquickmenubar.cpp index 9bd0ea9a..dcd2244d 100644 --- a/src/quicktemplates2/qquickmenubar.cpp +++ b/src/quicktemplates2/qquickmenubar.cpp @@ -502,18 +502,20 @@ void QQuickMenuBar::resetContentHeight() of the menu bar, and also menus that have been dynamically added or inserted using the \l addMenu() and \l insertMenu() methods, respectively. */ -QQmlListProperty QQuickMenuBar::menus() +QQmlListProperty QQuickMenuBarPrivate::menus() { - return QQmlListProperty(this, nullptr, + Q_Q(QQuickMenuBar); + return QQmlListProperty(q, nullptr, QQuickMenuBarPrivate::menus_append, QQuickMenuBarPrivate::menus_count, QQuickMenuBarPrivate::menus_at, QQuickMenuBarPrivate::menus_clear); } -QQmlListProperty QQuickMenuBar::contentData() +QQmlListProperty QQuickMenuBarPrivate::contentData() { - return QQmlListProperty(this, nullptr, + Q_Q(QQuickMenuBar); + return QQmlListProperty(q, nullptr, QQuickMenuBarPrivate::contentData_append, QQuickContainerPrivate::contentData_count, QQuickContainerPrivate::contentData_at, @@ -659,3 +661,5 @@ QAccessible::Role QQuickMenuBar::accessibleRole() const #endif QT_END_NAMESPACE + +#include "moc_qquickmenubar_p.cpp" -- cgit v1.2.3