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

Create some kind of context object



  • Hello,

    I would like to make some kind of context object. This object will contains properties that indicates in what page the user is, what component he is using, information about the user or any informations I will need to interract with something else.

    What is the best approach for this kind of things ? I'm used to this kind of object in the Web development but I'm not sure it is a good thing to do in Embedded with Qt/QML. If you have any suggestion I would be glad to have it.

    Thank you in advance


  • Moderators

    Use a QObject-derived class, written in C++, and pass it to QML engine as root context property.



  • I will do it that way ! It is a good idea
    Thanks


Log in to reply