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. Child positions reset when adding items to Repeater model

Child positions reset when adding items to Repeater model

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

    I'm creating a Graph editor operating on a model in c++

    I'm using a Repeater with a QQmlListProperty as its model:

    @Item {
    id:contents
    Repeater {
    model: graph.modules
    Node {
    module: modelData
    }
    }
    }@

    !http://i.imgur.com/GUGd5Q6.png!

    The nodes can be dragged around and connected to each other, but after adding another node to the list, all the positions and other properties get reset, and they will jumble up in the corner.

    !http://i.imgur.com/H0Hhx5r.png!

    How can I avoid this? Do I have to implement my own repeater like class?

    EDIT: I have looked at the source for repeater, and it appears that regenerate is called whenever the list is changed. Guess I'll have to roll my own custom solution then...

    Here's the source, btw: https://qt.gitorious.org/qt/qtdeclarative/source/cad3ba5fd44c09455c2492548865a8743386ea18:src/quick/items/qquickrepeater.cpp

    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