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

SetContextProperty for imported qml



  • I am importing qmlB into qmlA.

    How can i get the contextPropertyObject to be used by qmlB? or any other qml that is nested inside qmlB?

    @
    //qmlA.qml

    Rectangle
    {
    width:100
    height:100

    qmlB
    {
    //ContextObject
    }

    }

    @



  • Which context property? Can you post some more code please? If you use setContextProperty() function in C++ you can just use the name you assign to that property anywhere in your qml files.


Log in to reply