aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicklistview.cpp
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2024-07-18 09:30:09 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2024-07-18 15:23:43 +0200
commit16b49089c69187d2a82f42874cd6253ca656e3ca (patch)
tree29b90ea783b26dc5654013148d8cbbcee7035e7a /src/quick/items/qquicklistview.cpp
parentf4ea7af462a4b6cd9fc8bb6e57c8d0224881e9ab (diff)
(List|Grid)ViewAttached: Narrow down the view type
The classes tried to reuse as much functionality as possible by putting it into the common base class, QQuickItemViewAttached. That however meant that the view property could only have the type QQuickItemView, confusing tooling. This change moves the property to the derived classes, and changes the type to the derived type (matching what is already documented). This is safe (API stability wise) because QQuickItemViewAttached does not exist as its own type in QML, and the C++ type exists only in a private header. Fixes: QTBUG-124412 Pick-to: 6.8 Change-Id: Ic613d2afce311d974072913a110a601ce2ee0251 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quick/items/qquicklistview.cpp')
-rw-r--r--src/quick/items/qquicklistview.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/items/qquicklistview.cpp b/src/quick/items/qquicklistview.cpp
index bc07c12521..9701507b14 100644
--- a/src/quick/items/qquicklistview.cpp
+++ b/src/quick/items/qquicklistview.cpp
@@ -1110,7 +1110,7 @@ QQuickItem * QQuickListViewPrivate::getSectionItem(const QString &section)
sectionItem->setParentItem(contentItem);
}
// sections are not controlled by FxListItemSG, so apply attached properties here
- QQuickItemViewAttached *attached = static_cast<QQuickItemViewAttached*>(qmlAttachedPropertiesObject<QQuickListView>(sectionItem));
+ auto *attached = static_cast<QQuickListViewAttached*>(qmlAttachedPropertiesObject<QQuickListView>(sectionItem));
attached->setView(q);
} else if (!reuseExistingContext) {
delete context;