<?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[property binding just for initial value]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">in my program all values are stored in a big config.qml<br />
If i want to use colors, gradients etc. I create a variable and bind it to the master-value in my config.qml.<br />
Now i have the problem if i want to edit some values like<br />
value: value * 3<br />
my "master-value gets the change too and not just the value in the component.</p>
<p dir="auto">I tried with readonly property but i get the problem that i can't make readonly Gradients</p>
<p dir="auto">Any idea to solve it?</p>
]]></description><link>https://forum.qt.io/topic/73222/property-binding-just-for-initial-value</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Apr 2026 06:00:49 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/73222.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 10 Nov 2016 15:00:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to property binding just for initial value on Thu, 24 Nov 2016 10:00:41 GMT]]></title><description><![CDATA[<p dir="auto">found a work around.</p>
<p dir="auto">just implement the GlobalConfig in following ways</p>
<pre><code>property QtObject gConfig: GlobalConfig {}
</code></pre>
<p dir="auto">and than</p>
<pre><code>property Gradient offGradient:		gConfig.offlineGradient
</code></pre>
<p dir="auto">it works</p>
]]></description><link>https://forum.qt.io/post/361372</link><guid isPermaLink="true">https://forum.qt.io/post/361372</guid><dc:creator><![CDATA[petzold]]></dc:creator><pubDate>Thu, 24 Nov 2016 10:00:41 GMT</pubDate></item><item><title><![CDATA[Reply to property binding just for initial value on Fri, 11 Nov 2016 09:00:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/p3c0">@<bdi>p3c0</bdi></a></p>
<p dir="auto">Normally that works but i have not so much elements.<br />
My Element is a Button and it is just a Rectangle with some variables and a mouse area. This button i use as component in other qmls. And now to add additional Items for a workaround i don't want, because i think it is not a "nice" solutions, i hoped that i found a more correct way to "copy" just the value from a property to a new property.<br />
My actual workaround is to have local propertys and no link to my globalconfig.</p>
]]></description><link>https://forum.qt.io/post/359021</link><guid isPermaLink="true">https://forum.qt.io/post/359021</guid><dc:creator><![CDATA[petzold]]></dc:creator><pubDate>Fri, 11 Nov 2016 09:00:15 GMT</pubDate></item><item><title><![CDATA[Reply to property binding just for initial value on Fri, 11 Nov 2016 08:35:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/petzold">@<bdi>petzold</bdi></a> I was saying something like this:</p>
<pre><code>Window {
    width: 200
    height: 200
    visible: true

    property int globalProperty: 30

    Item {
        id: item
        property int localProperty: globalProperty
        anchors.fill: parent

        Text {
            id: txt
            anchors.centerIn: parent
            text: item.localProperty

            MouseArea {
                anchors.fill: parent
                onClicked: {
                    item.localProperty = 60
                    console.log(globalProperty)
                }
            }
        }
    }
}
</code></pre>
<p dir="auto">Initially localproperty holds the globalperoperty. Then on click just changes the localproperty and not global one.</p>
]]></description><link>https://forum.qt.io/post/359019</link><guid isPermaLink="true">https://forum.qt.io/post/359019</guid><dc:creator><![CDATA[p3c0]]></dc:creator><pubDate>Fri, 11 Nov 2016 08:35:06 GMT</pubDate></item><item><title><![CDATA[Reply to property binding just for initial value on Fri, 11 Nov 2016 08:10:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/p3c0">@<bdi>p3c0</bdi></a></p>
<p dir="auto">That is the way i'm looking for. but how to do?</p>
<pre><code>property Gradient offGradient: Config.offlineGradient
</code></pre>
<p dir="auto">That is the way i did. I have different gradients for different states.<br />
Later i modify the actual gradient with</p>
<pre><code>Qt.darker  
Qt.lighter
</code></pre>
<p dir="auto">for some mouse-actions (hover, clicked etc.)</p>
<p dir="auto">So at the moment i have the problem that my globalConfig.offlineGradient get the change and not just offGradient.</p>
]]></description><link>https://forum.qt.io/post/359015</link><guid isPermaLink="true">https://forum.qt.io/post/359015</guid><dc:creator><![CDATA[petzold]]></dc:creator><pubDate>Fri, 11 Nov 2016 08:10:32 GMT</pubDate></item><item><title><![CDATA[Reply to property binding just for initial value on Fri, 11 Nov 2016 07:22:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/petzold">@<bdi>petzold</bdi></a> So how about local property? This will initially be binded to global property in individial components which can then me modified later.</p>
]]></description><link>https://forum.qt.io/post/359005</link><guid isPermaLink="true">https://forum.qt.io/post/359005</guid><dc:creator><![CDATA[p3c0]]></dc:creator><pubDate>Fri, 11 Nov 2016 07:22:05 GMT</pubDate></item></channel></rss>