diff options
Diffstat (limited to 'demos')
59 files changed, 241 insertions, 779 deletions
diff --git a/demos/declarative/calculator/CalcButton.qml b/demos/declarative/calculator/CalcButton.qml index 6210e46..a125346 100644 --- a/demos/declarative/calculator/CalcButton.qml +++ b/demos/declarative/calculator/CalcButton.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { property alias operation: label.text diff --git a/demos/declarative/calculator/calculator.qml b/demos/declarative/calculator/calculator.qml index 1644968..b8e506e 100644 --- a/demos/declarative/calculator/calculator.qml +++ b/demos/declarative/calculator/calculator.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import "calculator.js" as CalcEngine Rectangle { diff --git a/demos/declarative/flickr/common/ImageDetails.qml b/demos/declarative/flickr/common/ImageDetails.qml deleted file mode 100644 index 862eeb1..0000000 --- a/demos/declarative/flickr/common/ImageDetails.qml +++ /dev/null @@ -1,160 +0,0 @@ -import Qt 4.6 -import org.webkit 1.0 - -Flipable { - id: container - - property var frontContainer: containerFront - property string photoTitle: "" - property string photoDescription: "" - property string photoTags: "" - property int photoWidth - property int photoHeight - property string photoType - property string photoAuthor - property string photoDate - property string photoUrl - property int rating: 2 - property var prevScale: 1.0 - - signal closed - - transform: Rotation { - id: detailsRotation - origin.y: container.height / 2; - origin.x: container.width / 2; - axis.y: 1; axis.z: 0 - } - - front: Item { - id: containerFront; anchors.fill: container - - Rectangle { - anchors.fill: parent - color: "black"; opacity: 0.4 - border.color: "white"; border.width: 2 - } - - MediaButton { - id: backButton; x: 630; y: 370; text: "Back" - onClicked: { container.closed() } - } - - MediaButton { - id: moreButton; x: 530; y: 370; text: "View..." - onClicked: { container.state='Back' } - } - - Text { id: titleText; style: Text.Raised; styleColor: "black"; color: "white"; elide: Text.ElideRight - x: 220; y: 30; width: parent.width - 240; text: container.photoTitle; font.pointSize: 22 } - - LikeOMeter { x: 40; y: 250; rating: container.rating } - - Flickable { id: flickable; x: 220; width: 480; height: 210; y: 130; clip: true - contentWidth: 480; contentHeight: descriptionText.height - - WebView { id: descriptionText; width: parent.width - html: "<style TYPE=\"text/css\">body {color: white;} a:link {color: cyan; text-decoration: underline; }</style>" + container.photoDescription } - } - - Text { id: size; color: "white"; width: 300; x: 40; y: 300 - text: "<b>Size:</b> " + container.photoWidth + 'x' + container.photoHeight } - Text { id: type; color: "white"; width: 300; x: 40; anchors.top: size.bottom - text: "<b>Type:</b> " + container.photoType } - - Text { id: author; color: "white"; width: 300; x: 220; y: 80 - text: "<b>Author:</b> " + container.photoAuthor } - Text { id: date; color: "white"; width: 300; x: 220; anchors.top: author.bottom - text: "<b>Published:</b> " + container.photoDate } - Text { id: tagsLabel; color: "white"; x: 220; anchors.top: date.bottom; - text: container.photoTags == "" ? "" : "<b>Tags:</b> " } - Text { id: tags; color: "white"; width: parent.width-x-20; - anchors.left: tagsLabel.right; anchors.top: date.bottom; - elide: Text.ElideRight; text: container.photoTags } - - ScrollBar { id: scrollBar; x: 720; y: flickable.y; width: 7; height: flickable.height; opacity: 0; - flickableArea: flickable; clip: true } - } - - back: Item { - anchors.fill: container - - Rectangle { anchors.fill: parent; color: "black"; opacity: 0.4; border.color: "white"; border.width: 2 } - - Progress { anchors.centerIn: parent; width: 200; height: 18; progress: bigImage.progress; visible: bigImage.status!=1 } - Flickable { - id: flick; width: container.width - 10; height: container.height - 10 - x: 5; y: 5; clip: true; - contentWidth: imageContainer.width; contentHeight: imageContainer.height - - Item { - id: imageContainer - width: Math.max(bigImage.width * bigImage.scale, flick.width); - height: Math.max(bigImage.height * bigImage.scale, flick.height); - - Image { - id: bigImage; source: container.photoUrl; scale: slider.value - anchors.centerIn: parent; - smooth: !flick.moving - onStatusChanged : { - // Default scale shows the entire image. - if (status == 1 && width != 0) { - slider.minimum = Math.min(flick.width / width, flick.height / height); - prevScale = Math.min(slider.minimum, 1); - slider.value = prevScale; - } - } - } - } - } - - MediaButton { - id: backButton2; x: 630; y: 370; text: "Back"; onClicked: { container.state = '' } - } - Text { - text: "Image Unavailable" - visible: bigImage.status == 'Error' - anchors.centerIn: parent; color: "white"; font.bold: true - } - - Slider { - id: slider; x: 25; y: 374; visible: { bigImage.status == 1 && maximum > minimum } - onValueChanged: { - if (bigImage.width * value > flick.width) { - var xoff = (flick.width/2 + flick.contentX) * value / prevScale; - flick.contentX = xoff - flick.width/2; - } - if (bigImage.height * value > flick.height) { - var yoff = (flick.height/2 + flick.contentY) * value / prevScale; - flick.contentY = yoff - flick.height/2; - } - prevScale = value; - } - } - } - - states: [ - State { - name: "Back" - PropertyChanges { target: detailsRotation; angle: 180 } - } - ] - - transitions: [ - Transition { - SequentialAnimation { - PropertyAction { - target: bigImage - property: "smooth" - value: false - } - NumberAnimation { easing.type: "InOutQuad"; properties: "angle"; duration: 500 } - PropertyAction { - target: bigImage - property: "smooth" - value: !flick.moving - } - } - } - ] -} diff --git a/demos/declarative/flickr/common/LikeOMeter.qml b/demos/declarative/flickr/common/LikeOMeter.qml index 5ee048b..17e3998 100644 --- a/demos/declarative/flickr/common/LikeOMeter.qml +++ b/demos/declarative/flickr/common/LikeOMeter.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { id: container diff --git a/demos/declarative/flickr/common/Loading.qml b/demos/declarative/flickr/common/Loading.qml index 4c41717..8daed48 100644 --- a/demos/declarative/flickr/common/Loading.qml +++ b/demos/declarative/flickr/common/Loading.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Image { id: loading; source: "pics/loading.png" diff --git a/demos/declarative/flickr/common/MediaButton.qml b/demos/declarative/flickr/common/MediaButton.qml deleted file mode 100644 index 86ac948..0000000 --- a/demos/declarative/flickr/common/MediaButton.qml +++ /dev/null @@ -1,41 +0,0 @@ -import Qt 4.6 - -Item { - id: container - - signal clicked - - property string text - - Image { - id: buttonImage - source: "pics/button.png" - } - Image { - id: pressed - source: "pics/button-pressed.png" - opacity: 0 - } - MouseArea { - id: mouseRegion - anchors.fill: buttonImage - onClicked: { container.clicked(); } - } - Text { - font.bold: true - color: "white" - anchors.centerIn: buttonImage - text: container.text - } - width: buttonImage.width - states: [ - State { - name: "Pressed" - when: mouseRegion.pressed == true - PropertyChanges { - target: pressed - opacity: 1 - } - } - ] -} diff --git a/demos/declarative/flickr/common/MediaLineEdit.qml b/demos/declarative/flickr/common/MediaLineEdit.qml deleted file mode 100644 index 9559f6a..0000000 --- a/demos/declarative/flickr/common/MediaLineEdit.qml +++ /dev/null @@ -1,104 +0,0 @@ -import Qt 4.6 - -Item { - id: container - - property string label - property string text - - width: Math.max(94,labeltext.width + editor.width + 20) - height: buttonImage.height - - states: [ - State { - name: "Edit" - PropertyChanges { - target: labeltext - text: container.label + ": " - } - PropertyChanges { - target: labeltext - x: 10 - } - PropertyChanges { - target: editor - cursorVisible: true - width: 100 - } - PropertyChanges { - target: container - focus: true - } - StateChangeScript { - script:editor.selectAll() - } - }, - State { - // When returning to default state, typed text is propagated - StateChangeScript { - script: container.text = editor.text - } - } - ] - transitions: [ - Transition { - NumberAnimation { properties: "x,width"; duration: 500; easing.type: "InOutQuad" } - } - ] - - - BorderImage { - id: buttonImage - source: "pics/button.sci" - anchors.left: container.left - anchors.right: container.right - } - - BorderImage { - id: pressed - source: "pics/button-pressed.sci" - opacity: 0 - anchors.left: container.left - anchors.right: container.right - } - - MouseArea { - id: mouseRegion - anchors.fill: buttonImage - onClicked: { container.state = container.state=="Edit" ? "" : "Edit" } - states: [ - State { - when: mouseRegion.pressed == true - PropertyChanges { - target: pressed - opacity: 1 - } - } - ] - } - - Text { - id: labeltext - font.bold: true - color: "white" - anchors.verticalCenter: container.verticalCenter - x: (container.width - width)/2 - text: container.label + "..." - } - - TextInput { - id: editor - font.bold: true - color: "white" - selectionColor: "green" - width: 0 - clip: true - anchors.left: labeltext.right - anchors.verticalCenter: container.verticalCenter - } - Keys.forwardTo: [(returnKey), (editor)] - Item { - id: returnKey - Keys.onReturnPressed: "container.state = ''" - } -} diff --git a/demos/declarative/flickr/common/Progress.qml b/demos/declarative/flickr/common/Progress.qml index fd9be10..f4d25a4 100644 --- a/demos/declarative/flickr/common/Progress.qml +++ b/demos/declarative/flickr/common/Progress.qml @@ -1,7 +1,7 @@ -import Qt 4.6 +import Qt 4.7 Item { - property var progress: 0 + property variant progress: 0 Rectangle { anchors.fill: parent; smooth: true diff --git a/demos/declarative/flickr/common/RssModel.qml b/demos/declarative/flickr/common/RssModel.qml index ed9fd5c..d0960db 100644 --- a/demos/declarative/flickr/common/RssModel.qml +++ b/demos/declarative/flickr/common/RssModel.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 XmlListModel { property string tags : "" diff --git a/demos/declarative/flickr/common/ScrollBar.qml b/demos/declarative/flickr/common/ScrollBar.qml index feebcb0..4022d23 100644 --- a/demos/declarative/flickr/common/ScrollBar.qml +++ b/demos/declarative/flickr/common/ScrollBar.qml @@ -1,9 +1,9 @@ -import Qt 4.6 +import Qt 4.7 Item { id: container - property var flickableArea + property variant flickableArea Rectangle { radius: 5 diff --git a/demos/declarative/flickr/common/Slider.qml b/demos/declarative/flickr/common/Slider.qml index 05a87e7..4da370e 100644 --- a/demos/declarative/flickr/common/Slider.qml +++ b/demos/declarative/flickr/common/Slider.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { id: slider; width: 400; height: 16 diff --git a/demos/declarative/flickr/common/Star.qml b/demos/declarative/flickr/common/Star.qml index 748a5ec..fcca742 100644 --- a/demos/declarative/flickr/common/Star.qml +++ b/demos/declarative/flickr/common/Star.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { id: container diff --git a/demos/declarative/flickr/flickr-mobile-90.qml b/demos/declarative/flickr/flickr-90.qml index 9fec242..d1830bf 100644 --- a/demos/declarative/flickr/flickr-mobile-90.qml +++ b/demos/declarative/flickr/flickr-90.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { width: 480; height: 320 @@ -6,6 +6,6 @@ Item { Loader { y: 320; rotation: -90 transformOrigin: Item.TopLeft - source: "flickr-mobile.qml" + source: "flickr.qml" } } diff --git a/demos/declarative/flickr/flickr-desktop.qml b/demos/declarative/flickr/flickr-desktop.qml deleted file mode 100644 index 63b6ea2..0000000 --- a/demos/declarative/flickr/flickr-desktop.qml +++ /dev/null @@ -1,194 +0,0 @@ -import Qt 4.6 - -import "common" - -Item { - id: mainWindow; width: 800; height: 450 - - property bool showPathView : false - - resources: [ - Component { - id: photoDelegate - Item { - id: wrapper; width: 85; height: 85 - scale: wrapper.PathView.scale ? wrapper.PathView.scale : 1 - z: wrapper.PathView.z ? wrapper.PathView.z : 0 - - transform: Rotation { - id: itemRotation; origin.x: wrapper.width/2; origin.y: wrapper.height/2 - axis.y: 1; axis.z: 0 - angle: wrapper.PathView.angle ? wrapper.PathView.angle : 0 - } - - Connections { - target: imageDetails - onClosed: { - if (wrapper.state == 'Details') { - wrapper.state = ''; - imageDetails.photoUrl = ""; - } - } - } - - function photoClicked() { - imageDetails.photoTitle = title; - imageDetails.photoDescription = description; - imageDetails.photoTags = tags; - imageDetails.photoWidth = photoWidth; - imageDetails.photoHeight = photoHeight; - imageDetails.photoType = photoType; - imageDetails.photoAuthor = photoAuthor; - imageDetails.photoDate = photoDate; - imageDetails.photoUrl = url; - imageDetails.rating = 0; - wrapper.state = "Details"; - } - - Rectangle { - id: whiteRect; anchors.fill: parent; color: "white"; radius: 5 - - Loading { x: 26; y: 26; visible: thumb.status!=1 } - Image { id: thumb; source: imagePath; x: 5; y: 5 } - - Item { - id: shadows - Image { source: "common/pics/shadow-right.png"; x: whiteRect.width; height: whiteRect.height } - Image { source: "common/pics/shadow-bottom.png"; y: whiteRect.height; width: whiteRect.width } - Image { id: corner; source: "common/pics/shadow-corner.png"; x: whiteRect.width; y: whiteRect.height } - } - } - - MouseArea { anchors.fill: wrapper; onClicked: { photoClicked() } } - - states: [ - State { - name: "Details" - PropertyChanges { target: imageDetails; z: 2 } - ParentChange { target: wrapper; parent: imageDetails.frontContainer } - PropertyChanges { target: wrapper; x: 45; y: 35; scale: 1; z: 1000 } - PropertyChanges { target: itemRotation; angle: 0 } - PropertyChanges { target: shadows; opacity: 0 } - PropertyChanges { target: imageDetails; y: 20 } - PropertyChanges { target: photoGridView; y: -480 } - PropertyChanges { target: photoPathView; y: -480 } - PropertyChanges { target: viewModeButton; opacity: 0 } - PropertyChanges { target: tagsEdit; opacity: 0 } - PropertyChanges { target: fetchButton; opacity: 0 } - PropertyChanges { target: categoryText; y: "-50" } - } - ] - - transitions: [ - Transition { - from: "*"; to: "Details" - SequentialAnimation { - ParentAnimation { - NumberAnimation { properties: "x,y,scale,opacity,angle"; duration: 500; easing.type: "InOutQuad" } - } - } - }, - Transition { - from: "Details"; to: "*" - SequentialAnimation { - ParentAnimation { - NumberAnimation { properties: "x,y,scale,opacity,angle"; duration: 500; easing.type: "InOutQuad" } - } - PropertyAction { targets: wrapper; properties: "z" } - } - } - ] - - } - } - ] - - Item { - id: background - - anchors.fill: parent - - Image { source: "common/pics/background.png"; anchors.fill: parent } - RssModel { id: rssModel; tags : tagsEdit.text } - Loading { anchors.centerIn: parent; visible: rssModel.status == 2 } - - GridView { - id: photoGridView; model: rssModel; delegate: photoDelegate; cacheBuffer: 100 - cellWidth: 105; cellHeight: 105; x:32; y: 80; width: 800; height: 330; z: 1 - } - - PathView { - id: photoPathView; model: rssModel; delegate: photoDelegate - y: -380; width: 800; height: 330; pathItemCount: 10; z: 1 - path: Path { - startX: -50; startY: 40; - - PathAttribute { name: "scale"; value: 1 } - PathAttribute { name: "angle"; value: -45 } - - PathCubic { - x: 400; y: 220 - control1X: 140; control1Y: 40 - control2X: 210; control2Y: 220 - } - - PathAttribute { name: "scale"; value: 1.2 } - PathAttribute { name: "z"; value: 1 } - PathAttribute { name: "angle"; value: 0 } - - PathCubic { - x: 850; y: 40 - control2X: 660; control2Y: 40 - control1X: 590; control1Y: 220 - } - - PathAttribute { name: "scale"; value: 1 } - PathAttribute { name: "angle"; value: 45 } - } - - } - - ImageDetails { id: imageDetails; width: 750; x: 25; y: 500; height: 410 } - - MediaButton { - id: viewModeButton; x: 680; y: 410; text: "View Mode" - onClicked: { if (mainWindow.showPathView == true) mainWindow.showPathView = false; else mainWindow.showPathView = true } - } - - MediaButton { - id: fetchButton - text: "Update" - anchors.right: viewModeButton.left; anchors.rightMargin: 5 - anchors.top: viewModeButton.top - onClicked: { rssModel.reload(); } - } - - MediaLineEdit { - id: tagsEdit; - label: "Tags" - anchors.right: fetchButton.left; anchors.rightMargin: 5 - anchors.top: viewModeButton.top - } - - states: State { - name: "PathView" - when: mainWindow.showPathView == true - PropertyChanges { target: photoPathView; y: 80 } - PropertyChanges { target: photoGridView; y: -380 } - } - - transitions: [ - Transition { - from: "*"; to: "*" - NumberAnimation { properties: "y"; duration: 1000; easing.type: "OutBounce"; easing.amplitude: 0.5 } - } - ] - } - - Text { - id: categoryText; anchors.horizontalCenter: parent.horizontalCenter; y: 15; - text: "Flickr - " + - (rssModel.tags=="" ? "Uploads from everyone" : "Recent Uploads tagged " + rssModel.tags) - font.pointSize: 20; font.bold: true; color: "white"; style: Text.Raised; styleColor: "black" - } -} diff --git a/demos/declarative/flickr/flickr-mobile.qml b/demos/declarative/flickr/flickr.qml index 21e4c49..aa550d2 100644 --- a/demos/declarative/flickr/flickr-mobile.qml +++ b/demos/declarative/flickr/flickr.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import "common" as Common import "mobile" as Mobile diff --git a/demos/declarative/flickr/mobile/Button.qml b/demos/declarative/flickr/mobile/Button.qml index 4ba6b19..74b5aea 100644 --- a/demos/declarative/flickr/mobile/Button.qml +++ b/demos/declarative/flickr/mobile/Button.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { id: container diff --git a/demos/declarative/flickr/mobile/GridDelegate.qml b/demos/declarative/flickr/mobile/GridDelegate.qml index b54585b..5ab7b87 100644 --- a/demos/declarative/flickr/mobile/GridDelegate.qml +++ b/demos/declarative/flickr/mobile/GridDelegate.qml @@ -1,4 +1,4 @@ - import Qt 4.6 + import Qt 4.7 Component { id: photoDelegate diff --git a/demos/declarative/flickr/mobile/ImageDetails.qml b/demos/declarative/flickr/mobile/ImageDetails.qml index 2f4df8a..58b0b83 100644 --- a/demos/declarative/flickr/mobile/ImageDetails.qml +++ b/demos/declarative/flickr/mobile/ImageDetails.qml @@ -1,10 +1,10 @@ -import Qt 4.6 +import Qt 4.7 import "../common" as Common Flipable { id: container - property var frontContainer: containerFront + property variant frontContainer: containerFront property string photoTitle: "" property string photoTags: "" property int photoWidth @@ -14,7 +14,7 @@ Flipable { property string photoDate property string photoUrl property int rating: 2 - property var prevScale: 1.0 + property variant prevScale: 1.0 signal closed diff --git a/demos/declarative/flickr/mobile/ListDelegate.qml b/demos/declarative/flickr/mobile/ListDelegate.qml index 381664b..28ec3d1 100644 --- a/demos/declarative/flickr/mobile/ListDelegate.qml +++ b/demos/declarative/flickr/mobile/ListDelegate.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Component { Item { diff --git a/demos/declarative/flickr/mobile/TitleBar.qml b/demos/declarative/flickr/mobile/TitleBar.qml index e92ba59..72b779f 100644 --- a/demos/declarative/flickr/mobile/TitleBar.qml +++ b/demos/declarative/flickr/mobile/TitleBar.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { id: titleBar diff --git a/demos/declarative/flickr/mobile/ToolBar.qml b/demos/declarative/flickr/mobile/ToolBar.qml index f96c767..b29ca16 100644 --- a/demos/declarative/flickr/mobile/ToolBar.qml +++ b/demos/declarative/flickr/mobile/ToolBar.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { id: toolbar diff --git a/demos/declarative/minehunt/MinehuntCore/Explosion.qml b/demos/declarative/minehunt/MinehuntCore/Explosion.qml index 172fcc0..526cd34 100644 --- a/demos/declarative/minehunt/MinehuntCore/Explosion.qml +++ b/demos/declarative/minehunt/MinehuntCore/Explosion.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import Qt.labs.particles 1.0 Item { diff --git a/demos/declarative/minehunt/minehunt.qml b/demos/declarative/minehunt/minehunt.qml index 2ca6c4c..98955e2 100644 --- a/demos/declarative/minehunt/minehunt.qml +++ b/demos/declarative/minehunt/minehunt.qml @@ -1,190 +1,152 @@ -import Qt 4.6 +import Qt 4.7 import "MinehuntCore" 1.0 Item { id: field - width: 370 - height: 480 - - property int clickx : 0 - property int clicky : 0 - - resources: [ - Component { - id: tile - Flipable { - id: flipable - width: 40 - height: 40 - property int angle: 0; - transform: Rotation { - origin.x: 20 - origin.y: 20 - axis.x: 1 - axis.z: 0 - angle: flipable.angle; + property int clickx: 0 + property int clicky: 0 + + width: 450; height: 450 + + Component { + id: tile + + Flipable { + id: flipable + property int angle: 0 + + width: 40; height: 40 + transform: Rotation { origin.x: 20; origin.y: 20; axis.x: 1; axis.z: 0; angle: flipable.angle } + + front: Image { + source: "MinehuntCore/pics/front.png"; width: 40; height: 40 + + Image { + anchors.horizontalCenter: parent.horizontalCenter; anchors.verticalCenter: parent.verticalCenter + source: "MinehuntCore/pics/flag.png"; opacity: modelData.hasFlag + + Behavior on opacity { NumberAnimation { property: "opacity"; duration: 250 } } } - front: Image { - source: "MinehuntCore/pics/front.png" - width: 40 - height: 40 - Image { - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - source: "MinehuntCore/pics/flag.png" - opacity: modelData.hasFlag - Behavior on opacity { - NumberAnimation { - property: "opacity" - duration: 250 - } - } - } + } + + back: Image { + source: "MinehuntCore/pics/back.png" + width: 40; height: 40 + + Text { + anchors.horizontalCenter: parent.horizontalCenter; anchors.verticalCenter: parent.verticalCenter + text: modelData.hint; color: "white"; font.bold: true + opacity: !modelData.hasMine && modelData.hint > 0 } - back: Image { - source: "MinehuntCore/pics/back.png" - width: 40 - height: 40 - Text { - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - text: modelData.hint - color: "white" - font.bold: true - opacity: !modelData.hasMine && modelData.hint > 0 - } - Image { - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - source: "MinehuntCore/pics/bomb.png" - opacity: modelData.hasMine - } - Explosion { - id: expl - } + + Image { + anchors.horizontalCenter: parent.horizontalCenter; anchors.verticalCenter: parent.verticalCenter + source: "MinehuntCore/pics/bomb.png"; opacity: modelData.hasMine } - states: [ - State { - name: "back" - when: modelData.flipped - PropertyChanges { target: flipable; angle: 180 } - } - ] - transitions: [ - Transition { - SequentialAnimation { - PauseAnimation { - duration: { - var ret; - if(flipable.parent != null) - ret = Math.abs(flipable.parent.x-field.clickx) - + Math.abs(flipable.parent.y-field.clicky); - else - ret = 0; - if (ret > 0) { - if (modelData.hasMine && modelData.flipped) { - ret*3; - } else { - ret; - } - } else { - 0; - } + + Explosion { id: expl } + } + + states: State { + name: "back"; when: modelData.flipped + PropertyChanges { target: flipable; angle: 180 } + } + + transitions: Transition { + SequentialAnimation { + PauseAnimation { + duration: { + var ret + if (flipable.parent != null) + ret = Math.abs(flipable.parent.x - field.clickx) + + Math.abs(flipable.parent.y - field.clicky) + else + ret = 0 + if (ret > 0) { + if (modelData.hasMine && modelData.flipped) { + ret * 3 + } else { + ret } - } - NumberAnimation { - easing.type: "InOutQuad" - properties: "angle" - } - ScriptAction{ - script: if(modelData.hasMine && modelData.flipped){expl.explode = true;} + } else { + 0 } } } - ] - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.LeftButton | Qt.RightButton - onPressed: { - field.clickx = flipable.parent.x; - field.clicky = flipable.parent.y; - var row = Math.floor(index/9); - var col = index - (Math.floor(index/9) * 9); - if (mouse.button==undefined || mouse.button==Qt.RightButton) { - flag(row,col); - } else { - flip(row,col); - } + NumberAnimation { easing.type: "InOutQuad"; properties: "angle" } + ScriptAction { script: if (modelData.hasMine && modelData.flipped) { expl.explode = true } } + } + } + + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.LeftButton | Qt.RightButton + onClicked: { + field.clickx = flipable.parent.x + field.clicky = flipable.parent.y + var row = Math.floor(index / 9) + var col = index - (Math.floor(index / 9) * 9) + if (mouse.button == undefined || mouse.button == Qt.RightButton) { + flag(row, col) + } else { + flip(row, col) } } + onPressAndHold: { + field.clickx = flipable.parent.x + field.clicky = flipable.parent.y + var row = Math.floor(index / 9) + var col = index - (Math.floor(index / 9) * 9) + flag(row, col) + } } } - ] - Image { - source: "MinehuntCore/pics/No-Ones-Laughing-3.jpg" - fillMode: Image.Tile } - Repeater { - id: repeater - model: tiles - x: 1 - y: 1 - Component { - Loader { - sourceComponent: tile - x: (index - (Math.floor(index/9) * 9)) * 41 - y: Math.floor(index/9) * 41 - } + + Image { source: "MinehuntCore/pics/No-Ones-Laughing-3.jpg"; anchors.fill: parent; fillMode: Image.Tile } + + Grid { + anchors.horizontalCenter: parent.horizontalCenter + columns: 9; spacing: 1 + + Repeater { + id: repeater + model: tiles + Component { Loader { sourceComponent: tile } } } } + Row { id: gamedata - // width: 370 - // height: 100 - y: 400 - x: 20 - spacing: 20 + x: 20; spacing: 20 + anchors.bottom: field.bottom; anchors.bottomMargin: 15 + Column { spacing: 2 - width: childrenRect.width - Image { - // x: 100 - // y: 20 - source: "MinehuntCore/pics/bomb-color.png" - } - Text { - // x: 100 - // y: 60 - anchors.horizontalCenter: parent.horizontalCenter - color: "white" - text: numMines - } + Image { source: "MinehuntCore/pics/bomb-color.png" } + Text { anchors.horizontalCenter: parent.horizontalCenter; color: "white"; text: numMines } } + Column { spacing: 2 - width: childrenRect.width - Image { - // x: 140 - // y: 20 - source: "MinehuntCore/pics/flag-color.png" - } - Text { - // x: 140 - // y: 60 - anchors.horizontalCenter: parent.horizontalCenter - color: "white" - text: numFlags - } + Image { source: "MinehuntCore/pics/flag-color.png" } + Text { anchors.horizontalCenter: parent.horizontalCenter; color: "white"; text: numFlags } } } + Image { - y: 390 - anchors.right: field.right - anchors.rightMargin: 20 - source: isPlaying ? 'MinehuntCore/pics/face-smile.png' : hasWon ? 'MinehuntCore/pics/face-smile-big.png': 'MinehuntCore/pics/face-sad.png' - MouseArea { - anchors.fill: parent - onPressed: { reset() } - } + anchors.bottom: field.bottom; anchors.bottomMargin: 15 + anchors.right: field.right; anchors.rightMargin: 20 + source: isPlaying ? 'MinehuntCore/pics/face-smile.png' : + hasWon ? 'MinehuntCore/pics/face-smile-big.png': 'MinehuntCore/pics/face-sad.png' + + MouseArea { anchors.fill: parent; onPressed: reset() } } + Text { + anchors.fill: parent; wrapMode: Text.WordWrap + text: "Minehunt will not run properly if the C++ plugin is not compiled.\nPlease see README." + color: "white"; font.bold: true; font.pixelSize: 14 + visible: tiles == undefined + } + } diff --git a/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml b/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml index fb68cfc..b494651 100644 --- a/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml +++ b/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Component { id: albumDelegate diff --git a/demos/declarative/photoviewer/PhotoViewerCore/BusyIndicator.qml b/demos/declarative/photoviewer/PhotoViewerCore/BusyIndicator.qml index 361659c..1cad8c9 100644 --- a/demos/declarative/photoviewer/PhotoViewerCore/BusyIndicator.qml +++ b/demos/declarative/photoviewer/PhotoViewerCore/BusyIndicator.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Image { id: container diff --git a/demos/declarative/photoviewer/PhotoViewerCore/Button.qml b/demos/declarative/photoviewer/PhotoViewerCore/Button.qml index cdf86af..fd1fae9 100644 --- a/demos/declarative/photoviewer/PhotoViewerCore/Button.qml +++ b/demos/declarative/photoviewer/PhotoViewerCore/Button.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { id: container diff --git a/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml b/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml index 5ea79a1..e435425 100644 --- a/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml +++ b/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { id: container diff --git a/demos/declarative/photoviewer/PhotoViewerCore/PhotoDelegate.qml b/demos/declarative/photoviewer/PhotoViewerCore/PhotoDelegate.qml index 107aff1..391f433 100644 --- a/demos/declarative/photoviewer/PhotoViewerCore/PhotoDelegate.qml +++ b/demos/declarative/photoviewer/PhotoViewerCore/PhotoDelegate.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import "script/script.js" as Script Package { diff --git a/demos/declarative/photoviewer/PhotoViewerCore/ProgressBar.qml b/demos/declarative/photoviewer/PhotoViewerCore/ProgressBar.qml index bd6b30f..d09532e 100644 --- a/demos/declarative/photoviewer/PhotoViewerCore/ProgressBar.qml +++ b/demos/declarative/photoviewer/PhotoViewerCore/ProgressBar.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { id: container diff --git a/demos/declarative/photoviewer/PhotoViewerCore/RssModel.qml b/demos/declarative/photoviewer/PhotoViewerCore/RssModel.qml index ddbc02b..53d9819 100644 --- a/demos/declarative/photoviewer/PhotoViewerCore/RssModel.qml +++ b/demos/declarative/photoviewer/PhotoViewerCore/RssModel.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 XmlListModel { property string tags : "" diff --git a/demos/declarative/photoviewer/PhotoViewerCore/Tag.qml b/demos/declarative/photoviewer/PhotoViewerCore/Tag.qml index bf02fac..2722ac3 100644 --- a/demos/declarative/photoviewer/PhotoViewerCore/Tag.qml +++ b/demos/declarative/photoviewer/PhotoViewerCore/Tag.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Flipable { id: flipable diff --git a/demos/declarative/photoviewer/photoviewer.qml b/demos/declarative/photoviewer/photoviewer.qml index 662ea12..4094294 100644 --- a/demos/declarative/photoviewer/photoviewer.qml +++ b/demos/declarative/photoviewer/photoviewer.qml @@ -1,5 +1,5 @@ -import Qt 4.6 -import "PhotoViewerCore" 1.0 +import Qt 4.7 +import "PhotoViewerCore" Rectangle { id: mainWindow diff --git a/demos/declarative/samegame/SamegameCore/BoomBlock.qml b/demos/declarative/samegame/SamegameCore/BoomBlock.qml index b14531d..db43182 100644 --- a/demos/declarative/samegame/SamegameCore/BoomBlock.qml +++ b/demos/declarative/samegame/SamegameCore/BoomBlock.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import Qt.labs.particles 1.0 Item { id:block @@ -8,8 +8,8 @@ Item { id:block property int targetX: 0 property int targetY: 0 - SpringFollow on x { enabled: spawned; source: targetX; spring: 2; damping: 0.2 } - SpringFollow on y { source: targetY; spring: 2; damping: 0.2 } + SpringFollow on x { enabled: spawned; to: targetX; spring: 2; damping: 0.2 } + SpringFollow on y { to: targetY; spring: 2; damping: 0.2 } Image { id: img source: { diff --git a/demos/declarative/samegame/SamegameCore/Button.qml b/demos/declarative/samegame/SamegameCore/Button.qml index 6629302..9c7986b 100644 --- a/demos/declarative/samegame/SamegameCore/Button.qml +++ b/demos/declarative/samegame/SamegameCore/Button.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: container diff --git a/demos/declarative/samegame/SamegameCore/Dialog.qml b/demos/declarative/samegame/SamegameCore/Dialog.qml index 6d5d6b5..7f1189e 100644 --- a/demos/declarative/samegame/SamegameCore/Dialog.qml +++ b/demos/declarative/samegame/SamegameCore/Dialog.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: page diff --git a/demos/declarative/samegame/samegame.qml b/demos/declarative/samegame/samegame.qml index 6c58d49..94f5c24 100644 --- a/demos/declarative/samegame/samegame.qml +++ b/demos/declarative/samegame/samegame.qml @@ -1,5 +1,5 @@ -import Qt 4.6 -import "SamegameCore" 1.0 +import Qt 4.7 +import "SamegameCore" import "SamegameCore/samegame.js" as Logic Rectangle { diff --git a/demos/declarative/snake/content/Button.qml b/demos/declarative/snake/content/Button.qml index 6629302..9c7986b 100644 --- a/demos/declarative/snake/content/Button.qml +++ b/demos/declarative/snake/content/Button.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: container diff --git a/demos/declarative/snake/content/Cookie.qml b/demos/declarative/snake/content/Cookie.qml index b64987e..9fbbdf9 100644 --- a/demos/declarative/snake/content/Cookie.qml +++ b/demos/declarative/snake/content/Cookie.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import Qt.labs.particles 1.0 Item { diff --git a/demos/declarative/snake/content/HighScoreModel.qml b/demos/declarative/snake/content/HighScoreModel.qml index 076e3ff..e04f524 100644 --- a/demos/declarative/snake/content/HighScoreModel.qml +++ b/demos/declarative/snake/content/HighScoreModel.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 // Models a high score table. // diff --git a/demos/declarative/snake/content/Link.qml b/demos/declarative/snake/content/Link.qml index 4171247..8186dfd 100644 --- a/demos/declarative/snake/content/Link.qml +++ b/demos/declarative/snake/content/Link.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import Qt.labs.particles 1.0 Item { id:link diff --git a/demos/declarative/snake/content/Skull.qml b/demos/declarative/snake/content/Skull.qml index 821996a..2af8b2f 100644 --- a/demos/declarative/snake/content/Skull.qml +++ b/demos/declarative/snake/content/Skull.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Image { property bool spawned: false diff --git a/demos/declarative/snake/snake.qml b/demos/declarative/snake/snake.qml index 68c2b78..47bced4 100644 --- a/demos/declarative/snake/snake.qml +++ b/demos/declarative/snake/snake.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import "content" as Content import "content/snake.js" as Logic @@ -24,7 +24,7 @@ Rectangle { property int direction property int headDirection - property var head; + property variant head; Content.HighScoreModel { id: highScores diff --git a/demos/declarative/twitter/TwitterCore/AuthView.qml b/demos/declarative/twitter/TwitterCore/AuthView.qml index bcf4646..7986e74 100644 --- a/demos/declarative/twitter/TwitterCore/AuthView.qml +++ b/demos/declarative/twitter/TwitterCore/AuthView.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { id: wrapper @@ -24,7 +24,8 @@ Item { font.pixelSize: 16; font.bold: true color: "#151515"; selectionColor: "green" - KeyNavigation.down: passIn + KeyNavigation.tab: passIn + KeyNavigation.backtab: guest focus: true } } @@ -49,8 +50,8 @@ Item { font.pixelSize: 16; font.bold: true color: "#151515"; selectionColor: "green" - KeyNavigation.down: login - KeyNavigation.up: nameIn + KeyNavigation.tab: login + KeyNavigation.backtab: nameIn } } } @@ -69,7 +70,8 @@ Item { } text: "Log in" KeyNavigation.right: guest - KeyNavigation.up: passIn + KeyNavigation.tab: guest + KeyNavigation.backtab: passIn Keys.onReturnPressed: login.doLogin(); Keys.onSelectPressed: login.doLogin(); Keys.onSpacePressed: login.doLogin(); @@ -88,7 +90,8 @@ Item { } text: "Guest" KeyNavigation.left: login - KeyNavigation.up: passIn + KeyNavigation.tab: nameIn + KeyNavigation.backtab: login Keys.onReturnPressed: guest.doGuest(); Keys.onSelectPressed: guest.doGuest(); Keys.onSpacePressed: guest.doGuest(); diff --git a/demos/declarative/twitter/TwitterCore/Button.qml b/demos/declarative/twitter/TwitterCore/Button.qml index 4cba8c3..93f6b21 100644 --- a/demos/declarative/twitter/TwitterCore/Button.qml +++ b/demos/declarative/twitter/TwitterCore/Button.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { id: container diff --git a/demos/declarative/twitter/TwitterCore/FatDelegate.qml b/demos/declarative/twitter/TwitterCore/FatDelegate.qml index 0f013e6..62ee11a 100644 --- a/demos/declarative/twitter/TwitterCore/FatDelegate.qml +++ b/demos/declarative/twitter/TwitterCore/FatDelegate.qml @@ -1,24 +1,22 @@ -import Qt 4.6 +import Qt 4.7 Component { id: listDelegate Item { id: wrapper; width: wrapper.ListView.view.width; height: if(txt.height > 58){txt.height+8}else{58}//50+4+4 - Script { - function handleLink(link){ - if(link.slice(0,3) == 'app'){ - setUser(link.slice(7)); - screen.setMode(true); - }else if(link.slice(0,4) == 'http'){ - Qt.openUrlExternally(link); - } - } - function addTags(str){ - var ret = str.replace(/@[a-zA-Z0-9_]+/g, '<a href="app://$&">$&</a>');//click to jump to user? - var ret2 = ret.replace(/http:\/\/[^ \n\t]+/g, '<a href="$&">$&</a>');//surrounds http links with html link tags - return ret2; + function handleLink(link){ + if(link.slice(0,3) == 'app'){ + screen.setUser(link.slice(7)); + screen.setMode(true); + }else if(link.slice(0,4) == 'http'){ + Qt.openUrlExternally(link); } } + function addTags(str){ + var ret = str.replace(/@[a-zA-Z0-9_]+/g, '<a href="app://$&">$&</a>');//click to jump to user? + var ret2 = ret.replace(/http:\/\/[^ \n\t]+/g, '<a href="$&">$&</a>');//surrounds http links with html link tags + return ret2; + } Item { id: moveMe; height: parent.height Rectangle { @@ -35,11 +33,11 @@ Component { Text { id:txt; y:4; x: 56 text: '<html><style type="text/css">a:link {color:"#aaccaa"}; a:visited {color:"#336633"}</style>' + '<a href="app://@'+userScreenName+'"><b>'+userScreenName + "</b></a> from " +source - + "<br /><b>" + addTags(statusText) + "</b></html>"; + + "<br /><b>" + wrapper.addTags(statusText) + "</b></html>"; textFormat: Qt.RichText - color: "#cccccc"; style: Text.Raised; styleColor: "black"; wrap: true + color: "#cccccc"; style: Text.Raised; styleColor: "black"; wrapMode: Text.WordWrap anchors.left: whiteRect.right; anchors.right: blackRect.right; anchors.leftMargin: 6; anchors.rightMargin: 6 - onLinkActivated: handleLink(link) + onLinkActivated: wrapper.handleLink(link) } } } diff --git a/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml b/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml index a206c87..c1ae3e5 100644 --- a/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml +++ b/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { id: titleBar @@ -11,25 +11,23 @@ Item { id: container width: (parent.width * 2) - 55 ; height: parent.height - Script { - function accept() { - if(rssModel.authName == '' || rssModel.authPass == '') - return false;//Can't login like that + function accept() { + if(rssModel.authName == '' || rssModel.authPass == '') + return false;//Can't login like that - var postData = "status=" + editor.text; - var postman = new XMLHttpRequest(); - postman.open("POST", "http://twitter.com/statuses/update.xml", true, rssModel.authName, rssModel.authPass); - postman.onreadystatechange = function() { - if (postman.readyState == postman.DONE) { - titleBar.update(); - } + var postData = "status=" + editor.text; + var postman = new XMLHttpRequest(); + postman.open("POST", "http://twitter.com/statuses/update.xml", true, rssModel.authName, rssModel.authPass); + postman.onreadystatechange = function() { + if (postman.readyState == postman.DONE) { + titleBar.update(); } - postman.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - postman.send(postData); - - editor.text = "" - titleBar.state = "" } + postman.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); + postman.send(postData); + + editor.text = "" + titleBar.state = "" } Rectangle { @@ -59,7 +57,7 @@ Item { Button { id: tagButton; x: titleBar.width - 90; width: 85; height: 32; text: "New Post..." anchors.verticalCenter: parent.verticalCenter; - onClicked: if (titleBar.state == "Posting") accept(); else titleBar.state = "Posting" + onClicked: if (titleBar.state == "Posting") container.accept(); else titleBar.state = "Posting" } Text { @@ -90,13 +88,13 @@ Item { width: parent.width - 12 height: parent.height - 8 font.pointSize: 10 - wrap: true + wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere color: "#151515"; selectionColor: "green" } Keys.forwardTo: [(returnKey), (editor)] Item { id: returnKey - Keys.onReturnPressed: accept() + Keys.onReturnPressed: container.accept() Keys.onEscapePressed: titleBar.state = "" } } diff --git a/demos/declarative/twitter/TwitterCore/Loading.qml b/demos/declarative/twitter/TwitterCore/Loading.qml index 957de0f..94b77f2 100644 --- a/demos/declarative/twitter/TwitterCore/Loading.qml +++ b/demos/declarative/twitter/TwitterCore/Loading.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Image { id: loading; source: "images/loading.png" diff --git a/demos/declarative/twitter/TwitterCore/MultiTitleBar.qml b/demos/declarative/twitter/TwitterCore/MultiTitleBar.qml index e0205b8..8c27e2b 100644 --- a/demos/declarative/twitter/TwitterCore/MultiTitleBar.qml +++ b/demos/declarative/twitter/TwitterCore/MultiTitleBar.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { height: homeBar.height diff --git a/demos/declarative/twitter/TwitterCore/RssModel.qml b/demos/declarative/twitter/TwitterCore/RssModel.qml index 9d88bb7..dca8499 100644 --- a/demos/declarative/twitter/TwitterCore/RssModel.qml +++ b/demos/declarative/twitter/TwitterCore/RssModel.qml @@ -1,7 +1,7 @@ -import Qt 4.6 +import Qt 4.7 Item { id: wrapper - property var model: xmlModel + property variant model: xmlModel property string tags : "" property string authName : "" property string authPass : "" diff --git a/demos/declarative/twitter/TwitterCore/TitleBar.qml b/demos/declarative/twitter/TwitterCore/TitleBar.qml index 149aa82..87ceec5 100644 --- a/demos/declarative/twitter/TwitterCore/TitleBar.qml +++ b/demos/declarative/twitter/TwitterCore/TitleBar.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { id: titleBar @@ -11,12 +11,10 @@ Item { id: container width: (parent.width * 2) - 55 ; height: parent.height - Script { - function accept() { - titleBar.state = "" - background.state = "" - rssModel.tags = editor.text - } + function accept() { + titleBar.state = "" + background.state = "" + rssModel.tags = editor.text } Text { @@ -33,7 +31,7 @@ Item { Button { id: tagButton; x: titleBar.width - 50; width: 45; height: 32; text: "..." - onClicked: if (titleBar.state == "Tags") accept(); else titleBar.state = "Tags" + onClicked: if (titleBar.state == "Tags") container.accept(); else titleBar.state = "Tags" anchors.verticalCenter: parent.verticalCenter } @@ -58,7 +56,7 @@ Item { Item { id: returnKey - Keys.onReturnPressed: accept() + Keys.onReturnPressed: container.accept() Keys.onEscapePressed: titleBar.state = "" } } diff --git a/demos/declarative/twitter/TwitterCore/ToolBar.qml b/demos/declarative/twitter/TwitterCore/ToolBar.qml index f96c767..b29ca16 100644 --- a/demos/declarative/twitter/TwitterCore/ToolBar.qml +++ b/demos/declarative/twitter/TwitterCore/ToolBar.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { id: toolbar diff --git a/demos/declarative/twitter/TwitterCore/UserModel.qml b/demos/declarative/twitter/TwitterCore/UserModel.qml index c146b84..8a8eb7b 100644 --- a/demos/declarative/twitter/TwitterCore/UserModel.qml +++ b/demos/declarative/twitter/TwitterCore/UserModel.qml @@ -1,10 +1,10 @@ -import Qt 4.6 +import Qt 4.7 //This "model" gets the user information about the searched user. Mainly for the icon. //Copied from RssModel Item { id: wrapper - property var model: xmlModel + property variant model: xmlModel property string user : "" property int status: xmlModel.status function reload() { xmlModel.reload(); } diff --git a/demos/declarative/twitter/twitter.qml b/demos/declarative/twitter/twitter.qml index 94d53f1..0e3ec3e 100644 --- a/demos/declarative/twitter/twitter.qml +++ b/demos/declarative/twitter/twitter.qml @@ -1,10 +1,10 @@ -import Qt 4.6 +import Qt 4.7 import "TwitterCore" 1.0 as Twitter Item { id: screen; width: 320; height: 480 property bool userView : false - property var tmpStr + property variant tmpStr function setMode(m){ screen.userView = m; if(m == false){ @@ -15,12 +15,11 @@ Item { toolBar.button2Label = "Return home"; } } + function setUser(str){hack.running = true; tmpStr = str} + function reallySetUser(){rssModel.tags = tmpStr;} + //Workaround for bug 260266 - Timer{ interval: 1; running: false; repeat: false; onTriggered: reallySetUser(); id:hack } - Script { - function setUser(str){hack.running = true; tmpStr = str} - function reallySetUser(){rssModel.tags = tmpStr;} - } + Timer{ interval: 1; running: false; repeat: false; onTriggered: screen.reallySetUser(); id:hack } //TODO: better way to return to the auth screen Keys.onEscapePressed: rssModel.authName='' @@ -35,7 +34,7 @@ Item { Text { width: 180 text: "Could not access twitter using this screen name and password pair."; - color: "#cccccc"; style: Text.Raised; styleColor: "black"; wrap: true + color: "#cccccc"; style: Text.Raised; styleColor: "black"; wrapMode: Text.WordWrap visible: rssModel.status==XmlListModel.Error; anchors.centerIn: parent } diff --git a/demos/declarative/webbrowser/content/FlickableWebView.qml b/demos/declarative/webbrowser/content/FlickableWebView.qml index 759cff6..81904c6 100644 --- a/demos/declarative/webbrowser/content/FlickableWebView.qml +++ b/demos/declarative/webbrowser/content/FlickableWebView.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import org.webkit 1.0 Flickable { diff --git a/demos/declarative/webbrowser/content/RectSoftShadow.qml b/demos/declarative/webbrowser/content/RectSoftShadow.qml index 5b6d4ec..53d098c 100644 --- a/demos/declarative/webbrowser/content/RectSoftShadow.qml +++ b/demos/declarative/webbrowser/content/RectSoftShadow.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { BorderImage { diff --git a/demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml b/demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml index 46dbc98..f5bfadf 100644 --- a/demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml +++ b/demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import "fieldtext" diff --git a/demos/declarative/webbrowser/content/fieldtext/FieldText.qml b/demos/declarative/webbrowser/content/fieldtext/FieldText.qml index 1da9219..d1d003f 100644 --- a/demos/declarative/webbrowser/content/fieldtext/FieldText.qml +++ b/demos/declarative/webbrowser/content/fieldtext/FieldText.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { id: fieldText diff --git a/demos/declarative/webbrowser/webbrowser.qml b/demos/declarative/webbrowser/webbrowser.qml index b6cccb0..fbbe7b2 100644 --- a/demos/declarative/webbrowser/webbrowser.qml +++ b/demos/declarative/webbrowser/webbrowser.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import org.webkit 1.0 import "content" diff --git a/demos/demos.pro b/demos/demos.pro index 013d40f..5e8a4ea 100644 --- a/demos/demos.pro +++ b/demos/demos.pro @@ -1,4 +1,6 @@ TEMPLATE = subdirs + +!contains(QT_CONFIG, no-gui) { SUBDIRS = \ demos_shared \ demos_deform \ @@ -104,3 +106,4 @@ demos_sub-attaq.subdir = sub-attaq demos_arthurplugin.depends = demos_shared demos_pathstroke.depends = demos_shared } +} |