Hi, I have encountered troubles when trying to declare readonly property alias to an internal var (which actually is a Date object). Here is an example which reproduces it on my laptop:
import QtQuick 2.0 Rectangle { width: 100 height: 62 color: time.getTime() === internal.time.getTime() ? "green" : "red" readonly property alias time: internal.time onTimeChanged: { if (typeof time === "undefined") return console.log("time:", Qt.formatDateTime(time), time.getTime()) console.assert(time.getTime() === internal.time.getTime(), "not equal") } Component.onCompleted: internal.time = new Date(1403621359000) QtObject { id: internal property var time: undefined } } The value reported by outer time property is indeed a strictly one hour earlier what leads me to a conclusion that, probably, day saving time mechanism may be involved. If I replace "alias" with "var", the value is as expected, though. Are there any pitfalls I should be aware of? What could cause such behaviour? The expectation is that alias should not do any transformations/conversions on aliased value. Regards, Dmitrii.
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest