[vlc-devel] [PATCH 03/27] qt: register QmlMainContext* as a meta-type

Fatih Uzunoglu fuzun54 at outlook.com
Fri Dec 4 00:01:38 CET 2020


in some cases qml fails to access QmlMainContext* property when it is not registered as a meta-type.
---
 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" );
-- 
2.27.0



More information about the vlc-devel mailing list