<?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[Styles not behaving as expected.]]></title><description><![CDATA[<p dir="auto">Hi all -</p>
<p dir="auto">I've been wrestling with styles in my app, and have found some issues when running on Windows. Here's the code that sets the style:</p>
<pre><code>    QString l_styleName = (platform == "android")
                              ? "Material"
                              : (platform == "windows")
                                    ? "Windows"
                                    : "Fusion";
    QQuickStyle::setStyle(l_styleName);
</code></pre>
<p dir="auto">What I've found through experimentation is:</p>
<ul>
<li>Universal style doesn't seem to use the palette.buttonText setting for changing the color of text within Buttons</li>
<li>Basic and Fusion ignore the accent color setting when used like this:</li>
</ul>
<pre><code>ApplicationWindow {
    id: mainWindow

    readonly property string degreeSymbol: String.fromCodePoint(0xb0)
    readonly property string bullet: String.fromCodePoint(0x2022)
    readonly property real margin: width / 32.0
    readonly property real gutter: width / 64.0

    property alias auxTabIndex: auxTabBar.currentIndex

    Component.onCompleted: {
        if (styleName === "Material") {
            Material.accent = Colors.background
        } else if (styleName === "Fusion") {
            Fusion.accent = Colors.background//Colors.primaryPurple
        } else if (styleName === "Basic") {
            Basic.accent = Colors.primaryPurple
        } else if (styleName === "Universal") {
            Universal.accent = Colors.background//Colors.primaryPurple
        } else if (styleName === "Windows") {
            Windows.accent = Colors.background//Colors.primaryPurple
        }
    }
</code></pre>
<p dir="auto">Moreover, when I set the style to "Windows," I get an error: "ReferenceError: Windows is not defined."</p>
<p dir="auto">It's hard to believe these are bugs in the style definitions, but I can't see what I'm doing wrong. Any ideas?</p>
<p dir="auto">Thanks...</p>
]]></description><link>https://forum.qt.io/topic/143759/styles-not-behaving-as-expected</link><generator>RSS for Node</generator><lastBuildDate>Mon, 21 Sep 2026 01:11:33 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/143759.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 20 Mar 2023 14:38:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Styles not behaving as expected. on Wed, 22 Mar 2023 20:53:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mzimmers">@<bdi>mzimmers</bdi></a></p>
<p dir="auto">[Universal]<br />
Accent=#ff0000<br />
Theme=System</p>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/676856f2-a8d5-4aa2-bc5f-5fcff844fe61.png" alt="116b2510-e0c9-4419-b15a-5ca0aa62edac-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">It accepts hex color</p>
<p dir="auto">But With the theme "Default" I don't see any changes</p>
]]></description><link>https://forum.qt.io/post/751965</link><guid isPermaLink="true">https://forum.qt.io/post/751965</guid><dc:creator><![CDATA[piervalli]]></dc:creator><pubDate>Wed, 22 Mar 2023 20:53:25 GMT</pubDate></item><item><title><![CDATA[Reply to Styles not behaving as expected. on Tue, 21 Mar 2023 19:45:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/piervalli">@<bdi>piervalli</bdi></a> I've never used that before; just tried it now. I created the file with this in it:</p>
<pre><code>[Controls]
Style=Universal

[Universal]
Theme=Light
Accent=Universal.Indigo
</code></pre>
<p dir="auto">And added the file to my qml.qrc. I didn't add an entry to my CMakeLists.txt file, but I'm not sure I need to, as the file appears to get loaded. I say this because I'm getting the following error:</p>
<pre><code>Universal: unknown accent value: Universal.Indigo
</code></pre>
<p dir="auto">A couple questions:</p>
<ol>
<li>is there something I need to do to use the Universal colors, to get rid of this error message?</li>
<li>can I specify 'transparent" as my accent color?</li>
</ol>
<p dir="auto">Thanks...</p>
]]></description><link>https://forum.qt.io/post/751785</link><guid isPermaLink="true">https://forum.qt.io/post/751785</guid><dc:creator><![CDATA[mzimmers]]></dc:creator><pubDate>Tue, 21 Mar 2023 19:45:42 GMT</pubDate></item><item><title><![CDATA[Reply to Styles not behaving as expected. on Tue, 21 Mar 2023 19:29:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mzimmers">@<bdi>mzimmers</bdi></a></p>
<p dir="auto"><a href="https://doc.qt.io/qt-5/qtquickcontrols2-configuration.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-5/qtquickcontrols2-configuration.html</a><br />
Have you tried with qtquickcontrols2.conf?</p>
]]></description><link>https://forum.qt.io/post/751784</link><guid isPermaLink="true">https://forum.qt.io/post/751784</guid><dc:creator><![CDATA[piervalli]]></dc:creator><pubDate>Tue, 21 Mar 2023 19:29:47 GMT</pubDate></item><item><title><![CDATA[Reply to Styles not behaving as expected. on Tue, 21 Mar 2023 19:19:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/piervalli">@<bdi>piervalli</bdi></a> it doesn't seem to matter what value I put in that line; it's just ignored. With Universal as my style, I get a red underbar as my accent.</p>
]]></description><link>https://forum.qt.io/post/751781</link><guid isPermaLink="true">https://forum.qt.io/post/751781</guid><dc:creator><![CDATA[mzimmers]]></dc:creator><pubDate>Tue, 21 Mar 2023 19:19:06 GMT</pubDate></item><item><title><![CDATA[Reply to Styles not behaving as expected. on Tue, 21 Mar 2023 00:15:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mzimmers">@<bdi>mzimmers</bdi></a></p>
<p dir="auto">Hi I have created a class in C++, So I used Material.accent = AppStyle.background</p>
]]></description><link>https://forum.qt.io/post/751668</link><guid isPermaLink="true">https://forum.qt.io/post/751668</guid><dc:creator><![CDATA[piervalli]]></dc:creator><pubDate>Tue, 21 Mar 2023 00:15:22 GMT</pubDate></item></channel></rss>