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
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.