[vlc-commits] [Git][videolan/vlc][master] qml: do not assign `selectionModel` to selection model by default in `ListViewExt`

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Fri May 29 14:20:21 UTC 2026



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
c36225d3 by Fatih Uzunoglu at 2026-05-29T15:52:36+02:00
qml: do not assign `selectionModel` to selection model by default in `ListViewExt`

Since the property is not a deferred property, even if the
derived type assigns it to `null` by `selectionModel: null`,
the model would still be created.

This is useful because not all `ListViewExt` derivatives
would be selectable views.

- - - - -


3 changed files:

- modules/gui/qt/playlist/qml/PlaylistPane.qml
- modules/gui/qt/widgets/qml/ListViewExt.qml
- modules/gui/qt/widgets/qml/TableViewExt.qml


Changes:

=====================================
modules/gui/qt/playlist/qml/PlaylistPane.qml
=====================================
@@ -210,6 +210,10 @@ T.Pane {
             Layout.fillWidth: true
             Layout.fillHeight: true
 
+            selectionModel: ListSelectionModel {
+                model: listView.model
+            }
+
             focus: true
 
             clip: !fadingEdge.implicitClipping && (height < contentHeight)


=====================================
modules/gui/qt/widgets/qml/ListViewExt.qml
=====================================
@@ -30,9 +30,8 @@ ListView {
 
     // Properties
 
-    property ListSelectionModel selectionModel: ListSelectionModel {
-        model: root.model
-    }
+    // Optional
+    property ListSelectionModel selectionModel
 
     // Optional property for drop indicator placement and auto scroll feature:
     property var itemContainsDrag: undefined


=====================================
modules/gui/qt/widgets/qml/TableViewExt.qml
=====================================
@@ -28,6 +28,10 @@ import VLC.Style
 ListViewExt {
     id: root
 
+    selectionModel: ListSelectionModel {
+        model: root.model
+    }
+
     property var sortModel: []
 
     property Component tableHeaderDelegate:  TableHeaderDelegate {



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

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/c36225d37e0f1bfca337cb5300141f9b2472b0df
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list