Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

Building a dynamic namespace for qml files (Qt.createQmlObject)

$
0
0
So I’d like to dynamically load a qml from a string with “Qt.createQmlObject”. This works fine, if the loaded qml is independent, but what can I do, if the loaded qml depends on other qml files, which are also only avaible as a string? Is it possible to create some kind of namespace with a bunch of dynamic objects, so that they can access each others code? Example: File1.qml (from string): "import QtQuick 2.1 Rectangle {  anchors.fill: parent }"   File2.qml (from string): "import QtQuick 2.1 Rectangle {  File1 { //accessing code of File1.qml string    id: myFile1  } }"

Viewing all articles
Browse latest Browse all 4972

Latest Images

Trending Articles



Latest Images