<?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[Question about setting Push button background color]]></title><description><![CDATA[<p dir="auto">Hi, Im setting my push button background color by:</p>
<pre><code>ui-&gt;colorPushButton-&gt;setStyleSheet("QPushButton { background-color : blue }");
</code></pre>
<p dir="auto">The color changes only when I press the button, and changes back when my click releases. How to change the background color even I don't touch the button? Thanks.<br />
<img src="https://ddgobkiprc33d.cloudfront.net/26bda4de-4da2-415b-bfd3-0e235617eeee.png" alt="Screenshot from 2022-07-29 17-08-22.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.qt.io/topic/138254/question-about-setting-push-button-background-color</link><generator>RSS for Node</generator><lastBuildDate>Sat, 07 Nov 2026 04:28:03 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/138254.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 29 Jul 2022 10:03:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Question about setting Push button background color on Sat, 30 Jul 2022 15:26:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/joecfd">@<bdi>JoeCFD</bdi></a> if not pressed, it is just like the default push button color, grey? <a class="plugin-mentions-user plugin-mentions-a" href="/user/mrjj">@<bdi>mrjj</bdi></a> 's method solved my problem.</p>
]]></description><link>https://forum.qt.io/post/723316</link><guid isPermaLink="true">https://forum.qt.io/post/723316</guid><dc:creator><![CDATA[dalishi]]></dc:creator><pubDate>Sat, 30 Jul 2022 15:26:29 GMT</pubDate></item><item><title><![CDATA[Reply to Question about setting Push button background color on Sat, 30 Jul 2022 15:25:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mrjj">@<bdi>mrjj</bdi></a> Hi you solution works like a charm! Thanks bro.</p>
]]></description><link>https://forum.qt.io/post/723315</link><guid isPermaLink="true">https://forum.qt.io/post/723315</guid><dc:creator><![CDATA[dalishi]]></dc:creator><pubDate>Sat, 30 Jul 2022 15:25:12 GMT</pubDate></item><item><title><![CDATA[Reply to Question about setting Push button background color on Fri, 29 Jul 2022 15:38:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dalishi">@<bdi>dalishi</bdi></a> said in <a href="/post/723184">Question about setting Push button background color</a>:</p>
<blockquote>
<p dir="auto">setStyleSheet("QPushButton { background-color : blue }");</p>
</blockquote>
<p dir="auto">Not sure about your question. The setting seems OK. What is the color on your machine when the button is not pressed?<br />
On my machine, the color is same as yours. It becomes a bit darker when the button is pressed.</p>
]]></description><link>https://forum.qt.io/post/723245</link><guid isPermaLink="true">https://forum.qt.io/post/723245</guid><dc:creator><![CDATA[JoeCFD]]></dc:creator><pubDate>Fri, 29 Jul 2022 15:38:54 GMT</pubDate></item><item><title><![CDATA[Reply to Question about setting Push button background color on Fri, 29 Jul 2022 11:45:21 GMT]]></title><description><![CDATA[<p dir="auto">Hi<br />
The part of the code that draws the frame/border doesn't use the background color for the background.<br />
the trick is to remove the border and then it shows</p>
<pre><code>QPushButton { 
 border:  none;
background-color : blue;
}
</code></pre>
<p dir="auto"><img src="https://imagizer.imageshack.com/img924/4826/YTq3Lh.png" alt="alt text" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.qt.io/post/723207</link><guid isPermaLink="true">https://forum.qt.io/post/723207</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Fri, 29 Jul 2022 11:45:21 GMT</pubDate></item></channel></rss>