[Qt-qml] QML JS Weirdness
Adriano Rezende
adriano.rezende at openbossa.org
Thu Dec 2 15:51:42 CET 2010
On Thu, Dec 2, 2010 at 11:22 AM, Petrus Lundqvist
<petrus.lundqvist at nokia.com> wrote:
> And not to nit-pick, but you don't even get the index of the property
> but the "name" of the property, i.e. the name of the index. So the
> result is a string rather than a number.
Yes, I'm talking about index as a key, since it can be used to iterate
over generic js objects as well.
> [textAnimation, eyeAnimation, eyeOutline,
> pulseAnimation].forEach(function(animation) {
> if (!value && animation.running) ...
> });
Well, instead of using JS, I think it's always better to use QML
features to solve simple issues like this.
In this case, QML property bindings will do all the work in the C++
side and will also reduce the number of lines of code in JS side.
Br,
Adriano
More information about the Qt-qml
mailing list