<?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[How dose the qss influence the size of the QPushbutton]]></title><description><![CDATA[<p dir="auto">I've created a Pushbutton by inputing nothing,I just want to using the qss file to deside the button size.How would I do ?<br />
I tried to using the width,max-width,image or background-image of the qss grammar.<br />
But in fact its hard to understand which is the major factor to deside the fact width and height of the pushbutton.<br />
The api on the official website is hard to understand.</p>
<pre><code>QPushButton[ui_type="button_icon"]
{
    /*background-color: #004AA9; 
	padding:3px;
	text-align:right;*/ 
	max-width:126px;
	max-height:28px;/**/
    image:url(:/img/img/img_back.png);
	background-color: rgba(0,0,0,0);
    background-repeat:no-repeat;
}

QPushButton[ui_type="button_icon"]:hover{
	/*padding:3px;
	text-align:right; 
	*/
	max-width:126px;
	max-height:36px;
    image:url(:/img/img/img_back.png);
	background-color: rgba(0,0,0,120);
    background-position: center;
    background-origin: content;
    background-repeat:no-repeat;
    border:1px solid #D4D6D9;
}
</code></pre>
]]></description><link>https://forum.qt.io/topic/140975/how-dose-the-qss-influence-the-size-of-the-qpushbutton</link><generator>RSS for Node</generator><lastBuildDate>Thu, 05 Nov 2026 12:02:36 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/140975.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 24 Nov 2022 01:10:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How dose the qss influence the size of the QPushbutton on Fri, 25 Nov 2022 00:58:09 GMT]]></title><description><![CDATA[<p dir="auto">For example,the width and the height of the image named img_back.png  is 72X28,but when I put these codes into the <a href="http://project.It" target="_blank" rel="noopener noreferrer nofollow ugc">project.It</a> may not work ,the image in fact always has a scale cause the button width and height.<br />
I just dont know the scale factor or the ohter factors to influence the button size.<br />
I thought there would be some guide codes  to tell me how to write the right and effecient codes.</p>
]]></description><link>https://forum.qt.io/post/737637</link><guid isPermaLink="true">https://forum.qt.io/post/737637</guid><dc:creator><![CDATA[nicker player]]></dc:creator><pubDate>Fri, 25 Nov 2022 00:58:09 GMT</pubDate></item><item><title><![CDATA[Reply to How dose the qss influence the size of the QPushbutton on Thu, 24 Nov 2022 07:47:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/nicker-player">@<bdi>nicker-player</bdi></a> said in <a href="/post/737469">How dose the qss influence the size of the QPushbutton</a>:</p>
<blockquote>
<p dir="auto">tried to using the width,max-width,image or background-image of the qss grammar.</p>
</blockquote>
<p dir="auto">And what happened with this code?  Did any of the properties apply or none?  In the hover or non-hover case?  Would changing the <em>maximum</em> height of this button have any effect?  Did you try <code>height</code> before trying <code>max-height</code>?</p>
]]></description><link>https://forum.qt.io/post/737495</link><guid isPermaLink="true">https://forum.qt.io/post/737495</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Thu, 24 Nov 2022 07:47:54 GMT</pubDate></item></channel></rss>