<?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[QTabWidget Background Color Doesn&#x27;t Change]]></title><description><![CDATA[<p dir="auto">Hi,<br />
I can't seem to change the "window" color of the QTabWidget that I'm using in my project. I'm running Qt Creator 2.0.1 (based on Qt 4.7.0). I'm using the form creator which has a main window and contained within the main window I created a QTabWidget. When I change the Window Color Role in the Palette Editor the change displays in the form designer. However when I compile the project it always changes to plain white no matter what color is selected in the Palette Editor. Any ideas?</p>
]]></description><link>https://forum.qt.io/topic/3124/qtabwidget-background-color-doesn-t-change</link><generator>RSS for Node</generator><lastBuildDate>Mon, 08 Jun 2026 08:36:04 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/3124.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 14 Jan 2011 05:45:04 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QTabWidget Background Color Doesn&#x27;t Change on Sat, 15 Jan 2011 05:29:44 GMT]]></title><description><![CDATA[<p dir="auto">all child widgets of tabwidget will naturally inherit the style of the tabwidget. so you will have to override the style again in the child widgets. You can also use an external .qss file to define custom styles ... examples "here":<a href="http://doc.qt.nokia.com/latest/stylesheet-examples.html" target="_blank" rel="noopener noreferrer nofollow ugc">http://doc.qt.nokia.com/latest/stylesheet-examples.html</a></p>
]]></description><link>https://forum.qt.io/post/71800</link><guid isPermaLink="true">https://forum.qt.io/post/71800</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sat, 15 Jan 2011 05:29:44 GMT</pubDate></item><item><title><![CDATA[Reply to QTabWidget Background Color Doesn&#x27;t Change on Fri, 14 Jan 2011 16:29:43 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for the code snippet chetankjain. That definitely changes the background color. The bad thing is that it also seems to remove all of the inherited properties of the window (for example, button style and combo box style). Is there another code that will just change the color without destroying all of the other inherited properties?</p>
]]></description><link>https://forum.qt.io/post/71739</link><guid isPermaLink="true">https://forum.qt.io/post/71739</guid><dc:creator><![CDATA[retro_code]]></dc:creator><pubDate>Fri, 14 Jan 2011 16:29:43 GMT</pubDate></item><item><title><![CDATA[Reply to QTabWidget Background Color Doesn&#x27;t Change on Fri, 14 Jan 2011 06:35:14 GMT]]></title><description><![CDATA[<p dir="auto">like this:<br />
@<br />
tabWidget-&gt;setStyleSheet(QString::fromUtf8("background-color: rgb(255, 255, 60);"));<br />
@</p>
<p dir="auto">details see "here":<a href="http://doc.qt.nokia.com/latest/stylesheet.html" target="_blank" rel="noopener noreferrer nofollow ugc">http://doc.qt.nokia.com/latest/stylesheet.html</a></p>
]]></description><link>https://forum.qt.io/post/71616</link><guid isPermaLink="true">https://forum.qt.io/post/71616</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Fri, 14 Jan 2011 06:35:14 GMT</pubDate></item><item><title><![CDATA[Reply to QTabWidget Background Color Doesn&#x27;t Change on Fri, 14 Jan 2011 06:26:25 GMT]]></title><description><![CDATA[<p dir="auto">what do you mean by "setting the stylesheet"?</p>
]]></description><link>https://forum.qt.io/post/71610</link><guid isPermaLink="true">https://forum.qt.io/post/71610</guid><dc:creator><![CDATA[retro_code]]></dc:creator><pubDate>Fri, 14 Jan 2011 06:26:25 GMT</pubDate></item><item><title><![CDATA[Reply to QTabWidget Background Color Doesn&#x27;t Change on Fri, 14 Jan 2011 05:59:20 GMT]]></title><description><![CDATA[<p dir="auto">I do it by setting the stylesheet and it works fine.</p>
]]></description><link>https://forum.qt.io/post/71603</link><guid isPermaLink="true">https://forum.qt.io/post/71603</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Fri, 14 Jan 2011 05:59:20 GMT</pubDate></item><item><title><![CDATA[Reply to QTabWidget Background Color Doesn&#x27;t Change on Fri, 14 Jan 2011 05:47:32 GMT]]></title><description><![CDATA[<p dir="auto">I forgot to mention: I can change the text colors, highlight colors, etc in the tab widget so it's just the window color that isn't changing. I also created another tab widget as a test and it gave me the same problem (no matter what color is defined in the palette editor it always shows white after compiling).</p>
]]></description><link>https://forum.qt.io/post/71601</link><guid isPermaLink="true">https://forum.qt.io/post/71601</guid><dc:creator><![CDATA[retro_code]]></dc:creator><pubDate>Fri, 14 Jan 2011 05:47:32 GMT</pubDate></item></channel></rss>