Important: Please read the Qt Code of Conduct -

How to pass 'QVariantMap' object of QVariantList from one .qml to another.qml on clicking a button?

  • We have 'handler' object which is been sent to qml using
    viewer.engine()->rootContext()->setContextProperty("handler", &handler);
    in main.cpp

    main.qml is able to make use of QVariantList - a collection of 'QVariantMap' objects by invoking a method of handler object through javascript. The items of QVariantList are used as dataModel for presenting UI in main.qml. When user clicks on one of the displayed items, the underlying dataModel is required to be sent to anothe .qml file. Is it possible to send one object from a .qml file to another by emitting a signal in first qml file and consuming it in another .qml file?

Log in to reply