<?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[StyleSheet]]></title><description><![CDATA[<p dir="auto">Hello</p>
<p dir="auto">Why when I set stylesheet for my QPushButton:hover background, the background area is bigger than an actual QPushButton?</p>
<p dir="auto">My code:</p>
<pre><code>button-&gt;setStyleSheet("QPushButton:hover { background: Red;}");
</code></pre>
]]></description><link>https://forum.qt.io/topic/115137/stylesheet</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Apr 2026 10:47:49 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/115137.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 24 May 2020 14:45:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to StyleSheet on Sun, 31 May 2020 11:43:03 GMT]]></title><description><![CDATA[<p dir="auto">If you a better looking button with style sheets, you should take a look at the <a href="https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qpushbutton" target="_blank" rel="noopener noreferrer nofollow ugc">customizing QPushButton example</a> in the Qt Stylesheet reference.</p>
]]></description><link>https://forum.qt.io/post/598142</link><guid isPermaLink="true">https://forum.qt.io/post/598142</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Sun, 31 May 2020 11:43:03 GMT</pubDate></item><item><title><![CDATA[Reply to StyleSheet on Mon, 25 May 2020 20:09:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a></p>
<p dir="auto">widget.cpp:</p>
<pre><code>#include "widget.h"
#include "ui_widget.h"
#include &lt;QPushButton&gt;

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui-&gt;setupUi(this);

    auto button = new QPushButton(this);
    button-&gt;setStyleSheet("QPushButton:hover { background: Red;}");

}
</code></pre>
<p dir="auto">widget.h:</p>
<pre><code>#ifndef WIDGET_H
#define WIDGET_H

#include &lt;QWidget&gt;

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();

private:
    Ui::Widget *ui;
};
#endif // WIDGET_H
</code></pre>
<p dir="auto">main.cpp:</p>
<pre><code>#include "widget.h"

#include &lt;QApplication&gt;

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    Widget w;
    w.show();
    return a.exec();
}
</code></pre>
]]></description><link>https://forum.qt.io/post/596833</link><guid isPermaLink="true">https://forum.qt.io/post/596833</guid><dc:creator><![CDATA[privatepepper]]></dc:creator><pubDate>Mon, 25 May 2020 20:09:37 GMT</pubDate></item><item><title><![CDATA[Reply to StyleSheet on Mon, 25 May 2020 20:00:21 GMT]]></title><description><![CDATA[<p dir="auto">Can you provide a minimal compilable example ?</p>
]]></description><link>https://forum.qt.io/post/596831</link><guid isPermaLink="true">https://forum.qt.io/post/596831</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Mon, 25 May 2020 20:00:21 GMT</pubDate></item><item><title><![CDATA[Reply to StyleSheet on Mon, 25 May 2020 07:27:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a></p>
<p dir="auto">I am using Qt creator and my Qt version is 5.14.2<br />
My OS - MacOs Catalina</p>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/9bff4b6b-ea33-4cd9-9cc5-5407166f9aec.jpg" alt="100522474_1901850159946056_4610327412897480704_n.jpg" class=" img-fluid img-markdown" /></p>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/8a114fa3-befe-4e1c-9769-e0aece5ad112.jpg" alt="100923536_274199117067430_5968441431042293760_n.jpg" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.qt.io/post/596643</link><guid isPermaLink="true">https://forum.qt.io/post/596643</guid><dc:creator><![CDATA[privatepepper]]></dc:creator><pubDate>Mon, 25 May 2020 07:27:43 GMT</pubDate></item><item><title><![CDATA[Reply to StyleSheet on Sun, 24 May 2020 19:30:23 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">What version of Qt ?<br />
On what platform ?<br />
What are you getting ?<br />
Can you provide a minimal compilable example that shows that behaviour ?</p>
]]></description><link>https://forum.qt.io/post/596590</link><guid isPermaLink="true">https://forum.qt.io/post/596590</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Sun, 24 May 2020 19:30:23 GMT</pubDate></item></channel></rss>