Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to pass 'QVariantMap' object of QVariantList from one .qml to another.qml on clicking a button?
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 924 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    LakshmiSaripella
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved