Question About resource reference qml file from plugin dll
-
- I build one qml application, and put some qml into one plugin;
- using qt_add_qml_module, build qml in plugin into one module;
- plugin's build type is shared lib, in windows, build into dll file;
I want to know, how to using "qrc:/qt/qml/ModuleName/qml_dir/xxx.qml" to reference qml file buit in plugin dll?
thank you.
-
same question here: https://forum.qt.io/topic/65367/loading-qml-from-a-plugin-s-qrc
but no answer.I open plugin dll file using hex editor, I have found qml file's content is compiled into it.
now,
if I using module's component in main application's qml file, it's ok.
if I using engine.loadFromModule("ModuleName", "QmlFileName"), is ok.
but I want to use "ModuleName"/"QmlFileName" as QUrl, because I must keep compatible with old version.
so, could any body help me?
I don't want to use rcc to build rcc file, and register in main application, it's confused.
and for compatible, I cannot statically link plugin with main application.
thanks again. -
Is this issue resolved ? Can you show me the call you are trying to make & which is failing ? How are you trying to access & what is failing ? Give me sample on this.
-
@dheerendra
thank you for your replying.I write an demo to show this, pls help me
https://github.com/blazewater-gmail/DemoPlugin.git
an Extra module as independent plugin, will build to dynamic lib(dll), and qml file (Main.qml) will be embeded into ExtraPlugin.dll
in main application's main.cpp, import path (../plugins/)
but cannot using QUrl to reference
qrc:/qt/qml/Extra/Main.qml
;I tried, loadModule(from QT6.5) is OK
but I must keep compatiblility with QT6.3, so I cannot using
loadModule("Extra", "Main")
;likely in main application, cannot read url path from dll file?
-
@michael_su Did this issue resolved ?.
-
@michael_su Finally solved this. Let me know if you need help.