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. ListView select newly added item
Forum Updated to NodeBB v4.3 + New Features

ListView select newly added item

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

    I'm having issues selecting the most recently added item but am experiencing some issues. I expected that I'd be able to simply set the ListView's currentIndex property in the onAdd attached handler but that doesn't appear to be working. Interestingly, if I add an item AFTER the currently selected item, everything works fine and the new item becomes the currentIndex item. However if the new item is inserted BEFORE the currently selected item, the onAdd handler gets called and the currentIndex property gets set (I can see this happening via the onCurrentIndexChanged handler as well) but something else is coming through and setting the currentIndex property back to what it was before. I can't figure out why this is changing or even how to figure out what is changing the currentIndex property. Any ideas or debugging suggestions would be greatly appreciated!

    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