My directory tree is like this:
root
assets
content
skins
default
test
main.cpp
root
assets
content
skins
default
test
main.cpp
To copy to clipboard, switch view to plain text mode
// I do this in test/main.cpp:
view.
engine()->setBaseUrl
(QUrl::fromLocalFile(
// I do this to a QQuickView instance:
setSource
(QUrl::fromLocalFile("skins/default/main.qml"));
// I do this in test/main.cpp:
view.engine()->setBaseUrl(QUrl::fromLocalFile(
QCoreApplication::applicationDirPath() + "/../"));
// I do this to a QQuickView instance:
setSource(QUrl::fromLocalFile("skins/default/main.qml"));
To copy to clipboard, switch view to plain text mode
main.qml loads OK, but cannot reference assets in the assets subdirectory as, "assets/someimage.png", but needs to do "../../assets/someimage.png", also I cannot import as 'import "content"', but need to do 'import "../../content"', whereas I'd like to do 'import "content"'. Does there exist a workaround?
Bookmarks