<?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[QTreeView&#x2F;QAbstractItemModel with Checkbox&#x2F;Text]]></title><description><![CDATA[<p dir="auto">I have a QTreeView displaying data that is checkable, but I would like to be able to separate a click on the checkbox and a double click on the text.  Double clicking will only check/uncheck the checkbox.  I can't quite seem to figure out how to go about doing this.  My work around was to create 2 columns and have the checkbox in one column and the text in the second column however this creates a problem where the more children there are the further away the collapse/expand icons with the checkbox are from the text/2nd column, and therefore making the QTreeView needing to be much wider than necessary to contain the data.</p>
<p dir="auto">Any suggestions?</p>
]]></description><link>https://forum.qt.io/topic/47027/qtreeview-qabstractitemmodel-with-checkbox-text</link><generator>RSS for Node</generator><lastBuildDate>Fri, 09 Oct 2026 22:30:59 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/47027.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 14 Oct 2014 13:18:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QTreeView&#x2F;QAbstractItemModel with Checkbox&#x2F;Text on Tue, 14 Oct 2014 13:26:20 GMT]]></title><description><![CDATA[<p dir="auto">Take a look at this <a href="http://qt-project.org/wiki/QSortFilterProxyModel_subclass_to_add_a_checkbox" target="_blank" rel="noopener noreferrer nofollow ugc">http://qt-project.org/wiki/QSortFilterProxyModel_subclass_to_add_a_checkbox</a>.<br />
but I have not used the ceckbox . I preferred to use the selected when I click . To select all the children I have created a recursive function that I select all the children of a folder.<br />
However if you want to use the ceckbox check here :<br />
<a href="http://qt-project.org/wiki/QSortFilterProxyModel_subclass_to_add_a_checkbox" target="_blank" rel="noopener noreferrer nofollow ugc">http://qt-project.org/wiki/QSortFilterProxyModel_subclass_to_add_a_checkbox</a></p>
]]></description><link>https://forum.qt.io/post/247492</link><guid isPermaLink="true">https://forum.qt.io/post/247492</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Tue, 14 Oct 2014 13:26:20 GMT</pubDate></item></channel></rss>