[vlc-commits] [Git][videolan/vlc][master] 2 commits: qml: do not break and re-establish the selected binding for delegate in `TableViewExt`

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Apr 29 06:53:53 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
1b78c0d3 by Fatih Uzunoglu at 2026-04-29T06:18:41+00:00
qml: do not break and re-establish the selected binding for delegate in `TableViewExt`

We do not need this because `ListSelectionModel::selectedIndexesFlat` property already
has NOTIFY signal.

The same applies to `GridItem`, but that is handled in a different merge request where
it is proposed to use built-in `GridView` for `ExpandGridView`.

- - - - -
d8e17877 by Fatih Uzunoglu at 2026-04-29T06:18:41+00:00
qml: make property `selected` read-only in `TableViewDelegateExt`

- - - - -


2 changed files:

- modules/gui/qt/widgets/qml/TableViewDelegateExt.qml
- modules/gui/qt/widgets/qml/TableViewExt.qml


Changes:

=====================================
modules/gui/qt/widgets/qml/TableViewDelegateExt.qml
=====================================
@@ -32,11 +32,12 @@ T.Control {
     required property int index
     required property var rowModel
     required property var sortModel
-    required property bool selected
     required property Widgets.DragItem dragItem
 
     required property var contextMenu
 
+    readonly property bool selected: (selectionModel?.selectedIndexesFlat.includes(index) ?? false)
+
     readonly property bool topContainsDrag: dropAreaLayout.higherDropArea.containsDrag
     readonly property bool bottomContainsDrag: dropAreaLayout.lowerDropArea.containsDrag
     readonly property bool containsDrag: (topContainsDrag || bottomContainsDrag)


=====================================
modules/gui/qt/widgets/qml/TableViewExt.qml
=====================================
@@ -353,8 +353,6 @@ ListViewExt {
         rowModel: model
         sortModel: root.sortModel
 
-        selected: selectionModel.selectedIndexesFlat.includes(index)
-
         onRightClick: (menuParent, menuModel, globalMousePos) => {
             root.rightClick(menuParent, menuModel, globalMousePos)
         }
@@ -375,15 +373,5 @@ ListViewExt {
         }
 
         onContainsDragChanged: root.updateItemContainsDrag(this, containsDrag)
-
-        Connections {
-            target: selectionModel
-
-            function onSelectionChanged() {
-                tableDelegate.selected = Qt.binding(function() {
-                  return root.selectionModel.selectedIndexesFlat.includes(index)
-                })
-            }
-        }
     }
 }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/50e69fec0f7ed41664c405eb3352bf41d592e9c6...d8e17877de2926d8d599bd965a8b9375e04d4f36

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/50e69fec0f7ed41664c405eb3352bf41d592e9c6...d8e17877de2926d8d599bd965a8b9375e04d4f36
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list