<?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[Tooltip background?]]></title><description><![CDATA[<p dir="auto">I've set a tooltip on a QDockWidget title bar widget (a QLabel).    The label has a gradient as a background. The tooltip is displayed with a background that seems to be derived from the background I specified for the label but it renders the tip very hard to read.</p>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/bba6f78b-7f3d-44bc-9392-ae56ef79ccd2.png" alt="6040c0d2-cf57-4246-9e23-2793e9bf7ded-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">How can I get the tooltip to display without that background it has invented for itself (or with the same one as the label)?</p>
<p dir="auto">Thanks D.</p>
]]></description><link>https://forum.qt.io/topic/139991/tooltip-background</link><generator>RSS for Node</generator><lastBuildDate>Sat, 07 Nov 2026 06:53:00 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/139991.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 11 Oct 2022 14:39:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Tooltip background? on Tue, 11 Oct 2022 15:24:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/perdrix">@<bdi>Perdrix</bdi></a> How do you set a gradient for the label? Through a palette brush, stylesheet, custom paint? If it's through a stylesheet it's just a question of scoping it to the label only.<br />
For example if you do <code>"color: red"</code> it will apply to the widget and all its children, including the tooltip, but if you do <code>"QLabel { color: red }"</code> it will only apply to the label or <code>"QToolTip { color: red }"</code> only to the tooltip.</p>
]]></description><link>https://forum.qt.io/post/732286</link><guid isPermaLink="true">https://forum.qt.io/post/732286</guid><dc:creator><![CDATA[Chris Kawa]]></dc:creator><pubDate>Tue, 11 Oct 2022 15:24:28 GMT</pubDate></item><item><title><![CDATA[Reply to Tooltip background? on Tue, 11 Oct 2022 15:46:28 GMT]]></title><description><![CDATA[<p dir="auto">That was it!  Changing the code to read:</p>
<pre><code>dockTitle-&gt;setStyleSheet(QString::fromUtf8("QLabel {"
	"background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, "
	"stop:0 rgba(138, 185, 242, 0), stop:1 rgba(138, 185, 242, 255))}"));
</code></pre>
<p dir="auto">solved the problem.</p>
<p dir="auto">Big thank you!<br />
D.</p>
]]></description><link>https://forum.qt.io/post/732292</link><guid isPermaLink="true">https://forum.qt.io/post/732292</guid><dc:creator><![CDATA[Perdrix]]></dc:creator><pubDate>Tue, 11 Oct 2022 15:46:28 GMT</pubDate></item><item><title><![CDATA[Reply to Tooltip background? on Tue, 11 Oct 2022 15:24:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/perdrix">@<bdi>Perdrix</bdi></a> How do you set a gradient for the label? Through a palette brush, stylesheet, custom paint? If it's through a stylesheet it's just a question of scoping it to the label only.<br />
For example if you do <code>"color: red"</code> it will apply to the widget and all its children, including the tooltip, but if you do <code>"QLabel { color: red }"</code> it will only apply to the label or <code>"QToolTip { color: red }"</code> only to the tooltip.</p>
]]></description><link>https://forum.qt.io/post/732286</link><guid isPermaLink="true">https://forum.qt.io/post/732286</guid><dc:creator><![CDATA[Chris Kawa]]></dc:creator><pubDate>Tue, 11 Oct 2022 15:24:28 GMT</pubDate></item></channel></rss>