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

signal from C++ with QML property



  • Hello,

    I have C++ class that have signal to show page in QML StackView.
    Now I need send some property to this page.

    C++ signal:

    void showPage(const QString & url, <????????> );
    

    QML:

        Connections {
               target: global_data
               function onShowPage(url,args) {
                   console.log("Showing page: "+url+" arg: "+args)
                   //pageStack.replace(url, {"name": "testing page"}) old implementation
                    pageStack.replace(url, args) //new implementation
               }
        }
    
    

    Is there any option how to do this?
    Thank you


  • Moderators

    Try QVariantMap, QML should understand it.


  • Moderators

    Try QVariantMap, QML should understand it.



  • Thank you, you are right!!!
    I donť know why, but i tried QQmlProperty....
    QVariantMap didn't think of that

    Tnank you!


Log in to reply