← Back to team overview

ubuntu-phone team mailing list archive

Re: Array push not functioning

 

2014-02-14 20:18 GMT+01:00 Roman Shchekin <mrqtros@xxxxxxxxx>:

> Hi all!
> In Qt Quick 2.0 there are no more "variant", only "var".
> If you strongly want to use old style keyword, be ready for crazy bugs.
>

Ow, I didn't realize this. If you Google for basic qml types, you always
get this:
http://qt-project.org/doc/qt-4.8/qdeclarativebasictypes.html
But this is for Qt4.8 (QtQuick 1.0)

And if you dig deeper, you find:
http://qt-project.org/doc/qt-5.0/qtqml/qtqml-typesystem-basictypes.html
Which is indeed a lot different.

About the variant, the link is here:
http://qt-project.org/doc/qt-4.8/qml-variant.html

I confused it with the 'list' property. This one you need to reassign every
time you change it.

It seems I need to drop a couple of list and variant properties in my apps


> Best wishes,
> Roman.
>
> P.S. I've met the same problem in Shorts app. Seems that with "variant"
> your code will work fine in Qt Quick 1.0.
>
>
> 2014-02-14 23:07 GMT+04:00 Sam Bull <sam.hacking@xxxxxxxx>:
>
>> On ven, 2014-02-14 at 11:11 +0200, Alberto Mardegan wrote:
>> > is this with Qt 5.2? It looks terribly similar to
>> > https://bugreports.qt-project.org/browse/QTBUG-36491
>> > (which is now fixed upstream, and will also be fixed on our Qt 5.2
>> > packages via distro-patching)
>>
>> Roman had the solution, think he forgot to CC the list. Just needed to
>> change variant to var. So the property is:
>>
>>         property var componentList: new Array()
>>
>> Working perfectly now.
>>
>> --
>> Mailing list: https://launchpad.net/~ubuntu-phone
>> Post to     : ubuntu-phone@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~ubuntu-phone
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>
> --
> Mailing list: https://launchpad.net/~ubuntu-phone
> Post to     : ubuntu-phone@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~ubuntu-phone
> More help   : https://help.launchpad.net/ListHelp
>
>

References