<?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[QWidget background-image not showing-up]]></title><description><![CDATA[<p dir="auto">Hi community !</p>
<p dir="auto">I have a question, it might be stupid but ... I have an issue with that.<br />
I have created a QWidget inside Qt designer and tried to set the styleSheet as following:</p>
<p dir="auto">QWidget {background-image: url(:/corp/home/name/maya/scripts/image.jpg)}</p>
<p dir="auto">But nothing it displayed ... I have seen that there is a question of relative/absolute path depending if you're working with the Qt project or not which I am not using. By not using it, it is logical that I use an absolute path to my file... So I don t get why this is not working... Am I missing something ?</p>
<p dir="auto">Thx</p>
]]></description><link>https://forum.qt.io/topic/59155/qwidget-background-image-not-showing-up</link><generator>RSS for Node</generator><lastBuildDate>Fri, 05 Jun 2026 22:14:56 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/59155.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 24 Sep 2015 23:13:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QWidget background-image not showing-up on Fri, 25 Sep 2015 21:41:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/goffer">@<bdi>Goffer</bdi></a> have you tried</p>
<pre><code>QWidget#widgetId
</code></pre>
]]></description><link>https://forum.qt.io/post/291573</link><guid isPermaLink="true">https://forum.qt.io/post/291573</guid><dc:creator><![CDATA[raf924]]></dc:creator><pubDate>Fri, 25 Sep 2015 21:41:06 GMT</pubDate></item><item><title><![CDATA[Reply to QWidget background-image not showing-up on Fri, 25 Sep 2015 18:35:09 GMT]]></title><description><![CDATA[<p dir="auto">Is there a way to center the image in the QWidget ? apparently you can only specify what corner you want it to be but that's all.</p>
<p dir="auto">Edit:</p>
<p dir="auto">Okay after further tests, I don' t want to use the background-image because if I add an other widget in this QWidget it wil have the image displayed too. Or maybe there is a way to specify that we want to display it for this QWidget only and not his children ?</p>
]]></description><link>https://forum.qt.io/post/291547</link><guid isPermaLink="true">https://forum.qt.io/post/291547</guid><dc:creator><![CDATA[Goffer]]></dc:creator><pubDate>Fri, 25 Sep 2015 18:35:09 GMT</pubDate></item><item><title><![CDATA[Reply to QWidget background-image not showing-up on Fri, 25 Sep 2015 16:37:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/goffer">@<bdi>Goffer</bdi></a> Use the background-repeat property : <a href="http://www.w3schools.com/cssref/pr_background-repeat.asp" target="_blank" rel="noopener noreferrer nofollow ugc">http://www.w3schools.com/cssref/pr_background-repeat.asp</a></p>
<pre><code>QWidget {
background-image: url(/corp/home/name/maya/scripts/image.jpg);
background-repeat: no-repeat;
}
</code></pre>
]]></description><link>https://forum.qt.io/post/291536</link><guid isPermaLink="true">https://forum.qt.io/post/291536</guid><dc:creator><![CDATA[raf924]]></dc:creator><pubDate>Fri, 25 Sep 2015 16:37:31 GMT</pubDate></item><item><title><![CDATA[Reply to QWidget background-image not showing-up on Fri, 25 Sep 2015 16:33:31 GMT]]></title><description><![CDATA[<p dir="auto">Oh Thank you, it s working without ":" but I now realize that it's not what I want as the image is tiling... I just want to display it as 1 image.<br />
I guess I will go back to the QLabel + pixmap but then it is not very convenient as you can't put items on top like you would do if it was a QWidget background.</p>
<p dir="auto">absolute path was for testing purpose, then this will be integrated into a pipeline and and point to a relative path.</p>
]]></description><link>https://forum.qt.io/post/291533</link><guid isPermaLink="true">https://forum.qt.io/post/291533</guid><dc:creator><![CDATA[Goffer]]></dc:creator><pubDate>Fri, 25 Sep 2015 16:33:31 GMT</pubDate></item><item><title><![CDATA[Reply to QWidget background-image not showing-up on Fri, 25 Sep 2015 06:37:22 GMT]]></title><description><![CDATA[<p dir="auto">Hi<br />
I thinks its the ":" in the paths. that is normally used when loading from a  qrc file.</p>
<p dir="auto">this works for me<br />
QWidget {<br />
background-image: url(e:/test.png)<br />
}<br />
with image on E:</p>
<p dir="auto">That said, using absolute path will come back and haunt you if you ever want to run the app elsewhere than on your pc. :)</p>
]]></description><link>https://forum.qt.io/post/291492</link><guid isPermaLink="true">https://forum.qt.io/post/291492</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Fri, 25 Sep 2015 06:37:22 GMT</pubDate></item></channel></rss>