<?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[Where does role variable for setData() functions get determined? (for debugging)]]></title><description><![CDATA[<p dir="auto">Please correct me if i'm wrong. From what i've figured out so far, it seems to me that the Qt::ItemFlags returned by the flags() function determine the role for the setData() function. As a result setData() not receiving Qt::CheckStateRole indicates that something's wrong with the flags() function. Is this correct?</p>
<p dir="auto">If so, how could i possibly debug this.</p>
]]></description><link>https://forum.qt.io/topic/126724/where-does-role-variable-for-setdata-functions-get-determined-for-debugging</link><generator>RSS for Node</generator><lastBuildDate>Mon, 29 Jun 2026 10:09:27 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/126724.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 17 May 2021 14:50:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Where does role variable for setData() functions get determined? (for debugging) on Mon, 17 May 2021 15:26:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/christian-ehrlicher">@<bdi>Christian-Ehrlicher</bdi></a> Well, maybe I expressed myself a little bit clumsily, but it was indeed my implementation of the flags() function which caused the problem - a momentary lapse of reason, so to say. If i understand you correctly, then there's one more step involved: from flags() to data() to setData().</p>
]]></description><link>https://forum.qt.io/post/660106</link><guid isPermaLink="true">https://forum.qt.io/post/660106</guid><dc:creator><![CDATA[andi456]]></dc:creator><pubDate>Mon, 17 May 2021 15:26:07 GMT</pubDate></item><item><title><![CDATA[Reply to Where does role variable for setData() functions get determined? (for debugging) on Mon, 17 May 2021 15:11:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/andi456">@<bdi>andi456</bdi></a> said in <a href="/post/660099">Where does role variable for setData() functions get determined? (for debugging)</a>:</p>
<blockquote>
<p dir="auto">result setData() not receiving Qt::CheckStateRole indicates that something's wrong with the flags() function. Is this correct?</p>
</blockquote>
<p dir="auto">No. Flags don't have something to do with setData().</p>
<p dir="auto">When you want to have a user-checkable checkbox in your view, flags() has to return Qt::ItemIsUserCheckable and data() should return something meaningful for Qt::CheckStateRole.</p>
]]></description><link>https://forum.qt.io/post/660101</link><guid isPermaLink="true">https://forum.qt.io/post/660101</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Mon, 17 May 2021 15:11:35 GMT</pubDate></item></channel></rss>