<?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[Background in QTableWidget]]></title><description><![CDATA[<p dir="auto">Hi. I have class inherited from QTableWidget. I want to set background from file, but line<br />
"setStyleSheet("background-image: url("board.jpg");");" or<br />
setStyleSheet("background-image: url(./board.jpg);") doesn't work... What is solution?</p>
]]></description><link>https://forum.qt.io/topic/48591/background-in-qtablewidget</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Apr 2026 05:43:11 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/48591.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 27 Nov 2014 13:22:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Background in QTableWidget on Thu, 27 Nov 2014 20:36:18 GMT]]></title><description><![CDATA[<p dir="auto">Hi and welcome to devnet,</p>
<p dir="auto">[quote author="Binary91" date="1417095175"]Hi and welcome to DevNet!<br />
@QPixmap jpgImage( "board.jpg");@<br />
[/quote]</p>
<p dir="auto">This is a relative path so the file must be in the same folder as the executable.</p>
<p dir="auto">On a related note, since you are using Qt, you should use the *nix forward slash notation, it will avoid many problem with paths</p>
]]></description><link>https://forum.qt.io/post/252588</link><guid isPermaLink="true">https://forum.qt.io/post/252588</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Thu, 27 Nov 2014 20:36:18 GMT</pubDate></item><item><title><![CDATA[Reply to Background in QTableWidget on Thu, 27 Nov 2014 14:09:38 GMT]]></title><description><![CDATA[<p dir="auto">It depends.. Try it in both folders to see if it works. Or use an absolute path like "C:\Path\To\Image\board.jpg"</p>
]]></description><link>https://forum.qt.io/post/252549</link><guid isPermaLink="true">https://forum.qt.io/post/252549</guid><dc:creator><![CDATA[Binary91]]></dc:creator><pubDate>Thu, 27 Nov 2014 14:09:38 GMT</pubDate></item><item><title><![CDATA[Reply to Background in QTableWidget on Thu, 27 Nov 2014 13:44:51 GMT]]></title><description><![CDATA[<p dir="auto">Hmmm. Where should be file board.jpg? In folder "build-Checkers_V01-Desktop_Qt_5_3_MSVC2013_64bit-Debug" or just in "Checkers_V01"?</p>
]]></description><link>https://forum.qt.io/post/252546</link><guid isPermaLink="true">https://forum.qt.io/post/252546</guid><dc:creator><![CDATA[dyzio163]]></dc:creator><pubDate>Thu, 27 Nov 2014 13:44:51 GMT</pubDate></item><item><title><![CDATA[Reply to Background in QTableWidget on Thu, 27 Nov 2014 13:32:55 GMT]]></title><description><![CDATA[<p dir="auto">Hi and welcome to DevNet!</p>
<p dir="auto">I think this can be done via QPalette/QPixmap:<br />
@ QTableWidget* table = new QTableWidget;</p>
<pre><code>QPalette palette = table-&gt;palette();
QPixmap jpgImage( "board.jpg");
palette.setBrush(QPalette::Base, QBrush(jpgImage));
table-&gt;setPalette(palette);@
</code></pre>
<p dir="auto">Try it, I didn't test it..</p>
]]></description><link>https://forum.qt.io/post/252545</link><guid isPermaLink="true">https://forum.qt.io/post/252545</guid><dc:creator><![CDATA[Binary91]]></dc:creator><pubDate>Thu, 27 Nov 2014 13:32:55 GMT</pubDate></item></channel></rss>