[Qt-qml] property initialization defect

aaron.kennedy at nokia.com aaron.kennedy at nokia.com
Fri Sep 17 12:49:32 CEST 2010


Hi,

Thats a bug - please file a bug report.

Cheers,

Aaron

On 17/09/2010, at 8:45 PM, "Jokela Pekka.E (Nokia-MS/Tampere)" <Pekka.E.Jokela at nokia.com<mailto:Pekka.E.Jokela at nokia.com>> wrote:


Hi,
I have a problem of overriding the initial value of a property. Let’s assume we want to use the Button component in an application as:

Button.qml:
Item {
    property string text: “A”

    Component.onCompleted: {
        console.log( "Button::onCompleted " + text )
    }
}

MyApp.qml:
Window {
    Button {
        text: “B”
    }
}

This prints out “B” as expected. But when I change the property initialization in button.qml to
property string text: {“A”} // or
property string text: getInitialValue() // which returns “A”

The output is “A”. Is a defect or a “feature”?

Thanks,
-Pekka


_______________________________________________
Qt-qml mailing list
Qt-qml at trolltech.com<mailto:Qt-qml at trolltech.com>
http://lists.trolltech.com/mailman/listinfo/qt-qml
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20100917/d8ebe748/attachment.html 


More information about the Qt-qml mailing list