Adapt to QQmlListProperty API changes in Qt6

wilder-5.25
Volker Krause 4 years ago
parent 0ecf21a8b7
commit 1fc6569158
  1. 8
      components/containmentlayoutmanager/itemcontainer.cpp
  2. 5
      components/containmentlayoutmanager/itemcontainer.h

@ -335,7 +335,11 @@ void ItemContainer::contentData_append(QQmlListProperty<QObject> *prop, QObject
container->m_contentData.append(object);
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
int ItemContainer::contentData_count(QQmlListProperty<QObject> *prop)
#else
qsizetype ItemContainer::contentData_count(QQmlListProperty<QObject> *prop)
#endif
{
ItemContainer *container = static_cast<ItemContainer *>(prop->object);
if (!container) {
@ -345,7 +349,11 @@ int ItemContainer::contentData_count(QQmlListProperty<QObject> *prop)
return container->m_contentData.count();
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QObject *ItemContainer::contentData_at(QQmlListProperty<QObject> *prop, int index)
#else
QObject *ItemContainer::contentData_at(QQmlListProperty<QObject> *prop, qsizetype index)
#endif
{
ItemContainer *container = static_cast<ItemContainer *>(prop->object);
if (!container) {

@ -196,8 +196,13 @@ private:
// internal accessorts for the contentData QProperty
static void contentData_append(QQmlListProperty<QObject> *prop, QObject *object);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
static int contentData_count(QQmlListProperty<QObject> *prop);
static QObject *contentData_at(QQmlListProperty<QObject> *prop, int index);
#else
static qsizetype contentData_count(QQmlListProperty<QObject> *prop);
static QObject *contentData_at(QQmlListProperty<QObject> *prop, qsizetype index);
#endif
static void contentData_clear(QQmlListProperty<QObject> *prop);
QPointer<QQuickItem> m_contentItem;

Loading…
Cancel
Save