Bug 325251 - Setting transform property without square brackets does not work
Summary: Setting transform property without square brackets does not 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 12:06 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 12:06:23 UTC
The "transform" property, like the "states" property, is a list property. If the list has only one element, the square brackets are optional.
QmlWeb however doesn't recognize a transform if the square brackets are missing. Testcase:

import QtQuick 2.0

Rectangle {
    id: root
    width: 300
    height: 300
    color: "blue"

    Rectangle {
        width: 50
        height: 50
        anchors.centerIn: parent

        transform: Rotation {
            angle: 45
        }
    }
}


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

Refacture object creation & property type handling

This commit brings a refactoring of how
- the meta code from the parser looks like (it's now using javascript
  constructors more extensively)
- QML elements are constructed (mostly moving code around)
- property values are assigned to the properties. Now each property has a
  proper type and the new value will be passed to a constructor to match the
  type. This considers basic types like integer, strings, colors and lists as
  well as  object types like Item, Rectangle or Component (assigning a Rectangle
  to an Item-property is handled correctly (create a rectangle) as well as
  assigning it to a component (create a component)).

Moreover property values are now assigned to the properties during the object
construction. Bindings are assigned but not evaluated. The evaluation happens in
a second run after all objects are created (prior all property values were
assigned here). This fixes context problems with object type properties (like
states) in conjunction with components (see last commit) and fixes the issue
that those objects were created multiple times.

M  +21   -24   src/parser.js
M  +512  -591  src/qtcore.js

http://commits.kde.org/qmlweb/66a3a450a0aceb82a664a1b92262a3b8cb2d052e