Public bug reported:
Consider this snippet of code:
-----------------------------------------------
import QtQuick 2.4
import Ubuntu.Components 1.3
Item {
property int bla: units.gu(10)
onBlaChanged: print("bla changed", bla);
property int blubb: 80
onBlubbChanged: print("blubb changed", blubb);
Component.onCompleted: print("completed", bla);
}
----------------------------------------------
The output of this is:
qml: bla changed 80
qml: completed 80
the changed signal should not be emitted before completion, given it is
its initial value and not actually changed.
The current behavior triggers all the onChanged handlers when there's
units.gu() involved, which results in things like change animations
being played at startup and lots of wasted cpu cycles for evaluating all
those changed events.
** Affects: ubuntu-ui-toolkit (Ubuntu)
Importance: Undecided
Status: Confirmed
** Description changed:
Consider this snippet of code:
-----------------------------------------------
import QtQuick 2.4
import Ubuntu.Components 1.3
Item {
- property int bla: units.gu(10)
- onBlaChanged: print("bla changed", bla);
+ property int bla: units.gu(10)
+ onBlaChanged: print("bla changed", bla);
- property int blubb: 80
- onBlubbChanged: print("blubb changed", blubb);
+ property int blubb: 80
+ onBlubbChanged: print("blubb changed", blubb);
- Component.onCompleted: print("completed", bla);
+ Component.onCompleted: print("completed", bla);
}
----------------------------------------------
The output of this is:
qml: bla changed 80
qml: completed 80
+ the changed signal should not be emitted before completion, given it is
+ its initial value and not actually changed.
- the changed signal should not be emitted before completion, given it is its
initial value and not actually changed.
+ The current behavior triggers all the onChanged handlers when there's
+ units.gu() involved, which results in things like change animations
+ being played at startup and lots of wasted cpu cycles for evaluating all
+ those changed events.
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1647415
Title:
units.gu() emits changed signal before completion
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1647415/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs