<html><head></head><body><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;"><div></div>
<div>Hi Michael & devel list</div><div><br></div><div>Thanks for the link, I did a bit of googling before asking but didnt remember to check the source code.</div><div>Still dont know why it worked for desktop and android, but now it's bullet proof for all plataforms :) Solved!!!</div><div><br></div><div>Cheers</div><div>João</div><div><br></div><div><br></div>
<div id="yahoo_quoted_6779175530" class="yahoo_quoted">
<div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
<div>
Em segunda-feira, 14 de maio de 2018 14:21:38 GMT+1, Michael Fuchs <michfu@gmx.at> escreveu:
</div>
<div><br></div>
<div><br></div>
<div><div dir="ltr">Hi Joao,<br clear="none"><br clear="none"><a shape="rect" href="https://github.com/qt/qtdeclarative/blob/44a89492b49f23a975377795dbb7a48916cb5081/src/qml/types/qqmllistmodel.cpp#L2739" target="_blank">https://github.com/qt/qtdeclarative/blob/44a89492b49f23a975377795dbb7a48916cb5081/src/qml/types/qqmllistmodel.cpp#L2739</a><br clear="none"><br clear="none">"Values must be simple constants; either strings (quoted and optionally <br clear="none">within a call to QT_TR_NOOP), boolean values (true, false), numbers, or <br clear="none">enumeration values (such as AlignText.AlignHCenter)."<br clear="none"><br clear="none">...so I rather wonder, why it works on Android. ;)<br clear="none"><br clear="none">br, Michael.<br clear="none"><br clear="none"><br clear="none">Am 14.05.2018 um 00:45 schrieb joao morgado via Devel:<br clear="none">> Hi there<br clear="none">> <br clear="none">> I tried to save a point type in a listmodel but when reading the value <br clear="none">> from the list I get a error saying something like "undefined". This <br clear="none">> error happens in my intex aqua fish.<br clear="none">> It does work on desktop and android.<br clear="none">> <br clear="none">> My code is something like this:<br clear="none">> <br clear="none">> ListModel{<br clear="none">> <br clear="none">> id:obstaclesList<br clear="none">> <br clear="none">> //obstaclesarerectanglesthatcannotbetransposed,likewallsforexample<br clear="none">> <br clear="none">> //listhetopleftcoordinate<br clear="none">> <br clear="none">> //risthebottomrightcoordinate<br clear="none">> <br clear="none">> }<br clear="none">> <br clear="none">> <br clear="none">> functionaddObstacle(l,r){<br clear="none">> <br clear="none">> //console.log("addingobstaclestolist")<br clear="none">> <br clear="none">> obstaclesList.append({"l":l,"r":r})<br clear="none">> <br clear="none">> }<br clear="none">> <br clear="none">> <br clear="none">> functionclearObstacles(){<br clear="none">> <br clear="none">> obstaclesList.clear()<br clear="none">> <br clear="none">> }<br clear="none">> <br clear="none">> <br clear="none">> functiongetObstacle(i){<br clear="none">> <br clear="none">> returnobstaclesList.get(i)<br clear="none">> <br clear="none">> }<br clear="none">> <br clear="none">> <br clear="none">> ......<br clear="none">> <br clear="none">> obstaclesList.addObstacle(mountain.baseTL,mountain.baseBR) // baseTL and baseBR are Qt.point(....)<br clear="none">> <br clear="none">> <br clear="none">> ....<br clear="none">> <br clear="none">> obstaclesList.getObstacle(i).l // <- this line is where it fails<br clear="none">> <br clear="none">> <br clear="none">> I solve this problem by changing the code to add / get real types <br clear="none">> instead of point.<br clear="none">> Just curious why this happen, inititally I tought it could be some arm <br clear="none">> limitation, but it does work good on a android mobile phone. Any ideias ?<br clear="none">> <br clear="none">> Br<br clear="none">> João<br clear="none">> <br clear="none">> <br clear="none">> _______________________________________________<br clear="none">> SailfishOS.org Devel mailing list<br clear="none">> To unsubscribe, please send a mail to <a shape="rect" ymailto="mailto:devel-unsubscribe@lists.sailfishos.org" href="mailto:devel-unsubscribe@lists.sailfishos.org">devel-unsubscribe@lists.sailfishos.org</a><div class="yqt4682638088" id="yqtfd89781"><br clear="none">> <br clear="none">_______________________________________________<br clear="none">SailfishOS.org Devel mailing list<br clear="none">To unsubscribe, please send a mail to <a shape="rect" ymailto="mailto:devel-unsubscribe@lists.sailfishos.org" href="mailto:devel-unsubscribe@lists.sailfishos.org">devel-unsubscribe@lists.sailfishos.org</a></div></div></div>
</div>
</div></div></body></html>