Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Blog Post about Creating QML Properties Dynamically at Runtime from C++



  • Hello, fellow Qt Coders,

    I know this is not part of how the QML language is designed. But sometimes it useful to create QML properties at runtime. An example for such a need is, for example, the Qt SCXML state machine for QML, which relies on this feature.

    Since I could not find a good explanation on how to do this, I created a write-up for three possible approaches. Using QMetaObject is my favorite.

    https://machinekoder.com/creating-qml-properties-dynamically-runtime-c/

    Please let me know if I overlooked something.

    Cheers,
    Alex


Log in to reply