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. ExtendedSelection behaves incorrectly

ExtendedSelection behaves incorrectly

Scheduled Pinned Locked Moved General and Desktop
extendedselecti
1 Posts 1 Posters 546 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.
  • T Offline
    T Offline
    Tamriel
    wrote on last edited by
    #1

    I want to use ExtendedSelection with a tree.
    Therefore I added the row
    view->setSelectionMode(QAbstractItemView::ExtendedSelection);
    to line 65 of mainwindow.cpp of the editabletreemodel example.

    It behaves like this:
    I add a new child. It get's selected. I press shift + arrow down. Now the item below should be added to selection.
    But the item above get's added, too.

    The code to select the new row is view->selectionModel()->setCurrentIndex(model->index(0, 0, index), QItemSelectionModel::ClearAndSelect);

    I guess it behaves like this because the item above is somehow stored as the last selection.
    It would be great if we can solve this!

    You can download the qt project if you want to try yourself.

    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