aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickmenubar.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2018-03-24 07:48:40 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2018-04-04 09:03:08 +0000
commitf249c3d30de43e6f0e4f8905f8a4090a912b0a08 (patch)
treedf67d9ca7f3628dfe288621c1a990419347ce0d9 /src/quicktemplates2/qquickmenubar.cpp
parent5e6b1e2950aa96b53c2fe77185f8d3bf420d27e9 (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/qquickmenubar.cpp')
-rw-r--r--src/quicktemplates2/qquickmenubar.cpp12
1 files changed, 8 insertions, 4 deletions
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<QQuickMenu> QQuickMenuBar::menus()
+QQmlListProperty<QQuickMenu> QQuickMenuBarPrivate::menus()
{
- return QQmlListProperty<QQuickMenu>(this, nullptr,
+ Q_Q(QQuickMenuBar);
+ return QQmlListProperty<QQuickMenu>(q, nullptr,
QQuickMenuBarPrivate::menus_append,
QQuickMenuBarPrivate::menus_count,
QQuickMenuBarPrivate::menus_at,
QQuickMenuBarPrivate::menus_clear);
}
-QQmlListProperty<QObject> QQuickMenuBar::contentData()
+QQmlListProperty<QObject> QQuickMenuBarPrivate::contentData()
{
- return QQmlListProperty<QObject>(this, nullptr,
+ Q_Q(QQuickMenuBar);
+ return QQmlListProperty<QObject>(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"