<?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[How to decouple a QStandardItemMode from a QTableView?]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">How to decouple a QStandardItemMode from a QTableView? I tried it as below:</p>
<pre><code>myTableView-&gt;setModel(myModel);
...
myTableView-&gt;setModel(NULL);  //decoupled here
...
myTableView-&gt;setModel(myModel);  //reset model after some work is done.
</code></pre>
<p dir="auto">It caused a strange phenomenon: After reset the model, the signal QStandardItemModel::itemchanged is always triggered twice when I edit the model data. I'm confused... Anyone can give me a hint please? Many thanks.</p>
]]></description><link>https://forum.qt.io/topic/139445/how-to-decouple-a-qstandarditemmode-from-a-qtableview</link><generator>RSS for Node</generator><lastBuildDate>Mon, 09 Nov 2026 11:02:48 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/139445.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 20 Sep 2022 09:04:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to decouple a QStandardItemMode from a QTableView? on Tue, 20 Sep 2022 09:33:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lee908">@<bdi>Lee908</bdi></a><br />
<code>setModel(nullptr)</code> should indeed remove the <code>QTableView</code> from having slots attached to the <code>QStandardItemModel</code>, and <code>setModel(myModel)</code> again should set it to receive signals anew, without "doubling".  However, "the signal QStandardItemModel::itemchanged is always triggered twice": attaching a view to a model connects its slots to model signals, it should not have <em>anything</em> to do with how many times any <em>signals</em> are triggered, which is a model-only thing.</p>
<p dir="auto">Can you reproduce this behaviour in a small, standalone sample?</p>
]]></description><link>https://forum.qt.io/post/729446</link><guid isPermaLink="true">https://forum.qt.io/post/729446</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Tue, 20 Sep 2022 09:33:42 GMT</pubDate></item></channel></rss>