<?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[Setting an icon&#x27;s size on a QPushButton through Stylesheets]]></title><description><![CDATA[<p dir="auto">Hi. I'm trying to set an icon's size on a QPushButton through Stylesheets. I am unable to locate the proper syntax that would allow me to modify the icon's size when I implement the icon image from the stylesheet.</p>
<p dir="auto">This is my code, based on <a href="https://stackoverflow.com/questions/37413527/how-to-change-qpushbutton-icon-size-using-stylesheets-in-qt-app" target="_blank" rel="noopener noreferrer nofollow ugc">this suggestion.</a> Adjusting the size to 64 or 256 did not change the size of the object.</p>
<pre><code>"QPushButton#pushButton_Calibration {image: url(:/images/toolkit_" + textColor + ".png); qproperty-iconSize: 128px;}"
</code></pre>
<p dir="auto">This is my other code, based on <a href="https://doc.qt.io/qt-6/stylesheet-examples.html#customizing-qsizegrip" target="_blank" rel="noopener noreferrer nofollow ugc">this other suggestion.</a> Adjusting the width/height to 64 or 256 did not change the size of the object.</p>
<pre><code>"QPushButton#pushButton_Calibration {image: url(:/images/toolkit_" + textColor + ".png); width: 128px; height: 128px;}"
</code></pre>
<p dir="auto">I am aware that something like this is an option:</p>
<pre><code>ui-&gt;pushButton_Calibration-&gt;setIconSize(QSize(128, 128));
</code></pre>
<p dir="auto">But I am unsure on how to implement this to something with the format QPushButton#pushButton_Calibration.</p>
<p dir="auto">Please let me know if more information is required to solve this issue. I am unfamiliar with the syntax needed to change the size of the icon and haven't been able to locate it from the documentation.</p>
]]></description><link>https://forum.qt.io/topic/139581/setting-an-icon-s-size-on-a-qpushbutton-through-stylesheets</link><generator>RSS for Node</generator><lastBuildDate>Thu, 05 Nov 2026 02:40:35 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/139581.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 26 Sep 2022 13:22:17 GMT</pubDate><ttl>60</ttl></channel></rss>