Forums

OverviewV-Play 2 Support (Qt 5) › What do you do when you need to pass big data between qml and c++

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #14467

    NgapWei

    As far as I know, QVariantList and QVariantMap can convert to js array and js object, but that mean

    qml part need to copy the data of js to c++, and c++ need to copy the data of js back to the qml. For small data,

    this is not a problem. What if the data is quite big?Like millions of data need to process by c++ and display by the TableView of qml

    Anyway to avoid copy but passing reference between c++ and qml?Thanks

    #14471

    Günther
    V-Play Team

    Hi,

    I am not sure if there is a way to avoid converting QML/C++ types when passing data between QML and C++.
    But I guess you can create a custom ListModel based on QAbstractListModel and use it as the model for your QML view. This way the view can only access the visible/relevant parts of your data through the list model without having to pass huge arrays.

    This is just a guess though, I recommend to maybe ask about this in the official qt forums.
    I’m sure they can provide better and more detailed answers there.

    Best,
    Günther

Viewing 2 posts - 1 through 2 (of 2 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support