Results 1 to 2 of 2

Thread: Create multiple instances of qml object

  1. #1
    Join Date
    Dec 2018
    Posts
    2
    Qt products
    Qt5

    Default Create multiple instances of qml object

    Hello,

    In my programm, the user can create Objects in the GUI during runtime, which are created from a QML file with a javascript.
    After creation the user can change the properties of this qml object, like size, position, color etc..

    My target is now, to store these changed properties and the QML Objects, so they are automatically recreated after programm start.

    Any ideas how to solve this?

    regards

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Create multiple instances of qml object

    Instead of creating these objects in JavaScript you create a model that contains each item's data.

    Then use for example a Repeater to create the items visually.

    The model can then save and load its state anytime you'd like.

    Cheers,
    _

Similar Threads

  1. Replies: 3
    Last Post: 24th August 2015, 22:51
  2. Replies: 2
    Last Post: 19th October 2011, 10:30
  3. Multiple instances of QWebView
    By darious in forum Qt Programming
    Replies: 1
    Last Post: 11th October 2011, 08:55
  4. Multiple program instances
    By scwizard in forum Qt Programming
    Replies: 13
    Last Post: 1st April 2007, 18:42
  5. Signal-Slot, object instances
    By ct in forum Qt Programming
    Replies: 3
    Last Post: 16th February 2006, 20:08

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.