[vlc-commits] qt: register QmlMainContext* as a meta-type

Fatih Uzunoglu git at videolan.org
Mon Dec 7 10:08:19 UTC 2020


vlc | branch: master | Fatih Uzunoglu <fuzun54 at outlook.com> | Fri Dec  4 02:01:38 2020 +0300| [dd19af47516e3fae43e7519a44d3cec57bbc213a] | committer: Pierre Lamot

qt: register QmlMainContext* as a meta-type

in some cases qml fails to access QmlMainContext* property when it is not registered as a meta-type.

Signed-off-by: Pierre Lamot <pierre at videolabs.io>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=dd19af47516e3fae43e7519a44d3cec57bbc213a
---

 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 41a78da1be..9cfd98cfa7 100644
--- a/modules/gui/qt/maininterface/mainui.cpp
+++ b/modules/gui/qt/maininterface/mainui.cpp
@@ -222,6 +222,7 @@ void MainUI::registerQMLTypes()
 
     qmlRegisterType<PlayerControlBarModel>( "org.videolan.vlc", 0, 1, "PlayerControlBarModel");
 
+    qRegisterMetaType<QmlMainContext*>();
     qmlRegisterType<QmlGlobalMenu>( "org.videolan.vlc", 0, 1, "QmlGlobalMenu" );
     qmlRegisterType<QmlMenuBar>( "org.videolan.vlc", 0, 1, "QmlMenuBar" );
     qmlRegisterType<NetworkMediaContextMenu>( "org.videolan.vlc", 0, 1, "NetworkMediaContextMenu" );



More information about the vlc-commits mailing list