diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-05-01 08:24:14 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-05-01 08:24:14 (GMT) |
commit | afd8fd8cbf0ae3f7d7febc4f4a00628c7bd5c541 (patch) | |
tree | 42e1450324edac2c29eccdb4f3b391c8954b08e9 /examples | |
parent | f5e2c51efd24445e46c3dcad30e9137b1beecc1d (diff) | |
download | Qt-afd8fd8cbf0ae3f7d7febc4f4a00628c7bd5c541.zip Qt-afd8fd8cbf0ae3f7d7febc4f4a00628c7bd5c541.tar.gz Qt-afd8fd8cbf0ae3f7d7febc4f4a00628c7bd5c541.tar.bz2 |
Use QML properties syntax
Diffstat (limited to 'examples')
-rw-r--r-- | examples/declarative/dial/DialLibrary/Dial.qml | 8 | ||||
-rw-r--r-- | examples/declarative/follow/pong.qml | 8 | ||||
-rw-r--r-- | examples/declarative/listview/content/MediaButton.qml | 5 | ||||
-rw-r--r-- | examples/declarative/listview/recipes.qml | 7 | ||||
-rw-r--r-- | examples/declarative/minehunt/Description.qml | 4 | ||||
-rw-r--r-- | examples/declarative/minehunt/Explosion.qml | 7 | ||||
-rw-r--r-- | examples/declarative/minehunt/minehunt.qml | 14 | ||||
-rw-r--r-- | examples/declarative/scrollbar/ScrollBar.qml | 14 | ||||
-rw-r--r-- | examples/declarative/slideswitch/Switch.qml | 6 | ||||
-rw-r--r-- | examples/declarative/tutorials/contacts/1_Drawing_and_Animation/GroupBox.qml | 10 | ||||
-rw-r--r-- | examples/declarative/tutorials/contacts/2_Reuse/3/Contact.qml | 1 | ||||
-rw-r--r-- | examples/declarative/tutorials/helloworld/t2/Cell.qml | 6 | ||||
-rw-r--r-- | examples/declarative/tutorials/helloworld/t3/Cell.qml | 5 | ||||
-rw-r--r-- | examples/declarative/velocity/Day.qml | 10 | ||||
-rw-r--r-- | examples/declarative/webview/content/SpinSquare.qml | 11 |
15 files changed, 41 insertions, 75 deletions
diff --git a/examples/declarative/dial/DialLibrary/Dial.qml b/examples/declarative/dial/DialLibrary/Dial.qml index fe8528d..485188a 100644 --- a/examples/declarative/dial/DialLibrary/Dial.qml +++ b/examples/declarative/dial/DialLibrary/Dial.qml @@ -1,11 +1,9 @@ Item { + property real value : 0 + width: 210 height: 210 - properties: Property { - name: "value" - type: "real" - value: 0 - } + Image { id: Background source: "background.svg" diff --git a/examples/declarative/follow/pong.qml b/examples/declarative/follow/pong.qml index 32ee049..582b04c 100644 --- a/examples/declarative/follow/pong.qml +++ b/examples/declarative/follow/pong.qml @@ -5,14 +5,14 @@ Rect { // Make a ball to bounce Rect { + // Add a property for the target y coordinate + property var targetY : Page.height-10 + property var direction : "right" + id: Ball color: "#00ee00" x: 20; width: 20; height: 20; z: 1 - // Add a property for the target y coordinate - properties: Property { name: "targetY"; value: Page.height-10 } - properties: Property { name: "direction"; value: "right" } - // Move the ball to the right and back to the left repeatedly x: SequentialAnimation { running: true; repeat: true diff --git a/examples/declarative/listview/content/MediaButton.qml b/examples/declarative/listview/content/MediaButton.qml index bb2510a..7aec2e4 100644 --- a/examples/declarative/listview/content/MediaButton.qml +++ b/examples/declarative/listview/content/MediaButton.qml @@ -1,11 +1,10 @@ Item { + property var text + id: Container signals: Signal { name: "clicked" } - properties: Property { - name: "text" - } Image { id: Image source: "pics/button.png" diff --git a/examples/declarative/listview/recipes.qml b/examples/declarative/listview/recipes.qml index db8604e..8863d1c 100644 --- a/examples/declarative/listview/recipes.qml +++ b/examples/declarative/listview/recipes.qml @@ -18,11 +18,8 @@ Rect { // We can bind multiple element's opacity to this one property, // rather than having a "SetProperty" line for each element we // want to fade. - properties: Property { - name: "detailsOpacity" - value: 0 - type: "real" - } + property real detailsOpacity : 0 + // A simple rounded rectangle for the background Rect { id: background diff --git a/examples/declarative/minehunt/Description.qml b/examples/declarative/minehunt/Description.qml index f59c8f9..0241ae5 100644 --- a/examples/declarative/minehunt/Description.qml +++ b/examples/declarative/minehunt/Description.qml @@ -1,9 +1,7 @@ Item { id: Page height: MyText.height + 20 - properties: Property { - name: "text" - } + property var text MouseRegion { anchors.fill: parent drag.target: Page diff --git a/examples/declarative/minehunt/Explosion.qml b/examples/declarative/minehunt/Explosion.qml index 8d868bc..2886559 100644 --- a/examples/declarative/minehunt/Explosion.qml +++ b/examples/declarative/minehunt/Explosion.qml @@ -1,9 +1,6 @@ Item { - properties: Property { - name: "explode" - type: "Bool" - value: false - } + property bool explode : false + Particles { width: 38 height: 21 diff --git a/examples/declarative/minehunt/minehunt.qml b/examples/declarative/minehunt/minehunt.qml index cde2612..58397b0 100644 --- a/examples/declarative/minehunt/minehunt.qml +++ b/examples/declarative/minehunt/minehunt.qml @@ -2,16 +2,10 @@ Item { id: field width: 370 height: 480 - properties: Property { - name: "clickx" - type: "Int" - value: 0 - } - properties: Property { - name: "clicky" - type: "Int" - value: 0 - } + + property int clickx : 0 + property int clicky : 0 + resources: [ Component { id: tile diff --git a/examples/declarative/scrollbar/ScrollBar.qml b/examples/declarative/scrollbar/ScrollBar.qml index e3ca0c2..929c72a 100644 --- a/examples/declarative/scrollbar/ScrollBar.qml +++ b/examples/declarative/scrollbar/ScrollBar.qml @@ -5,16 +5,10 @@ Item { // height of the page, i.e. a pageSize of 0.5 means that you can see 50% // of the height of the view. // orientation can be either 'Vertical' or 'Horizontal' - properties: Property { - name: "position" - } - properties: Property { - name: "pageSize" - } - properties: Property { - name: "orientation" - value: "Vertical" - } + property var position + property var pageSize + property var orientation : "Vertical" + // A light, semi-transparent background Rect { id: Background diff --git a/examples/declarative/slideswitch/Switch.qml b/examples/declarative/slideswitch/Switch.qml index 3ae7a0f..6777277 100644 --- a/examples/declarative/slideswitch/Switch.qml +++ b/examples/declarative/slideswitch/Switch.qml @@ -2,9 +2,9 @@ Item { id: Switch width: Groove.width height: Groove.height - properties: Property { - name: "on" - } + + property var on + Script { function toggle() { diff --git a/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/GroupBox.qml b/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/GroupBox.qml index 665c072..edaae72 100644 --- a/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/GroupBox.qml +++ b/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/GroupBox.qml @@ -2,12 +2,10 @@ FocusRealm { id: groupBox width: Math.max(270, subItem.width+40) height: Math.max(70, subItem.height+40) - properties: Property { - name: "contents" - } - properties: Property { - name: "label" - } + + property var contents + property var label + Rect { id: wrapper x: 5 diff --git a/examples/declarative/tutorials/contacts/2_Reuse/3/Contact.qml b/examples/declarative/tutorials/contacts/2_Reuse/3/Contact.qml index 33ac627..23560ce 100644 --- a/examples/declarative/tutorials/contacts/2_Reuse/3/Contact.qml +++ b/examples/declarative/tutorials/contacts/2_Reuse/3/Contact.qml @@ -2,6 +2,7 @@ Item { id: contactDetails width: 230 height: layout.height + properties: Property { name: "contactid" value: "" diff --git a/examples/declarative/tutorials/helloworld/t2/Cell.qml b/examples/declarative/tutorials/helloworld/t2/Cell.qml index bd5bbe7..0109251 100644 --- a/examples/declarative/tutorials/helloworld/t2/Cell.qml +++ b/examples/declarative/tutorials/helloworld/t2/Cell.qml @@ -1,10 +1,10 @@ Item { + property var color + id: CellContainer width: 40 height: 25 - properties: Property { - name: "color" - } + Rect { anchors.fill: parent color: CellContainer.color diff --git a/examples/declarative/tutorials/helloworld/t3/Cell.qml b/examples/declarative/tutorials/helloworld/t3/Cell.qml index bd5bbe7..e779406 100644 --- a/examples/declarative/tutorials/helloworld/t3/Cell.qml +++ b/examples/declarative/tutorials/helloworld/t3/Cell.qml @@ -1,10 +1,9 @@ Item { + property var color + id: CellContainer width: 40 height: 25 - properties: Property { - name: "color" - } Rect { anchors.fill: parent color: CellContainer.color diff --git a/examples/declarative/velocity/Day.qml b/examples/declarative/velocity/Day.qml index 7d26e88..c70a211 100644 --- a/examples/declarative/velocity/Day.qml +++ b/examples/declarative/velocity/Day.qml @@ -1,16 +1,12 @@ Rect { + property string day + property var stickies + width: 400 height: 500 radius: 7 pen.color: "black" id: Page - properties: Property { - name: "day" - type: "string" - } - properties: Property { - name: "stickies" - } Image { x: 10 y: 10 diff --git a/examples/declarative/webview/content/SpinSquare.qml b/examples/declarative/webview/content/SpinSquare.qml index 5c14506..5e4735e 100644 --- a/examples/declarative/webview/content/SpinSquare.qml +++ b/examples/declarative/webview/content/SpinSquare.qml @@ -1,13 +1,8 @@ Item { + properties var period : 250 + properties var color : "black" id: Root - properties: Property { - name: "period" - value: 250 - } - properties: Property { - name: "color" - value: "black" - } + Item { x: Root.width/2 y: Root.height/2 |