<?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[Checkbox not working]]></title><description><![CDATA[<p dir="auto">When the checkbox is only checked, it does not selects the item. If it is checked as well as selected by mouse click, then it is selected. I want to remove the mouse selection. I just want to keep the selection through check box. Kindly help.</p>
<pre><code>void Dialog::on_pushButton_clicked()

{
     //Send Email

    QList&lt;QTreeWidgetItem *&gt; itemList;

    itemList = ui-&gt;treeWidget-&gt;selectedItems();
    QString strTo = "mailto:";

    foreach(QTreeWidgetItem *item, itemList)
    {
    // if(item-&gt;text(0)=="Organization")
    //     continue;

      if(item-&gt;checkState(0)== Qt::Checked)

        strTo.append(item-&gt;text(0)+";");

}
        openUrl-&gt;openUrl(QUrl(strTo));
}
</code></pre>
]]></description><link>https://forum.qt.io/topic/71801/checkbox-not-working</link><generator>RSS for Node</generator><lastBuildDate>Sat, 02 May 2026 20:36:16 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/71801.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 30 Sep 2016 14:35:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Checkbox not working on Fri, 30 Sep 2016 20:13:26 GMT]]></title><description><![CDATA[<p dir="auto">Hi! I'm not sure if I understood correctly what you want to do, so here are two suggestions: You can make all the items unselectable by setting the view's selection mode to <code>QAbstractItemView::NoSelection</code>. If you just want to deselect all items you can call <code>QAbstractItemView::clearSelection()</code>.</p>
]]></description><link>https://forum.qt.io/post/351197</link><guid isPermaLink="true">https://forum.qt.io/post/351197</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Fri, 30 Sep 2016 20:13:26 GMT</pubDate></item></channel></rss>