Skip to content
  • 0 Votes
    4 Posts
    365 Views
    sierdzioS

    @trusktr said in Auto re-run property bound code in C++ outside of a class?:

    @sierdzio Have a look at Solid.js. People are loving the dependency-tracking reactive patterns.

    What does that have to do with me? ;-)

    What is the Qt equivalent of moving state outside of a QML component and both:

    logging it when it changes rendering it inside two different compoments

    ?

    Typically this involves creating a C++ object which holds the state, has properties and signals etc. This solves both of your points nicely and keeps UI and logic nicely separated.

  • 0 Votes
    2 Posts
    304 Views
    sierdzioS

    @trusktr With property bindings in C++ the answer is easy: the inspiration were property bindings from QML :-) They came first (around 2007, back in Qt 4.7 days).

    And with QML I think the inspiration was just in the nature of this (by then) new language: QML is a declarative language so you need a mechanism to automatically update values when their components change.

    And since Qt had signals and slots since early days (early '90), it was quite straightforward to implement this using existing "backend" technology.