Bug 325247 - property aliases on objects don't work
Summary: property aliases on objects don't work
Status: RESOLVED FIXED
Alias: None
Product: QmlWeb
Classification: Frameworks and Libraries
Component: QML-Parser (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Anton Kreuzkamp
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-24 11:56 UTC by Thomas McGuire
Modified: 2014-02-13 19:58 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas McGuire 2013-09-24 11:56:44 UTC
A property alias on an object, like a Timer, does not work. See the following QML code for a testcase.

import QtQuick 2.0

Rectangle {
    id: root
    width: 300
    height: 300

    property bool foo: true
    color: foo ? "blue" : "red"

    Item {
        id: myItem
        property alias timer: myTimer

        Timer {
            id: myTimer

            interval: 100
            repeat: true
            running: false

            onTriggered: root.foo = !root.foo
        }
    }

    MouseArea {
        anchors.fill: parent
        onClicked: myItem.timer.start(); // broken
        //onClicked: myTimer.start(); // works
    }
}


Reproducible: Always
Comment 1 Anton Kreuzkamp 2014-02-13 19:58:33 UTC
Git commit f930ec41d15973c03008bbca070e2c344f5c209b by Anton Kreuzkamp.
Committed on 13/01/2014 at 13:33.
Pushed by akreuzkamp into branch 'master'.

Refacture context handling.

This commit contains a complete rewrite of the context handling stuff in QmlWeb.
Now the context is a handles as a stack of all component contexts above, to
reflect how QML actually works.

Moreover now the root QML Item won't be a child of the DOM-node the user gives,
but it will take that node as its DOM-node, reducing the number of DOM-nodes
used. Also now the root element won't be able to use "anchors.centerIn: parent"
anymore, as it does not have a parent anymore (it doesn't have one in Qt as
well). Instead now the implicitWidth and implicitHeight of the root element is
set to reflect the size of the root DOM-node resp. the window size.

This commit brings in a bug with e.g. states in conjunction with components.
Look for the next commit for a fix.

M  +4    -2    src/parser.js
M  +127  -223  src/qtcore.js
M  +5    -7    test/testpad/easing.qml
M  +2    -1    test/testpad/repeater.qml
M  +4    -4    test/testpad/viewer.html

http://commits.kde.org/qmlweb/f930ec41d15973c03008bbca070e2c344f5c209b