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 /demos/declarative | |
parent | f5e2c51efd24445e46c3dcad30e9137b1beecc1d (diff) | |
download | Qt-afd8fd8cbf0ae3f7d7febc4f4a00628c7bd5c541.zip Qt-afd8fd8cbf0ae3f7d7febc4f4a00628c7bd5c541.tar.gz Qt-afd8fd8cbf0ae3f7d7febc4f4a00628c7bd5c541.tar.bz2 |
Use QML properties syntax
Diffstat (limited to 'demos/declarative')
8 files changed, 27 insertions, 55 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 |