Qt World Summit: Register Today!

ExtendedSelection behaves incorrectly

  • I want to use ExtendedSelection with a tree.
    Therefore I added the row
    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.

Log in to reply