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



  • 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
    }
    }"@


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.