<?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[Qt Designer - Global Stylesheet]]></title><description><![CDATA[<p dir="auto">Hello, I have created an app and I read several places that Qt Designer supports global stylesheets instead of making the stylesheet on each object.<br />
My problem is that I cannot get this to work.<br />
For example if i call a QPushButton that is inside a QFrame, it doesn't add the styling.<br />
<code>QFrame{ 	border: 0px solid black; 	border-radius: 10px; 	background: rgb(127, 127, 127); } QPushButton{ 	top: 200px; 	background: pink; }</code><br />
The biggest reason I would like this to work, is because else I am not able to create my program like I want it. I want to when I hover a button, that another button changes color.<br />
Like this:<br />
<code>QPushButton#Achievement:hover + QPushButton#Achievement2{ 	background: rgb(232, 232, 232); 	color: rgb(104, 104, 104); }</code></p>
<p dir="auto">But this clearly doesn't work too, as I cannot call any other objects inside the stylesheets for a specific object.</p>
<p dir="auto">So where do I find the global stylesheet so I can make the above hover work?</p>
]]></description><link>https://forum.qt.io/topic/53798/qt-designer-global-stylesheet</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Apr 2026 17:55:09 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/53798.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 30 Apr 2015 09:26:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Qt Designer - Global Stylesheet on Thu, 30 Apr 2015 13:37:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/uruloke">@<bdi>uruloke</bdi></a></p>
<p dir="auto">hey there,<br />
you can create a "dummy" widget in Designer, add stylesheet to it in designer, then use this widget stylesheet in the code like this to have a clean 1 line setStyleSheet()</p>
<pre><code>// App Stylesheet (hack so I can type stylesheet in designer instead of source code)
Z_StyleSheet styleSheetDummy;
app.setStyleSheet(styleSheetDummy.styleSheet());
</code></pre>
]]></description><link>https://forum.qt.io/post/272178</link><guid isPermaLink="true">https://forum.qt.io/post/272178</guid><dc:creator><![CDATA[maximus]]></dc:creator><pubDate>Thu, 30 Apr 2015 13:37:39 GMT</pubDate></item><item><title><![CDATA[Reply to Qt Designer - Global Stylesheet on Thu, 30 Apr 2015 11:46:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sierdzio">@<bdi>sierdzio</bdi></a><br />
Thank you, that acutally works.<br />
Now I just have to port my whole program into python instead of in Pyqt designer...</p>
]]></description><link>https://forum.qt.io/post/272154</link><guid isPermaLink="true">https://forum.qt.io/post/272154</guid><dc:creator><![CDATA[uruloke]]></dc:creator><pubDate>Thu, 30 Apr 2015 11:46:16 GMT</pubDate></item><item><title><![CDATA[Reply to Qt Designer - Global Stylesheet on Thu, 30 Apr 2015 10:40:43 GMT]]></title><description><![CDATA[<p dir="auto">I think the API for PyQt and other ports is the same as for Qt itself. Just check out the documentation for QWidget's setStyleSheet() and QApplication's setStyleSheet()</p>
]]></description><link>https://forum.qt.io/post/272146</link><guid isPermaLink="true">https://forum.qt.io/post/272146</guid><dc:creator><![CDATA[sierdzio]]></dc:creator><pubDate>Thu, 30 Apr 2015 10:40:43 GMT</pubDate></item><item><title><![CDATA[Reply to Qt Designer - Global Stylesheet on Thu, 30 Apr 2015 10:37:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sierdzio">@<bdi>sierdzio</bdi></a><br />
Well yes ofc, It will later be used with Python.<br />
Just annoying to test my code out if I cannot do all the things in one place...</p>
<p dir="auto">But how do I use the set StyleSheet() with python? just to be sure how to use it correctly.</p>
]]></description><link>https://forum.qt.io/post/272145</link><guid isPermaLink="true">https://forum.qt.io/post/272145</guid><dc:creator><![CDATA[uruloke]]></dc:creator><pubDate>Thu, 30 Apr 2015 10:37:39 GMT</pubDate></item><item><title><![CDATA[Reply to Qt Designer - Global Stylesheet on Thu, 30 Apr 2015 10:27:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/uruloke">@<bdi>uruloke</bdi></a> said:</p>
<blockquote>
<p dir="auto">How do i call the setStyleSheet within QT Designer?</p>
</blockquote>
<p dir="auto">You can't, as far as I am aware. But your code <strong>will</strong> later be used in an application, right? And there you can set the stylesheet using setStyleSheet().</p>
]]></description><link>https://forum.qt.io/post/272144</link><guid isPermaLink="true">https://forum.qt.io/post/272144</guid><dc:creator><![CDATA[sierdzio]]></dc:creator><pubDate>Thu, 30 Apr 2015 10:27:09 GMT</pubDate></item><item><title><![CDATA[Reply to Qt Designer - Global Stylesheet on Thu, 30 Apr 2015 10:22:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sierdzio">@<bdi>sierdzio</bdi></a><br />
As the title said, this is with QT Designer,<br />
How do i call the setStyleSheet within QT Designer?</p>
]]></description><link>https://forum.qt.io/post/272143</link><guid isPermaLink="true">https://forum.qt.io/post/272143</guid><dc:creator><![CDATA[uruloke]]></dc:creator><pubDate>Thu, 30 Apr 2015 10:22:07 GMT</pubDate></item><item><title><![CDATA[Reply to Qt Designer - Global Stylesheet on Thu, 30 Apr 2015 09:42:56 GMT]]></title><description><![CDATA[<p dir="auto">You can set the stylesheet for the whole application like using <a href="http://doc.qt.io/qt-5/qapplication.html#styleSheet-prop" target="_blank" rel="noopener noreferrer nofollow ugc">setStyleSheet</a>().</p>
<p dir="auto">If you set the style sheet for one widget, it will be automatically applied to all it's children.</p>
]]></description><link>https://forum.qt.io/post/272138</link><guid isPermaLink="true">https://forum.qt.io/post/272138</guid><dc:creator><![CDATA[sierdzio]]></dc:creator><pubDate>Thu, 30 Apr 2015 09:42:56 GMT</pubDate></item></channel></rss>