[vlc-commits] qt: register qml singleton type PlayerListModel
Fatih Uzunoglu
git at videolan.org
Tue Apr 6 09:55:08 UTC 2021
vlc | branch: master | Fatih Uzunoglu <fuzun54 at outlook.com> | Fri Apr 2 01:22:35 2021 +0300| [20725496ae914d9a11372020dc58b1d2e0f9a367] | committer: Pierre Lamot
qt: register qml singleton type PlayerListModel
qmlRegisterSingletonType provides a convenient way
for the QML-side to invoke static methods of classes
that are not created or can not be created.
PlayerListModel singleton is generated from the
static function of
PlayerControlbarModel::getPlaylistIdentifierListModel.
Signed-off-by: Pierre Lamot <pierre at videolabs.io>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=20725496ae914d9a11372020dc58b1d2e0f9a367
---
modules/gui/qt/maininterface/mainui.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/modules/gui/qt/maininterface/mainui.cpp b/modules/gui/qt/maininterface/mainui.cpp
index 0c518b2599..4711dd04b9 100644
--- a/modules/gui/qt/maininterface/mainui.cpp
+++ b/modules/gui/qt/maininterface/mainui.cpp
@@ -244,6 +244,7 @@ void MainUI::registerQMLTypes()
qmlRegisterUncreatableType<ControlbarProfile>("org.videolan.vlc", 0, 1, "ControlbarProfile", "");
qmlRegisterUncreatableType<PlayerControlbarModel>("org.videolan.vlc", 0, 1, "PlayerControlbarModel", "");
qmlRegisterUncreatableType<ControlListModel>( "org.videolan.vlc", 0, 1, "ControlListModel", "" );
+ qmlRegisterSingletonType("org.videolan.vlc", 0, 1, "PlayerListModel", PlayerControlbarModel::getPlaylistIdentifierListModel);
qRegisterMetaType<QmlMainContext*>();
qmlRegisterType<QmlGlobalMenu>( "org.videolan.vlc", 0, 1, "QmlGlobalMenu" );
More information about the vlc-commits
mailing list