<?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[PushButton spacing with Icon]]></title><description><![CDATA[<p dir="auto">Hello experts,</p>
<p dir="auto">I am trying to add a pushbutton with a iCon inside that changes on click ( Basically a toggle button behavior.).<br />
I prefer to make the icon taking the complete space of the button, so that it looks like a real switch-button. However some spacing appears in the button (after the icon's boundary) making it look ugly. How can I avoid this spacing of the button .</p>
<p dir="auto">Thanks in advance,<br />
A new-bee of QT</p>
]]></description><link>https://forum.qt.io/topic/115386/pushbutton-spacing-with-icon</link><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Apr 2026 08:13:11 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/115386.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 31 May 2020 10:03:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to PushButton spacing with Icon on Tue, 02 Jun 2020 01:57:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/hrishigobler">@<bdi>HrishiGobler</bdi></a> set style sheet to it</p>
<pre><code>setStyleSheet("border: none;");
</code></pre>
<p dir="auto">But it may affect some other styled appearance.</p>
]]></description><link>https://forum.qt.io/post/598418</link><guid isPermaLink="true">https://forum.qt.io/post/598418</guid><dc:creator><![CDATA[Bonnie]]></dc:creator><pubDate>Tue, 02 Jun 2020 01:57:05 GMT</pubDate></item><item><title><![CDATA[Reply to PushButton spacing with Icon on Tue, 02 Jun 2020 01:28:43 GMT]]></title><description><![CDATA[<p dir="auto">"QPushButton draw a border around the icon + some text." =&gt; Exactly this border is what I mean. Is there any way to avoid this border? I want the icon to completely fit the button without any border</p>
]]></description><link>https://forum.qt.io/post/598417</link><guid isPermaLink="true">https://forum.qt.io/post/598417</guid><dc:creator><![CDATA[HrishiGobler]]></dc:creator><pubDate>Tue, 02 Jun 2020 01:28:43 GMT</pubDate></item><item><title><![CDATA[Reply to PushButton spacing with Icon on Mon, 01 Jun 2020 15:02:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/hrishigobler">@<bdi>HrishiGobler</bdi></a> said in <a href="/post/598331">PushButton spacing with Icon</a>:</p>
<blockquote>
<p dir="auto">i.e 3/4 pixels after the icon)</p>
</blockquote>
<p dir="auto">Please be more precise what you mean here - QPushButton draw a border around the icon + some text. If you don't need text you can maybe also go with a QToolButton</p>
]]></description><link>https://forum.qt.io/post/598337</link><guid isPermaLink="true">https://forum.qt.io/post/598337</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Mon, 01 Jun 2020 15:02:52 GMT</pubDate></item><item><title><![CDATA[Reply to PushButton spacing with Icon on Mon, 01 Jun 2020 14:28:52 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for your reply.</p>
<ul>
<li>Currently I am doing similar to below code<br />
QPixmap pixmap("...x.jpg");<br />
QIcon ButtonIcon(pixmap);<br />
button-&gt;setIcon(ButtonIcon);<br />
button-&gt;setIconSize(pixmap.rect().size());</li>
<li>It shows the icon however, there are spacing appears in button's boundary ( i.e 3/4 pixels after the icon)</li>
<li>I am using QT 5.9</li>
<li>OS: Windows</li>
</ul>
]]></description><link>https://forum.qt.io/post/598331</link><guid isPermaLink="true">https://forum.qt.io/post/598331</guid><dc:creator><![CDATA[HrishiGobler]]></dc:creator><pubDate>Mon, 01 Jun 2020 14:28:52 GMT</pubDate></item><item><title><![CDATA[Reply to PushButton spacing with Icon on Sun, 31 May 2020 11:32:34 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">How are you doing it currently ?<br />
How does it show ?<br />
What version of Qt are you using ?<br />
On what OS ?</p>
]]></description><link>https://forum.qt.io/post/598140</link><guid isPermaLink="true">https://forum.qt.io/post/598140</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Sun, 31 May 2020 11:32:34 GMT</pubDate></item></channel></rss>