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 model navigation with keyboard problem
Qt 6.11 is out! See what's new in the release blog

ListView model navigation with keyboard problem

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 459 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
    sancelot
    wrote on last edited by sancelot
    #1

    Hi,

    Regarding this listview of texfields
    Capture1604.JPG
    I am using ListModel index delegate to scroll down between Textfields in my listview , forcing listView.currentIndex = indexOfDelegate

    This is done using this func in the TextField :

    Keys.onDownPressed:
    {
    if (indexOfThisDelegate < listView.count -1)
    {
    listView.currentIndex = indexOfThisDelegate + 1
    }
    }

    This works perfectly with the inital static ListModel provided.

    Then, thanks to the "+" button, I can dynamically insert() a new element in the ListModel.

    BUT the scrolling down with keyboard does not work anymore, the new item seem being ignored, or disordered .

    I mean , after inserting line 1, between line 0 and 2, my focus goes down directly to line 2 hitting down key.
    for unkown reason, if I click on each line and print the model index, the model index itself seems accurate.

    this situation has not happened if I append() elements to the list (but this is not what I want :-( )

    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