From 1fc6569158fef076061236b986fb417c7c8ff984 Mon Sep 17 00:00:00 2001 From: Volker Krause Date: Sun, 6 Mar 2022 13:33:16 +0100 Subject: [PATCH] Adapt to QQmlListProperty API changes in Qt6 --- components/containmentlayoutmanager/itemcontainer.cpp | 8 ++++++++ components/containmentlayoutmanager/itemcontainer.h | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/components/containmentlayoutmanager/itemcontainer.cpp b/components/containmentlayoutmanager/itemcontainer.cpp index 20d245f7e..d76fcd949 100644 --- a/components/containmentlayoutmanager/itemcontainer.cpp +++ b/components/containmentlayoutmanager/itemcontainer.cpp @@ -335,7 +335,11 @@ void ItemContainer::contentData_append(QQmlListProperty *prop, QObject container->m_contentData.append(object); } +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) int ItemContainer::contentData_count(QQmlListProperty *prop) +#else +qsizetype ItemContainer::contentData_count(QQmlListProperty *prop) +#endif { ItemContainer *container = static_cast(prop->object); if (!container) { @@ -345,7 +349,11 @@ int ItemContainer::contentData_count(QQmlListProperty *prop) return container->m_contentData.count(); } +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) QObject *ItemContainer::contentData_at(QQmlListProperty *prop, int index) +#else +QObject *ItemContainer::contentData_at(QQmlListProperty *prop, qsizetype index) +#endif { ItemContainer *container = static_cast(prop->object); if (!container) { diff --git a/components/containmentlayoutmanager/itemcontainer.h b/components/containmentlayoutmanager/itemcontainer.h index f84c25d79..464a5f0ab 100644 --- a/components/containmentlayoutmanager/itemcontainer.h +++ b/components/containmentlayoutmanager/itemcontainer.h @@ -196,8 +196,13 @@ private: // internal accessorts for the contentData QProperty static void contentData_append(QQmlListProperty *prop, QObject *object); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) static int contentData_count(QQmlListProperty *prop); static QObject *contentData_at(QQmlListProperty *prop, int index); +#else + static qsizetype contentData_count(QQmlListProperty *prop); + static QObject *contentData_at(QQmlListProperty *prop, qsizetype index); +#endif static void contentData_clear(QQmlListProperty *prop); QPointer m_contentItem;