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. Negative index when changing MapViewItem model
Forum Updated to NodeBB v4.3 + New Features

Negative index when changing MapViewItem model

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

    Hello,

    I have a MapItemView that uses a model to plot things on my map :
    The model is a QStringList updated by the c++ part of my UI. The code works but a lot of errors are printed when running and updating this model. When printing the index, sometimes, it is equal to -1 and it's the times it gets an error...

    Do you know why ?

    MapItemView {
    id:drone_target_repeater
    model: nodeManager.missionManager.all_drone_ids
    delegate: DroneMapItem {
    property var coord:nodeManager.formationManager.getgeographicCoordinateReference
    property var drone_position: nodeManager.droneStatus.navigation_data_position_geo // to adapt when many drones !
    coordinate: QtPositioning.coordinate(coord[0]+drone_position[0]+0.0001*index,coord[1]+drone_position[1])
    droneIDstring: nodeManager.missionManager.all_drone_ids[index]
    target : false
    visible: index == -1 ? 0 : 1
    }
    }

    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