<?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[Model view delegator]]></title><description><![CDATA[<p dir="auto">Hi everyone.<br />
I have created my own table model(QAbstractTableModel) and my delegator following the tutorial <a href="https://doc.qt.io/qt-5/modelview.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-5/modelview.html</a></p>
<p dir="auto">And it works fine except one thing. The first time my view shows the data from my model doesn't format the data because the delegator is not called. From my understanding the delegator is called when an item is edited. So, how could I displayed the data (as it is displayed when using delegator during edit role) the first time my view shows my data from the model?</p>
<p dir="auto">Thanks in advance</p>
]]></description><link>https://forum.qt.io/topic/111768/model-view-delegator</link><generator>RSS for Node</generator><lastBuildDate>Tue, 28 Apr 2026 10:45:01 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/111768.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 18 Feb 2020 16:46:03 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Model view delegator on Tue, 18 Feb 2020 18:03:51 GMT]]></title><description><![CDATA[<p dir="auto">Thank you very much. The displayText works for me.</p>
]]></description><link>https://forum.qt.io/post/578540</link><guid isPermaLink="true">https://forum.qt.io/post/578540</guid><dc:creator><![CDATA[medihech]]></dc:creator><pubDate>Tue, 18 Feb 2020 18:03:51 GMT</pubDate></item><item><title><![CDATA[Reply to Model view delegator on Tue, 18 Feb 2020 16:58:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/medihech">@<bdi>medihech</bdi></a> said in <a href="/post/578528">Model view dlegator</a>:</p>
<blockquote>
<p dir="auto">From my understanding the delegator is called when an item is edited.</p>
</blockquote>
<p dir="auto">Nope, it's also called by the paintEvent of the view</p>
<blockquote>
<p dir="auto">my model doesn't format the data because the delegator is not called</p>
</blockquote>
<p dir="auto">This is not the reason why. You are looking in the wrong place</p>
<blockquote>
<p dir="auto">So, how could I displayed the data (as it is displayed when using delegator during edit role)</p>
</blockquote>
<p dir="auto">reimplement <code>QStyledItemDelegate::displayText</code> or, if it's not enough,  <code>QAbstractItemDelegate::paint</code></p>
]]></description><link>https://forum.qt.io/post/578530</link><guid isPermaLink="true">https://forum.qt.io/post/578530</guid><dc:creator><![CDATA[VRonin]]></dc:creator><pubDate>Tue, 18 Feb 2020 16:58:24 GMT</pubDate></item></channel></rss>