<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Apparently properties of type color don't want to be undefined
(now I don't understand why I'm not getting the warning) - have
you tried something like "#00000000" instead of undefined?<br>
</p>
<div class="moz-cite-prefix">-S.<br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<blockquote type="cite"
cite="mid:CA+4hNMGoTTu7eZd0n_zSiobGY1pJ=hfvE8wUc9uxQrejkS-R8Q@mail.gmail.com">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div class="gmail_default" style="font-size:small">Hi Slava,</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">my code,
corresponding snippet:</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small"><font
face="monospace"> IconButton {<br>
id: image<br>
anchors.centerIn: parent<br>
down: pressed || parent.pressed<br>
icon.opacity: iconOpacity<br>
icon.source: iconName || iconSource<br>
icon.sourceSize.height: iconHeight<br>
icon.sourceSize.width: iconWidth<br>
onClicked: item.clicked()<br>
<br>
Component.onCompleted: {<br>
if ("color" in icon) {<br>
icon.color = undefined<br>
}<br>
}<br>
}<br>
</font></div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">On SFOS
3.0.3.9 (ported to OnePlus X), I get errors for a line with
icon.color = undefined :</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small"><a class="moz-txt-link-freetext" href="file:///">file:///</a>...
Error: Cannot assign [undefined] to QColor</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">So, it seems
that this property was introduced before 3.1.x, but not used
in 3.0.3.</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">Rinigus</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, Aug 14, 2019 at 1:07
PM Slava Monich <<a href="mailto:slava.monich@jolla.com"
moz-do-not-send="true">slava.monich@jolla.com</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
<p>Hi Rinigus,</p>
<p>AFAICT icon.color appeared in 3.1 and it wasn't there
before.<br>
</p>
<p>This piece of QML seems to work for me without any
warnings on both 2.0.1.7 (no icon.color) and 3.1.1.xxx
(latest devel, has icon.color):</p>
<p> IconButton {<br>
icon.source: "image://theme/icon-m-refresh"<br>
Component.onCompleted: {<br>
if ("color" in icon) {<br>
icon.color = undefined<br>
}<br>
}<br>
}</p>
<p>I'm not sure if it does what you want it to do, but it
doesn't produce any warnings!</p>
<p>And no, I'm not in a position to formulate the official
position :)<br>
</p>
<p>Cheers,</p>
<p>-Slava<br>
</p>
<br>
<blockquote type="cite">
<div dir="ltr">
<div class="gmail_default" style="font-size:small">Hi,</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">it
would be good to get some kind of official position on
QML IconButton issue. Is it considered for fixing or
it will stay as it is? Slava's suggestion didn't work
since color member is available on older versions of
SFOS as well.</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">Rinigus</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, Aug 7, 2019 at
2:29 PM rinigus <<a
href="mailto:rinigus.git@gmail.com" target="_blank"
moz-do-not-send="true">rinigus.git@gmail.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px
0px 0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div class="gmail_default" style="font-size:small">Hi,</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">any
ideas on how to fix this IconButton issue? Is
there a way to query SFOS version and make an ugly
fix on the basis of that...</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">Cheers,</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">Rinigus</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Sat, Aug 3,
2019 at 6:06 PM rinigus <<a
href="mailto:rinigus.git@gmail.com"
target="_blank" moz-do-not-send="true">rinigus.git@gmail.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px
0px 0px 0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div class="gmail_default"
style="font-size:small">Slava,</div>
<div class="gmail_default"
style="font-size:small"><br>
</div>
<div class="gmail_default"
style="font-size:small">unfortunately, it
doesn't work. IconButton property icon has
color subpropery defined in earlier SFOS
versions as well. So, </div>
<div class="gmail_default"
style="font-size:small"><br>
</div>
<div class="gmail_default">
<pre style="font-size:small;margin-top:0px;margin-bottom:0px"><font face="courier new, monospace"><span style="color:rgb(100,100,130)"> </span>IconButton<span style="color:rgb(100,100,130)"> </span>{</font></pre>
<pre style="font-size:small;margin-top:0px;margin-bottom:0px"><font face="courier new, monospace"><span style="color:rgb(100,100,130)"> </span><span style="color:rgb(255,85,85)">id</span>:<span style="color:rgb(100,100,130)"> </span><span style="font-style:italic">image</span></font></pre>
<pre style="font-size:small;margin-top:0px;margin-bottom:0px"><font face="courier new, monospace"><span style="color:rgb(100,100,130)"> </span><font color="#ff5555">[...]</font>
</font></pre>
<pre style="font-size:small;margin-top:0px;margin-bottom:0px"><font face="courier new, monospace"><span style="color:rgb(100,100,130)"> </span><span style="color:rgb(255,85,85)">Component.onCompleted</span>:<span style="color:rgb(100,100,130)"> </span>{</font></pre>
<pre style="font-size:small;margin-top:0px;margin-bottom:0px"><font face="courier new, monospace"><span style="color:rgb(100,100,130)"> </span><span style="color:rgb(1,253,253)">if</span><span style="color:rgb(100,100,130)"> </span>(<span style="color:rgb(233,151,117)">"color"</span><span style="color:rgb(100,100,130)"> </span><span style="color:rgb(1,253,253)">in</span><span style="color:rgb(100,100,130)"> </span><span style="font-style:italic">image</span>.icon)</font></pre>
<pre style="font-size:small;margin-top:0px;margin-bottom:0px"><font face="courier new, monospace"><span style="color:rgb(100,100,130)"> </span><span style="font-style:italic">image</span>.icon.color<span style="color:rgb(100,100,130)"> </span>=<span style="color:rgb(100,100,130)"> </span>undefined;</font></pre>
<pre style="font-size:small;margin-top:0px;margin-bottom:0px"><font face="courier new, monospace"><span style="color:rgb(100,100,130)"> </span>}</font></pre>
<pre style="font-size:small;margin-top:0px;margin-bottom:0px"><font face="courier new, monospace"><span style="color:rgb(100,100,130)"> </span>}</font></pre>
results in lots of warnings (Cannot assigned
[undefined] to QColor).</div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default">Maybe there is some
var I can check in QML to state that SFOS
version is >= 3.1.0.0?</div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default">Rinigus</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Sat, Aug 3,
2019 at 5:33 PM Slava Monich <<a
href="mailto:slava.monich@jolla.com"
target="_blank" moz-do-not-send="true">slava.monich@jolla.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote"
style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
<p>I don't think there's an "official" way
of maintaining backward compatibility but
I'd humbly suggest something like if
("color" in icon) ...<br>
</p>
<p>e.g. I do this kind of thing to
notifications:<br>
</p>
<p> Notification {<br>
id: clipboardNotification<br>
previewBody: "Copied to clipboard"<br>
Component.onCompleted: {<br>
if ("icon" in
clipboardNotification) {<br>
clipboardNotification.icon
= "icon-s-clipboard"<br>
}<br>
}<br>
}<br>
</p>
<p>Cheers,</p>
<p>-Slava</p>
</div>
</blockquote>
</div>
</blockquote>
</div>
</blockquote>
</div>
</blockquote>
</div>
</blockquote>
</div>
</blockquote>
</body>
</html>