Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
5.3.0 Beta1
-
None
-
Debian/testing amd64. Ubuntu 13.04. Qt 5.2.1 from installer. Qt 5.3 built from source
Description
I have clone function (at MapData.js) and I'm creating a few of new objects by cloning dummy object (see .qml file). I set new value of color property for objects on even indexes.
After that I apped this array to Repeater's model. When repeater completes delegate construction I print `color` property again.
Qt 5.2.1: correct: on even indexes I see updated value.
Qt 5.3 : unexpected: all colors are equal to color property of dummy object.
P.S.
I don't know if it is relevant but when I print array before appending it to the model I get results which are unexpected for me but same for both versions of Qt. It seems that property exists only for objects where I have set it manually. See logs below. In 1st line I print array of objects using JSON.stringify. on next 4 lines I print color property after delegate's construction.
Qt 5.2.1
[{"color":"#FF00FF"},{},{"color":"#FF00FF"},{}] Completed: color = #ff00ff Completed: color = #009000 Completed: color = #ff00ff Completed: color = #009000
Qt 5.3
qml: [{"color":"#FF00FF"},{},{"color":"#FF00FF"},{}] qml: Completed: color = #009000 qml: Completed: color = #009000 qml: Completed: color = #009000 qml: Completed: color = #009000
My clone function:
var clone = (function(){ var Clone = function() { }; return function (obj) { Clone.prototype=obj; return new Clone() }; }());