Overwriting the existing property with alias
-
I got this code from http://qt-project.org/doc/qt-5/qtqml-syntax-objectattributes.html#considerations-for-property-aliases (I made small modifications)
@
import QtQuick 2.2Rectangle {
width: 360
height: 360Rectangle { id: coloredrectangle width: 100 height: 100 border { color: black; width: 1 } property alias color: bluerectangle.color color: "red" Rectangle { id: bluerectangle color: "blue" } }
}
@The resulting rectangle is white. Why? I was expecting it to be blue.
-
alias 'colour' actually refers to the blue rectangle colour. colorrectangle should be 'red'. It will not change to blue as it is just a alias. It should have been set to red internally. Since it is not setting to 'red', I feel it is bug.