<?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[BeginRemoveRows makes index invalid after the first item removed]]></title><description><![CDATA[<p dir="auto">Hi there,</p>
<p dir="auto">I'm using a QList to store my data, and display it via QML.</p>
<p dir="auto">Just found that when I remove the first data, the index of the list will be invalid...</p>
<p dir="auto">For example, if I do:<br />
@<br />
int index = 0;<br />
beginRemoveRows(QModelIndex(), index, index);<br />
mylist.removeAt(index);<br />
endRemoveRows();<br />
@</p>
<p dir="auto">then if I try to get the first item of the list, it returns -1; the second one returns 0 ...</p>
<p dir="auto">Not sure if any one is seeing the same issue?</p>
]]></description><link>https://forum.qt.io/topic/6167/beginremoverows-makes-index-invalid-after-the-first-item-removed</link><generator>RSS for Node</generator><lastBuildDate>Tue, 05 May 2026 19:32:46 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/6167.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 26 May 2011 16:11:02 GMT</pubDate><ttl>60</ttl></channel></rss>