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. Livereload after file save but keep some objects
Qt 6.11 is out! See what's new in the release blog

Livereload after file save but keep some objects

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 665 Views
  • 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
    devel
    wrote on last edited by
    #1

    Livereload for development purposes: after save the application should reload the GUI entirely.

    But there are some C++ objects (used in QML code) that should stay and find themselves in the new version of the GUI.

    Possible approach is to such object a string property that will be the same in the newely-loaded QML code, so it'll attach to that. Obviously, the object has two parts: the QObject and Qt-independent implementation.

    There is a problem with that: the other bindings need such object to be already attached. These signals/properties mustn't arrive earlier.

    I'm thinking about setting that 'persist' property in the Component.onCompleted, so it'll be like atomic with the C++ constructor. Will it work? Other suggestions? How do you do it?

    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