summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-05-01 08:24:14 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-05-01 08:24:14 (GMT)
commitafd8fd8cbf0ae3f7d7febc4f4a00628c7bd5c541 (patch)
tree42e1450324edac2c29eccdb4f3b391c8954b08e9
parentf5e2c51efd24445e46c3dcad30e9137b1beecc1d (diff)
downloadQt-afd8fd8cbf0ae3f7d7febc4f4a00628c7bd5c541.zip
Qt-afd8fd8cbf0ae3f7d7febc4f4a00628c7bd5c541.tar.gz
Qt-afd8fd8cbf0ae3f7d7febc4f4a00628c7bd5c541.tar.bz2
Use QML properties syntax
-rw-r--r--demos/declarative/calculator/CalcButton.qml10
-rw-r--r--demos/declarative/phonebrowser/content/LikeOMeter.qml6
-rw-r--r--demos/declarative/phonebrowser/content/MediaButton.qml5
-rw-r--r--demos/declarative/phonebrowser/content/PhoneInfoContainer.qml16
-rw-r--r--demos/declarative/phonebrowser/content/ScrollBar.qml5
-rw-r--r--demos/declarative/phonebrowser/content/Star.qml8
-rw-r--r--demos/declarative/phonebrowser/phonebrowser.qml2
-rw-r--r--demos/declarative/webbrowser/webbrowser.qml30
-rw-r--r--examples/declarative/dial/DialLibrary/Dial.qml8
-rw-r--r--examples/declarative/follow/pong.qml8
-rw-r--r--examples/declarative/listview/content/MediaButton.qml5
-rw-r--r--examples/declarative/listview/recipes.qml7
-rw-r--r--examples/declarative/minehunt/Description.qml4
-rw-r--r--examples/declarative/minehunt/Explosion.qml7
-rw-r--r--examples/declarative/minehunt/minehunt.qml14
-rw-r--r--examples/declarative/scrollbar/ScrollBar.qml14
-rw-r--r--examples/declarative/slideswitch/Switch.qml6
-rw-r--r--examples/declarative/tutorials/contacts/1_Drawing_and_Animation/GroupBox.qml10
-rw-r--r--examples/declarative/tutorials/contacts/2_Reuse/3/Contact.qml1
-rw-r--r--examples/declarative/tutorials/helloworld/t2/Cell.qml6
-rw-r--r--examples/declarative/tutorials/helloworld/t3/Cell.qml5
-rw-r--r--examples/declarative/velocity/Day.qml10
-rw-r--r--examples/declarative/webview/content/SpinSquare.qml11
23 files changed, 68 insertions, 130 deletions
diff --git a/demos/declarative/calculator/CalcButton.qml b/demos/declarative/calculator/CalcButton.qml
index f4ccdae..8203710 100644
--- a/demos/declarative/calculator/CalcButton.qml
+++ b/demos/declarative/calculator/CalcButton.qml
@@ -1,11 +1,9 @@
Item {
- id: Button; width: 50; height: 30
+ property string operation
+ property bool toggable : false
+ property bool toggled : false
- properties: [
- Property { name: "operation"; type: "string" },
- Property { name: "toggable"; value: false },
- Property { name: "toggled"; value: false }
- ]
+ id: Button; width: 50; height: 30
Script {
function buttonClicked(operation) {
diff --git a/demos/declarative/phonebrowser/content/LikeOMeter.qml b/demos/declarative/phonebrowser/content/LikeOMeter.qml
index 31b8195..d928f48 100644
--- a/demos/declarative/phonebrowser/content/LikeOMeter.qml
+++ b/demos/declarative/phonebrowser/content/LikeOMeter.qml
@@ -1,9 +1,7 @@
Item {
+ property var rating : 2
+
id: Container
- properties: Property {
- name: "rating"
- value: 2
- }
HorizontalLayout {
Star {
rating: 0
diff --git a/demos/declarative/phonebrowser/content/MediaButton.qml b/demos/declarative/phonebrowser/content/MediaButton.qml
index bb2510a..7aec2e4 100644
--- a/demos/declarative/phonebrowser/content/MediaButton.qml
+++ b/demos/declarative/phonebrowser/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/demos/declarative/phonebrowser/content/PhoneInfoContainer.qml b/demos/declarative/phonebrowser/content/PhoneInfoContainer.qml
index da475b1..597c3ee 100644
--- a/demos/declarative/phonebrowser/content/PhoneInfoContainer.qml
+++ b/demos/declarative/phonebrowser/content/PhoneInfoContainer.qml
@@ -1,15 +1,13 @@
Flipable {
id: Container
- properties: [
- Property { name: "frontContainer"; value: ContainerFront },
- Property { name: "flickableArea"; value: Flickable },
- Property { name: "phoneTitle"; value: "N/A" },
- Property { name: "phoneDescription"; value: "..." },
- Property { name: "phoneSpecifications"; value: "" },
- Property { name: "phoneUrl"; value: "" },
- Property { name: "rating"; value: 2 }
- ]
+ property var frontContainer : ContainerFront
+ property var flickableArea : Flickable
+ property var phoneTitle : "N/A"
+ property var phoneDescription : "..."
+ property var phoneSpecifications : ""
+ property var phoneUrl : ""
+ property var rating : 2
signals: Signal { name: "closed" }
diff --git a/demos/declarative/phonebrowser/content/ScrollBar.qml b/demos/declarative/phonebrowser/content/ScrollBar.qml
index a0f2925..e65f92f 100644
--- a/demos/declarative/phonebrowser/content/ScrollBar.qml
+++ b/demos/declarative/phonebrowser/content/ScrollBar.qml
@@ -1,8 +1,7 @@
Item {
+ property var flickableArea
+
id: Container
- properties: Property {
- name: "flickableArea"
- }
Rect {
radius: 5
color: "black"
diff --git a/demos/declarative/phonebrowser/content/Star.qml b/demos/declarative/phonebrowser/content/Star.qml
index ebcd78b..d53c529 100644
--- a/demos/declarative/phonebrowser/content/Star.qml
+++ b/demos/declarative/phonebrowser/content/Star.qml
@@ -1,13 +1,11 @@
Item {
+ property var rating
+ property var on
+
id: Container
width: 24
height: 24
- properties: [
- Property { name: "rating" },
- Property { name: "on" }
- ]
-
signals: Signal {
name: "clicked"
}
diff --git a/demos/declarative/phonebrowser/phonebrowser.qml b/demos/declarative/phonebrowser/phonebrowser.qml
index 85d352d..ce74367 100644
--- a/demos/declarative/phonebrowser/phonebrowser.qml
+++ b/demos/declarative/phonebrowser/phonebrowser.qml
@@ -3,7 +3,7 @@ import "content"
Item {
id: MainWindow; width: 800; height: 480
- properties: Property { name: "minimized"; value: false }
+ property var minimized : false
Item {
id: Background
diff --git a/demos/declarative/webbrowser/webbrowser.qml b/demos/declarative/webbrowser/webbrowser.qml
index 709d649..c754543 100644
--- a/demos/declarative/webbrowser/webbrowser.qml
+++ b/demos/declarative/webbrowser/webbrowser.qml
@@ -3,10 +3,7 @@ import "content"
Item {
id: WebBrowser
- properties: Property {
- name: "url"
- value: "http://www.qtsoftware.com"
- }
+ property var url : "http://www.qtsoftware.com"
width: 640
height: 480
@@ -163,11 +160,8 @@ Item {
onClicked: { proxy.focus=true }
}
}
- properties: Property {
- name: "progressOff"
- value: 1
- type: "Real"
- }
+
+ property real progressOff : 1
states: [
State {
name: "Normal"
@@ -210,16 +204,8 @@ Item {
anchors.left: parent.left
anchors.right: parent.right
- properties: Property {
- name: "centerX"
- value: 0
- type: "Real"
- }
- properties: Property {
- name: "centerY"
- value: 0
- type: "Real"
- }
+ property real centerX : 0
+ property real centerY : 0
WebView {
id: WebView
@@ -237,11 +223,7 @@ Item {
onUrlChanged: { Flick.xPosition=0; Flick.yPosition=0; zoomOut() }
onDoubleClick: { toggleZoom() }
- properties: Property {
- name: "zoomedOut"
- type: "real"
- value: 1
- }
+ property real zoomedOut : 1
}
Rect {
id: WebViewTint
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