Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Building a dynamic namespace for qml files (Qt.createQmlObject)
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 597 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DerMas
    wrote on last edited by
    #1

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

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved