<?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[very simply style of switch ...]]></title><description><![CDATA[<p dir="auto">for first I'm on qt5.11 quickcontrol2 ... style=Default ... I would like to change the background color without having to make a qml style file with transitions and everything else. Is it possible to keep the current style with all its transitions and change only the dark-gray in blue with a single line of code?</p>
<p dir="auto">regards</p>
]]></description><link>https://forum.qt.io/topic/100156/very-simply-style-of-switch</link><generator>RSS for Node</generator><lastBuildDate>Mon, 13 Apr 2026 01:27:10 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/100156.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 26 Feb 2019 19:01:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to very simply style of switch ... on Wed, 27 Feb 2019 12:00:48 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/grecko">@<bdi>GrecKo</bdi></a> ok .... but I'm on ui.qml file .... sems not consent. So I must export witch property?</p>
<p dir="auto">-- Update ---</p>
<p dir="auto">is these a good way to do these things:</p>
<pre><code>QObject *myButton= object-&gt;findChild&lt;QObject*&gt;("myButton");
if (myButton)
    myButton-&gt;setProperty("color", "red");
</code></pre>
<p dir="auto">There are some setPalette property for switch?</p>
<p dir="auto">regards</p>
]]></description><link>https://forum.qt.io/post/514324</link><guid isPermaLink="true">https://forum.qt.io/post/514324</guid><dc:creator><![CDATA[gfxx]]></dc:creator><pubDate>Wed, 27 Feb 2019 12:00:48 GMT</pubDate></item><item><title><![CDATA[Reply to very simply style of switch ... on Wed, 27 Feb 2019 09:00:35 GMT]]></title><description><![CDATA[<p dir="auto">There is multiple way to do this depending on which Qt Quick Controls 2 style you are using.</p>
<p dir="auto">Generally you can just modify your <code>Control</code>'s <code>palette</code> : <a href="https://doc.qt.io/qt-5/qml-qtquick-controls2-control.html#palette-prop" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-5/qml-qtquick-controls2-control.html#palette-prop</a><br />
But some style (like the Material one) don't use <code>palette</code> but their own attached properties instead, for example : <a href="https://doc.qt.io/qt-5/qtquickcontrols2-material.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-5/qtquickcontrols2-material.html</a></p>
]]></description><link>https://forum.qt.io/post/514275</link><guid isPermaLink="true">https://forum.qt.io/post/514275</guid><dc:creator><![CDATA[GrecKo]]></dc:creator><pubDate>Wed, 27 Feb 2019 09:00:35 GMT</pubDate></item><item><title><![CDATA[Reply to very simply style of switch ... on Wed, 27 Feb 2019 08:54:52 GMT]]></title><description><![CDATA[<p dir="auto">these for sure .... but I need only one component with that colour !!!!</p>
<p dir="auto">not very scalable .... In these way for first I must rewrite every component style ... than if I need a specific change i need to copy and modify component style ..... so probabily I need 30/40 or more component filestyle.qml .... not so intelligent way to do the things. Ok probabily is not so important in a bigger company project .... but in smart project .... really there are not another way to do these?</p>
<p dir="auto">In that case better is to use c++ widget and css code.</p>
<p dir="auto">in these moment I have a little idea .... where is locate the quick2 controls? I think is better copy it and modify as custom style comp.</p>
]]></description><link>https://forum.qt.io/post/514273</link><guid isPermaLink="true">https://forum.qt.io/post/514273</guid><dc:creator><![CDATA[gfxx]]></dc:creator><pubDate>Wed, 27 Feb 2019 08:54:52 GMT</pubDate></item><item><title><![CDATA[Reply to very simply style of switch ... on Wed, 27 Feb 2019 08:38:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gfxx">@<bdi>gfxx</bdi></a> said in <a href="/post/514267">very simply style of switch ...</a>:</p>
<blockquote>
<p dir="auto">.. 3/4  must write <s>300/400</s> 100 row of code</p>
</blockquote>
<p dir="auto">you can <a href="https://doc.qt.io/qt-5/qtqml-documents-definetypes.html" target="_blank" rel="noopener noreferrer nofollow ugc">reuse components</a></p>
]]></description><link>https://forum.qt.io/post/514268</link><guid isPermaLink="true">https://forum.qt.io/post/514268</guid><dc:creator><![CDATA[ODБOï]]></dc:creator><pubDate>Wed, 27 Feb 2019 08:38:47 GMT</pubDate></item><item><title><![CDATA[Reply to very simply style of switch ... on Wed, 27 Feb 2019 08:19:44 GMT]]></title><description><![CDATA[<p dir="auto">i see these link .... but if use that system i loose transition effect .... so i must implement effect too ... not so easy. In these manner for change one only color in 3/4 widget i must write 300/400 row of code ... very slow system ... there are not some other system for change one only "active background color" whitout implement again all widget style? (like css manner)??</p>
]]></description><link>https://forum.qt.io/post/514267</link><guid isPermaLink="true">https://forum.qt.io/post/514267</guid><dc:creator><![CDATA[gfxx]]></dc:creator><pubDate>Wed, 27 Feb 2019 08:19:44 GMT</pubDate></item><item><title><![CDATA[Reply to very simply style of switch ... on Tue, 26 Feb 2019 19:38:17 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">For the QtQuickControls 2, the reference is <a href="https://doc.qt.io/qt-5/qtquickcontrols2-customize.html#customizing-switch" target="_blank" rel="noopener noreferrer nofollow ugc">here</a>.</p>
]]></description><link>https://forum.qt.io/post/514147</link><guid isPermaLink="true">https://forum.qt.io/post/514147</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Tue, 26 Feb 2019 19:38:17 GMT</pubDate></item><item><title><![CDATA[Reply to very simply style of switch ... on Tue, 26 Feb 2019 19:43:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gfxx">@<bdi>gfxx</bdi></a> hi<br />
<em>edit my bad</em> this was not for QtQuickControls 2<br />
<s>see <a href="https://doc.qt.io/qt-5/qml-qtquick-controls-styles-switchstyle.html" target="_blank" rel="noopener noreferrer nofollow ugc">SwitchStyle</a></s><br />
<s>```<br />
Switch {<br />
style: SwitchStyle {<br />
groove: Rectangle {<br />
implicitWidth: 100<br />
implicitHeight: 20<br />
radius: 9<br />
color: "darkblue"<br />
border.width: 1<br />
}<br />
}<br />
}</s></p>
<pre><code></code></pre>
]]></description><link>https://forum.qt.io/post/514145</link><guid isPermaLink="true">https://forum.qt.io/post/514145</guid><dc:creator><![CDATA[ODБOï]]></dc:creator><pubDate>Tue, 26 Feb 2019 19:43:53 GMT</pubDate></item></channel></rss>