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. QML does deep copy for QVariantMap

QML does deep copy for QVariantMap

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 661 Views
  • 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.
  • E Offline
    E Offline
    equeim
    wrote on last edited by
    #1

    In my code I need to pass data in QByteArray and QVariantMap types between objects that are instaniated in QML. I do it by declaring Q_PROPERTY inside object with data and calling a Q_INVOKABLE method of another object. It works fast with QByteArray because of implicit sharing, but I discovered that for QVariantMap QML does deep copy instead of shallow. I solved it by passing a QObject pointer and calling getter method in C++ code. However I wonder if there is a better way to do this?

    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