Important: Please read the Qt Code of Conduct -

Livereload after file save but keep some objects

  • 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?

Log in to reply