<?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 set tooltip for only QIcon which is inside QTreeWidgetIteam?]]></title><description><![CDATA[<p dir="auto">In QTreeWidgetIteam have two different elements. QIcon and QLebel.<br />
If we set the tool tip like below, then it will give the tooltip to the entire cell  of QTreeWidgetIteam.</p>
<pre><code>pTreeWidgetItem-&gt;setToolTip(ColNum, "Tooltip Text");
</code></pre>
<p dir="auto">I have to set the tooltip only on the Icon inside QTreeWidgetIteam.<br />
How to achieve this?</p>
<p dir="auto">Let me know If there is any query on this question.</p>
]]></description><link>https://forum.qt.io/topic/140435/how-to-set-tooltip-for-only-qicon-which-is-inside-qtreewidgetiteam</link><generator>RSS for Node</generator><lastBuildDate>Sat, 16 May 2026 02:01:43 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/140435.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 31 Oct 2022 11:45:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to set tooltip for only QIcon which is inside QTreeWidgetIteam? on Wed, 02 Nov 2022 04:19:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a><br />
I'm using for ICON    qTreeWidgetItems-&gt;setIcon(COLUMN_NO, QIcon(statusIconRes)); And for text I'm are using<br />
qTreeWidgetItems-&gt;setData();</p>
]]></description><link>https://forum.qt.io/post/734779</link><guid isPermaLink="true">https://forum.qt.io/post/734779</guid><dc:creator><![CDATA[bhvn]]></dc:creator><pubDate>Wed, 02 Nov 2022 04:19:28 GMT</pubDate></item><item><title><![CDATA[Reply to How to set tooltip for only QIcon which is inside QTreeWidgetIteam? on Mon, 31 Oct 2022 12:33:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bhvn">@<bdi>bhvn</bdi></a><br />
Hello and welcome.</p>
<p dir="auto">I think this will be tricky, no easy way to do it.  I can only see overriding the whole <code>QTreeWidget</code>'s <code>event(QEvent *event)</code> and doing your own calculations for the mouse position to decide whether to show or ignore.  See <a href="https://doc.qt.io/qt-6/qtwidgets-widgets-tooltips-example.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-6/qtwidgets-widgets-tooltips-example.html</a> for inspiration.  But I don't think you can even discover the icon's position.</p>
<p dir="auto">Meanwhile, I do not understand</p>
<blockquote>
<p dir="auto">In QTreeWidgetIteam have two different elements. QIcon and QLebel.</p>
</blockquote>
<p dir="auto"><code>QTreeWidgetItem</code>s do not have widgets like <code>QIcon</code> or <code>QLabel</code>, maybe you are using <a href="https://doc.qt.io/qt-6/qtreewidget.html#setItemWidget" target="_blank" rel="noopener noreferrer nofollow ugc">QTreeWidget::setItemWidget()</a>.  You do not explain.  But in such a case can't you set the tooltip on whatever widget you are placing there if you only want it to apply to that widget?</p>
]]></description><link>https://forum.qt.io/post/734599</link><guid isPermaLink="true">https://forum.qt.io/post/734599</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Mon, 31 Oct 2022 12:33:53 GMT</pubDate></item></channel></rss>