[vlc-devel] [PATCH 00/16] qml: handle selection with ItemSelectionModel instead of DelegateModels

Pierre Lamot pierre at videolabs.io
Wed May 27 17:06:41 CEST 2020


DelegateModels where mainly use to handle selection. Qml provides
ItemSelectionModel which is better suited for this tasks. This patchset refactor
our use of Delegate model to match ItemSelectionModel API then replace our
DelegateModels with ItemSelectionModel.

it also extend ML and network models to expose  model count as a property, and
provides direct data accessor to access data by id outside or a Repeater View delegate.

branch is available at https://code.videolan.org/chub/vlc/-/tree/qml/no-delegate

Pierre Lamot (16):
  qml: provide hasSelection property in SelectableDelegateModel
  qt: allow to get medialibrary ids from the list of item index
  qml: enqueue in playlist using selected index
  qml: expose Selection API in SelectableDelegate model
  qml: expose isSelected API in SelectableDelegate model
  qt: expose model count in network models
  qml: inline Network views delegates
  qml: no longer use Delegatemodel package as delegate
  qt: provide count property in ML models
  qt: provide direct access to model data in ML models
  qt: allow to enqueue network item using model indexes
  qt: provide direct access to model data of network models
  qml: use count directly provided by models
  qml: access directly to model data in ExpandGridView
  qml: factorize network home page
  qml: use ItemSelectionModel to handle selection instead of
    DelegateModel

 modules/gui/qt/Makefile.am                    |   2 +-
 modules/gui/qt/medialibrary/mlbasemodel.cpp   |  10 ++
 modules/gui/qt/medialibrary/mlbasemodel.hpp   |  93 +++++++++-
 .../gui/qt/medialibrary/qml/MusicAlbums.qml   | 126 +++++++------
 .../medialibrary/qml/MusicArtistsDisplay.qml  | 119 +++++++------
 .../gui/qt/medialibrary/qml/MusicGenres.qml   | 151 ++++++++--------
 .../qml/MusicTrackListDisplay.qml             |   8 +-
 .../medialibrary/qml/MusicTracksDisplay.qml   |   4 +-
 .../gui/qt/medialibrary/qml/VideoDisplay.qml  |  62 +++----
 .../qt/medialibrary/qml/VideoListDisplay.qml  |  11 +-
 modules/gui/qt/network/networkdevicemodel.cpp |  51 +++++-
 modules/gui/qt/network/networkdevicemodel.hpp |   9 +-
 modules/gui/qt/network/networkmediamodel.cpp  |  80 +++++++--
 modules/gui/qt/network/networkmediamodel.hpp  |   8 +-
 .../qt/network/qml/NetworkBrowseDisplay.qml   | 107 ++++++++---
 .../network/qml/NetworkHomeDeviceListView.qml | 102 +++++++++++
 .../gui/qt/network/qml/NetworkHomeDisplay.qml |  94 +++-------
 .../gui/qt/network/qml/NetworkListItem.qml    |   2 -
 .../qml/NetworksSectionSelectableDM.qml       | 132 --------------
 .../qt/util/qml/SelectableDelegateModel.qml   |  26 +--
 modules/gui/qt/vlc.qrc                        |   2 +-
 modules/gui/qt/widgets/qml/ExpandGridView.qml | 166 +++++++++++-------
 .../qt/widgets/qml/KeyNavigableTableView.qml  | 147 ++++++++--------
 modules/gui/qt/widgets/qml/ListItem.qml       |   4 +-
 24 files changed, 847 insertions(+), 669 deletions(-)
 create mode 100644 modules/gui/qt/network/qml/NetworkHomeDeviceListView.qml
 delete mode 100644 modules/gui/qt/network/qml/NetworksSectionSelectableDM.qml

-- 
2.25.1



More information about the vlc-devel mailing list