[vlc-commits] [Git][videolan/vlc][master] qml: downcast items from `QObject` to `QQuickItem` in `ExpandGridView.qml`

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Apr 1 06:15:38 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
4c3b1769 by Fatih Uzunoglu at 2025-04-01T05:58:51+00:00
qml: downcast items from `QObject` to `QQuickItem` in `ExpandGridView.qml`

As their names suggest, they are supposed to be `QQuickItem` pointer.

Unfortunately when `Loader` started to gain ability to load `QObject`
in Qt 5:

> Since QtQuick 2.0, Loader can load any object type.

They have not changed the name of the property name `item` to `object`,
which can be confusing. I suppose they re-purposed `item` as a generic
"item", not necessarily `QQuickItem`. Still, this goes in conflict with
`Instantiator`'s `object` (not named `item`) (which always had the
ability to load `QObject`).

- - - - -


1 changed file:

- modules/gui/qt/widgets/qml/ExpandGridView.qml


Changes:

=====================================
modules/gui/qt/widgets/qml/ExpandGridView.qml
=====================================
@@ -138,14 +138,14 @@ FocusScope {
     property alias gridScrollBar: flickableScrollBar
 
     property alias expandDelegate: expandItemLoader.sourceComponent
-    property alias expandItem: expandItemLoader.item
+    readonly property Item expandItem: expandItemLoader.item
 
     property alias headerDelegate: headerItemLoader.sourceComponent
     property alias headerHeight: headerItemLoader.implicitHeight
-    property alias headerItem: headerItemLoader.item
+    readonly property Item headerItem: headerItemLoader.item
 
     property alias footerDelegate: footerItemLoader.sourceComponent
-    property alias footerItem: footerItemLoader.item
+    readonly property Item footerItem: footerItemLoader.item
 
     // Signals
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/4c3b17699dd76a61861fa6e5ddcd7a77483284c4

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/4c3b17699dd76a61861fa6e5ddcd7a77483284c4
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list