<?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[QGuiApplication palette not set to ApplicationWindow]]></title><description><![CDATA[<p dir="auto">Re: <a href="/topic/45710/qquickview-change-controls-palette">QQuickView change controls palette</a></p>
<p dir="auto">It looks like the ApplicationWindow is not affected by the QGuiApplication's palette values.<br />
My environment is Qt 5.12.5 on Linux. I started over with an empty project to make sure of my results.</p>
<p dir="auto">main.cpp:</p>
<pre><code class="language-cpp">    QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);

    QGuiApplication app(argc, argv);

    QPalette palette = QGuiApplication::palette();
    QPalette newPalette(palette);
    newPalette.setColor(QPalette::ColorRole::WindowText, QColor("#00FF00"));
    QGuiApplication::setPalette(newPalette);
</code></pre>
<p dir="auto">main.qml:</p>
<pre><code>ApplicationWindow {
    visible: true
    width: 640
    height: 480

    Component.onCompleted: {
        console.log("Text color : " + palette.windowText)
    }

    Text {
        text : "hello"
    }
}
</code></pre>
<p dir="auto">Logs "Text color : #26282a"<br />
What am I missing if we refer to the <a href="https://doc.qt.io/qt-5/qml-qtquick-controls2-applicationwindow.html#palette-prop" target="_blank" rel="noopener noreferrer nofollow ugc">documentation</a>?</p>
]]></description><link>https://forum.qt.io/topic/113587/qguiapplication-palette-not-set-to-applicationwindow</link><generator>RSS for Node</generator><lastBuildDate>Mon, 08 Jun 2026 02:41:41 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/113587.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 12 Apr 2020 16:47:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QGuiApplication palette not set to ApplicationWindow on Wed, 29 Dec 2021 18:40:23 GMT]]></title><description><![CDATA[<p dir="auto">It only works if you use the <em>Fusion</em>-style. The documentation states: <em>The Fusion style uses the standard system palettes to provide colors that match the desktop environment.</em></p>
]]></description><link>https://forum.qt.io/post/696475</link><guid isPermaLink="true">https://forum.qt.io/post/696475</guid><dc:creator><![CDATA[igh.de]]></dc:creator><pubDate>Wed, 29 Dec 2021 18:40:23 GMT</pubDate></item><item><title><![CDATA[Reply to QGuiApplication palette not set to ApplicationWindow on Mon, 13 Apr 2020 17:44:17 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/jean_b">@<bdi>jean_b</bdi></a></p>
<p dir="auto">Probably You have to specify a color  group which the change affects:</p>
<pre><code>newPalette.setColor(QPalette::Active, QPalette::WindowText, QColor("#00FF00"));
</code></pre>
<p dir="auto">It works for me.</p>
]]></description><link>https://forum.qt.io/post/588279</link><guid isPermaLink="true">https://forum.qt.io/post/588279</guid><dc:creator><![CDATA[SeeLook]]></dc:creator><pubDate>Mon, 13 Apr 2020 17:44:17 GMT</pubDate></item></channel></rss>