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

Property declaration globally



  • I would like to access the property in all the components, I have property real ropacity:0 but I am unable to access the ropacity in my Component Item, it says it is not a valid property.
    Thanks in advance


  • Moderators

    Add it to root context in C++.
    @
    // Typing from memory, actual code might need to be adjusted:
    QQuickView::rootContext()->setContextProperty("propertyName", andHereYourValue);
    @


Log in to reply