[Interest] Qml Script current script uri

Jérôme Godbout jerome at bodycad.com
Thu Jul 2 17:29:03 CEST 2015


Hi,
Is there a way to known the current script uri (ex: inside A.qml to known
if the script is inside a resource qrc:/Prefix/A.qml or is inside a folder
execPath/Prefix/A.qml)?

QFile need a relative path to executable or an absolute path. Currently,
the script knew the relative path to himself, not the executable. I need a
bridge between both.

As up to now, the module knew it's relative path to executable with a
singleton variable that tell where the script module was located into the
file tree. So we could call a Q_INVOKABLE function and reconstruct a path
that C++ could work with. But if we package resource and have some .qml
script as file at the same time, it's either one or the other and I change
the variable with a flag or environment variable at application launch.

Thanks,
Jerome
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150702/5b2c9005/attachment.html>


More information about the Interest mailing list