Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Arrow Key navigation QTreeView

Arrow Key navigation QTreeView

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 460 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.
  • gde23G Offline
    gde23G Offline
    gde23
    wrote on last edited by
    #1

    Hello,
    I want to navigate in a QTreeView like it was a normal TableView.
    Therefore Key_up and Key_down events should trigger the selection to go to the same column of the previous or following row in the tree (like when the view is fully expanded ant the tree-structure is ignored).
    However the default event will do some strange things depending on if the current row has children it will trigger expand or collapse instead of moving the cursor.

    One way to achieve the behavior I want would be to reimplement the keyPressEvent and then manipulate the currentIndex of the model, however this is kind of complicated.
    Is there an easier way to achieve the desired behavior?

    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