<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Topics tagged with extendedselecti]]></title><description><![CDATA[A list of topics that have been tagged with extendedselecti]]></description><link>https://forum.qt.io/tags/extendedselecti</link><generator>RSS for Node</generator><lastBuildDate>Fri, 25 Sep 2026 14:00:07 GMT</lastBuildDate><atom:link href="https://forum.qt.io/tags/extendedselecti.rss" rel="self" type="application/rss+xml"/><pubDate>Invalid Date</pubDate><ttl>60</ttl><item><title><![CDATA[ExtendedSelection behaves incorrectly]]></title><description><![CDATA[<p dir="auto">I want to use ExtendedSelection with a tree.<br />
Therefore I added the row<br />
<code>view-&gt;setSelectionMode(QAbstractItemView::ExtendedSelection);</code><br />
to line 65 of mainwindow.cpp of the <a href="http://doc.qt.io/qt-5/qtwidgets-itemviews-editabletreemodel-example.html" target="_blank" rel="noopener noreferrer nofollow ugc">editabletreemodel example</a>.</p>
<p dir="auto">It behaves like this:<br />
I add a new child. It get's selected. I press shift + arrow down. Now the item below should be added to selection.<br />
But the item above get's added, too.</p>
<p dir="auto">The code to select the new row is <code>    view-&gt;selectionModel()-&gt;setCurrentIndex(model-&gt;index(0, 0, index), QItemSelectionModel::ClearAndSelect);</code></p>
<p dir="auto">I guess it behaves like this because the item above is somehow stored as the last selection.<br />
It would be great if we can solve this!</p>
<p dir="auto">You can download the <a href="http://cl.ly/aFfg/download/editabletreemodel.zip" target="_blank" rel="noopener noreferrer nofollow ugc">qt project</a> if you want to try yourself.</p>
]]></description><link>https://forum.qt.io/topic/52332/extendedselection-behaves-incorrectly</link><guid isPermaLink="true">https://forum.qt.io/topic/52332/extendedselection-behaves-incorrectly</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>