<?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[QListView loses data when QSqlTableModel submitAll() is called]]></title><description><![CDATA[<p dir="auto">Hey,</p>
<p dir="auto">I have QSortFilterProxyModel in a QListView:</p>
<pre><code>//mGermanFungusNameFilter = QSortFilterProxyModel
//mGermanNames = QSqlTableModel
//mGermanNameEditor = QListView
mGermanNameFilter-&gt;setSourceModel(mGermanNames);
mGermanNameEditor-&gt;setModel(mGermanNameFilter);
mGermanNameEditor-&gt;setModelColumn(1);
</code></pre>
<p dir="auto">If I have edited (updated) the data and then call <code>mGermanNames-&gt;submitAll()</code> via a QPushButton, all data disappears from the QListView.</p>
<p dir="auto">What have I forgotten? Can't QStyledItemDelegate handle a QSortFilterProxyModel? Or how do I write the data from a QSortFilerProxyModel back to the database (SQLITE)?</p>
<p dir="auto">Thanks for your help!</p>
]]></description><link>https://forum.qt.io/topic/139647/qlistview-loses-data-when-qsqltablemodel-submitall-is-called</link><generator>RSS for Node</generator><lastBuildDate>Thu, 05 Nov 2026 00:52:17 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/139647.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 28 Sep 2022 12:06:52 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QListView loses data when QSqlTableModel submitAll() is called on Wed, 28 Sep 2022 14:33:14 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> said in <a href="/post/730540">QListView loses data when QSqlTableModel submitAll() is called</a>:</p>
<blockquote>
<p dir="auto">I presume you are using OMS</p>
</blockquote>
<p dir="auto">Yes, you are right.</p>
<p dir="auto">The model had only 256 rows. With canFetchMore() and fetchMore() after submitAll() it works now.</p>
<p dir="auto">When I double click on the selected item I only have a small edit window (see picture). Is it possible to extend this to the whole length (like the blue bar)? And also adjust the height because part of the font is cut off....</p>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/2235beae-f2d4-40e8-ba13-abb691d6e496.png" alt="Bildschirmfoto vom 2022-09-28 16-15-14.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.qt.io/post/730555</link><guid isPermaLink="true">https://forum.qt.io/post/730555</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Wed, 28 Sep 2022 14:33:14 GMT</pubDate></item><item><title><![CDATA[Reply to QListView loses data when QSqlTableModel submitAll() is called on Wed, 28 Sep 2022 12:52:52 GMT]]></title><description><![CDATA[<p dir="auto">@Gabber<br />
<a href="https://doc.qt.io/qt-6/qsqltablemodel.html#submitAll" target="_blank" rel="noopener noreferrer nofollow ugc">bool QSqlTableModel::submitAll()</a>:</p>
<blockquote>
<p dir="auto">In <code>OnManualSubmit</code>, on success the model will be repopulated. Any views presenting it will lose their selections.</p>
</blockquote>
<p dir="auto">I presume you are using OMS.  Check <code>submitAll()</code> succeeded.  Check data got re-read.  Check how many rows in SQL source model now.  Check what filter is in QSFPM.  Check how many rows that has.  Check what your <code>QListView</code> is attached to, and how many rows it has.  Check QSFPM is still accessing QSTM, it should not need it but you can always do a refresh to make sure.  Find out where issue lies between QSTM, QSFPM &amp; QLV!</p>
]]></description><link>https://forum.qt.io/post/730540</link><guid isPermaLink="true">https://forum.qt.io/post/730540</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Wed, 28 Sep 2022 12:52:52 GMT</pubDate></item></channel></rss>