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. Maintaining Dynamic QML
Qt 6.11 is out! See what's new in the release blog

Maintaining Dynamic QML

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
6 Posts 3 Posters 2.6k 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.
  • A Offline
    A Offline
    Amr_MKamal
    wrote on last edited by A Former User
    #1

    Hello, I'm using dynamic object creation with qt.createqmlobject to enable some kind of configurable UI. Basically the user of the UI can create objects to make their own custom "GUI" from my GUI which is basically their interface. I am able to create a custom GUI using the interface I have created, but when my interface shuts down, the custom "GUI" that was created by the user does not persist. I would like to be able to save the objects they have configured so that they can open their own custom created GUI (which was created using my interface) when my interface is not running. Is there a way of saving the objects they have created in some sort of file (maybe XML) so that their "GUI" can be dynamically created without the use of my interface?

    1 Reply Last reply
    0
    • Pablo J. RoginaP Offline
      Pablo J. RoginaP Offline
      Pablo J. Rogina
      wrote on last edited by
      #2

      @Amr_MKamal not having used Qt createqmlobject feature so far, I'd say save your custom GUI components as QML files (.qml and QML syntax) given the example found in the feature documentation. As suggested in this wiki page "...Practically it is inconvenient to supply a long QML string in createQmlObject() call", you may want to keep several small files (i.e. per component) instead of a big one (per whole custom GUI).

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

      A 1 Reply Last reply
      0
      • ODБOïO Offline
        ODБOïO Offline
        ODБOï
        wrote on last edited by
        #3

        @Amr_MKamal Hello,

        You mean create custom GUI : writing qml code ? or selecting objects in a list and just placing / customizing and saving to be able to load it after restarting your program ?

        @Amr_MKamal said in Maintaining Dynamic QML:

        I would like to be able to save the
        objects they have configured so that they can open their own custom created
        GUI (which was created using my interface) when my interface is not
        running

        How will the user start his GUI without starting your interface ? Do you want to generate another "userGUI.exe" ?

        LA

        A 1 Reply Last reply
        0
        • Pablo J. RoginaP Pablo J. Rogina

          @Amr_MKamal not having used Qt createqmlobject feature so far, I'd say save your custom GUI components as QML files (.qml and QML syntax) given the example found in the feature documentation. As suggested in this wiki page "...Practically it is inconvenient to supply a long QML string in createQmlObject() call", you may want to keep several small files (i.e. per component) instead of a big one (per whole custom GUI).

          A Offline
          A Offline
          Amr_MKamal
          wrote on last edited by
          #4

          @Pablo-J.-Rogina Thanks , but long or short string , my question is how to maintain these objects

          1 Reply Last reply
          0
          • ODБOïO ODБOï

            @Amr_MKamal Hello,

            You mean create custom GUI : writing qml code ? or selecting objects in a list and just placing / customizing and saving to be able to load it after restarting your program ?

            @Amr_MKamal said in Maintaining Dynamic QML:

            I would like to be able to save the
            objects they have configured so that they can open their own custom created
            GUI (which was created using my interface) when my interface is not
            running

            How will the user start his GUI without starting your interface ? Do you want to generate another "userGUI.exe" ?

            LA

            A Offline
            A Offline
            Amr_MKamal
            wrote on last edited by
            #5

            @LeLev I mean using pre-coded objects and placing / customizing adding or deleting them and be able to load them after restarting , I don't want to start another interface but for the sake of the argument what if I do , how will that be possible , the main idea is transforming the dynamically created objects to a separate static page for say and be able to redo the process

            ODБOïO 1 Reply Last reply
            0
            • A Amr_MKamal

              @LeLev I mean using pre-coded objects and placing / customizing adding or deleting them and be able to load them after restarting , I don't want to start another interface but for the sake of the argument what if I do , how will that be possible , the main idea is transforming the dynamically created objects to a separate static page for say and be able to redo the process

              ODБOïO Offline
              ODБOïO Offline
              ODБOï
              wrote on last edited by ODБOï
              #6

              @Amr_MKamal Ok, so the user will select pre-coded configurable objects and construct his GUI.
              To be able to reload that config, you can use : Local Storage QML Type or also Settings QML Type, you can also save your config in .txt file and load it with XMLHttpRequest

              Settings : http://doc.qt.io/qt-5/qml-qt-labs-settings-settings.html
              Local Storage : http://doc.qt.io/qt-5/qtquick-localstorage-qmlmodule.html

              LA

              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