summaryrefslogtreecommitdiffstats
path: root/demos/declarative
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2011-02-17 02:58:30 (GMT)
committerMartin Jones <martin.jones@nokia.com>2011-02-17 02:58:30 (GMT)
commit712fc0b65d19d03125b79fe5385ecd0e3a314f7e (patch)
tree217f515737a0081b27bf6772d6c4ab66ca64f530 /demos/declarative
parentb82332fec19ee977eceaf2d533ee027020a474e0 (diff)
parentdee5662e0218e754d425c8960edb1e8ffd27fde6 (diff)
downloadQt-712fc0b65d19d03125b79fe5385ecd0e3a314f7e.zip
Qt-712fc0b65d19d03125b79fe5385ecd0e3a314f7e.tar.gz
Qt-712fc0b65d19d03125b79fe5385ecd0e3a314f7e.tar.bz2
Merge branch 'master' of ../qt-qml-staging
Diffstat (limited to 'demos/declarative')
-rw-r--r--demos/declarative/calculator/calculator.qml22
-rw-r--r--demos/declarative/flickr/flickr.qml2
-rw-r--r--demos/declarative/minehunt/minehunt.qml2
-rw-r--r--demos/declarative/photoviewer/PhotoViewerCore/PhotoDelegate.qml8
-rw-r--r--demos/declarative/samegame/SamegameCore/BoomBlock.qml2
-rw-r--r--demos/declarative/samegame/SamegameCore/Button.qml2
-rw-r--r--demos/declarative/samegame/SamegameCore/Dialog.qml2
-rwxr-xr-xdemos/declarative/samegame/SamegameCore/samegame.js21
-rw-r--r--demos/declarative/samegame/samegame.qml2
-rw-r--r--demos/declarative/snake/snake.qml2
-rw-r--r--demos/declarative/webbrowser/content/FlickableWebView.qml2
11 files changed, 36 insertions, 31 deletions
diff --git a/demos/declarative/calculator/calculator.qml b/demos/declarative/calculator/calculator.qml
index 13f228d..441bfb9 100644
--- a/demos/declarative/calculator/calculator.qml
+++ b/demos/declarative/calculator/calculator.qml
@@ -46,7 +46,7 @@ import "Core/calculator.js" as CalcEngine
Rectangle {
id: window
- width: 480; height: 360
+ width: 360; height: 480
color: "#282828"
property string rotateLeft: "\u2939"
@@ -63,7 +63,15 @@ Rectangle {
id: main
state: "orientation " + runtime.orientation
- width: parent.width; height: parent.height; anchors.centerIn: parent
+ property bool landscapeWindow: window.width > window.height
+ property real baseWidth: landscapeWindow ? window.height : window.width
+ property real baseHeight: landscapeWindow ? window.width : window.height
+ property real rotationDelta: landscapeWindow ? -90 : 0
+
+ rotation: rotationDelta
+ width: main.baseWidth
+ height: main.baseHeight
+ anchors.centerIn: parent
Column {
id: box; spacing: 8
@@ -132,24 +140,20 @@ Rectangle {
states: [
State {
name: "orientation " + Orientation.Landscape
- PropertyChanges { target: main; rotation: 90; width: window.height; height: window.width }
- PropertyChanges { target: rotateButton; operation: rotateLeft }
+ PropertyChanges { target: main; rotation: 90 + rotationDelta; width: main.baseHeight; height: main.baseWidth }
},
State {
name: "orientation " + Orientation.PortraitInverted
- PropertyChanges { target: main; rotation: 180; }
- PropertyChanges { target: rotateButton; operation: rotateRight }
+ PropertyChanges { target: main; rotation: 180 + rotationDelta; }
},
State {
name: "orientation " + Orientation.LandscapeInverted
- PropertyChanges { target: main; rotation: 270; width: window.height; height: window.width }
- PropertyChanges { target: rotateButton; operation: rotateLeft }
+ PropertyChanges { target: main; rotation: 270 + rotationDelta; width: main.baseHeight; height: main.baseWidth }
}
]
transitions: Transition {
SequentialAnimation {
- PropertyAction { target: rotateButton; property: "operation" }
RotationAnimation { direction: RotationAnimation.Shortest; duration: 300; easing.type: Easing.InOutQuint }
NumberAnimation { properties: "x,y,width,height"; duration: 300; easing.type: Easing.InOutQuint }
}
diff --git a/demos/declarative/flickr/flickr.qml b/demos/declarative/flickr/flickr.qml
index 11470a8..e0af466 100644
--- a/demos/declarative/flickr/flickr.qml
+++ b/demos/declarative/flickr/flickr.qml
@@ -62,7 +62,7 @@ Item {
GridView {
id: photoGridView; model: rssModel; delegate: Mobile.GridDelegate {}
- cacheBuffer: 100
+ cacheBuffer: 1000
cellWidth: (parent.width-2)/4; cellHeight: cellWidth; width: parent.width; height: parent.height
}
diff --git a/demos/declarative/minehunt/minehunt.qml b/demos/declarative/minehunt/minehunt.qml
index 1a69c95..026689b 100644
--- a/demos/declarative/minehunt/minehunt.qml
+++ b/demos/declarative/minehunt/minehunt.qml
@@ -104,7 +104,7 @@ Item {
anchors.centerIn: parent; width: parent.width - 20
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WordWrap
- text: "Minehunt will not run properly if the C++ plugin is not compiled.\n\nPlease see README."
+ text: "Minehunt demo has to be compiled to run.\n\nPlease see README."
color: "white"; font.bold: true; font.pixelSize: 14
visible: tiles == undefined
}
diff --git a/demos/declarative/photoviewer/PhotoViewerCore/PhotoDelegate.qml b/demos/declarative/photoviewer/PhotoViewerCore/PhotoDelegate.qml
index 73b8fa7..dcb1112 100644
--- a/demos/declarative/photoviewer/PhotoViewerCore/PhotoDelegate.qml
+++ b/demos/declarative/photoviewer/PhotoViewerCore/PhotoDelegate.qml
@@ -39,7 +39,7 @@
**
****************************************************************************/
-import QtQuick 1.0
+import QtQuick 1.1
import "script/script.js" as Script
Package {
@@ -61,7 +61,7 @@ Package {
BorderImage {
anchors {
- fill: border.visible ? border : placeHolder
+ fill: originalImage.status == Image.Ready ? border : placeHolder
leftMargin: -6; topMargin: -6; rightMargin: -8; bottomMargin: -8
}
source: 'images/box-shadow.png'; smooth: true
@@ -88,11 +88,11 @@ Package {
}
BusyIndicator { anchors.centerIn: parent; on: originalImage.status != Image.Ready }
Image {
- id: originalImage; smooth: true; source: "http://" + Script.getImagePath(content)
+ id: originalImage; smooth: true; source: "http://" + Script.getImagePath(content); cache: false
fillMode: Image.PreserveAspectFit; width: photoWrapper.width; height: photoWrapper.height
}
Image {
- id: hqImage; smooth: true; source: ""; visible: false
+ id: hqImage; smooth: true; source: ""; visible: false; cache: false
fillMode: Image.PreserveAspectFit; width: photoWrapper.width; height: photoWrapper.height
}
Binding {
diff --git a/demos/declarative/samegame/SamegameCore/BoomBlock.qml b/demos/declarative/samegame/SamegameCore/BoomBlock.qml
index da51230..009aeca 100644
--- a/demos/declarative/samegame/SamegameCore/BoomBlock.qml
+++ b/demos/declarative/samegame/SamegameCore/BoomBlock.qml
@@ -39,7 +39,7 @@
**
****************************************************************************/
-import QtQuick 1.0
+import QtQuick 1.1
import Qt.labs.particles 1.0
Item {
diff --git a/demos/declarative/samegame/SamegameCore/Button.qml b/demos/declarative/samegame/SamegameCore/Button.qml
index aea4e53..b2b232c 100644
--- a/demos/declarative/samegame/SamegameCore/Button.qml
+++ b/demos/declarative/samegame/SamegameCore/Button.qml
@@ -39,7 +39,7 @@
**
****************************************************************************/
-import QtQuick 1.0
+import QtQuick 1.1
Rectangle {
id: container
diff --git a/demos/declarative/samegame/SamegameCore/Dialog.qml b/demos/declarative/samegame/SamegameCore/Dialog.qml
index b11c65c..ecac475 100644
--- a/demos/declarative/samegame/SamegameCore/Dialog.qml
+++ b/demos/declarative/samegame/SamegameCore/Dialog.qml
@@ -39,7 +39,7 @@
**
****************************************************************************/
-import QtQuick 1.0
+import QtQuick 1.1
Rectangle {
id: page
diff --git a/demos/declarative/samegame/SamegameCore/samegame.js b/demos/declarative/samegame/SamegameCore/samegame.js
index 16c48c4..d7b827a 100755
--- a/demos/declarative/samegame/SamegameCore/samegame.js
+++ b/demos/declarative/samegame/SamegameCore/samegame.js
@@ -185,21 +185,22 @@ function createBlock(column,row)
// only work if the block QML is a local file. Otherwise the component will
// not be ready immediately. There is a statusChanged signal on the
// component you could use if you want to wait to load remote files.
- if (component.status == Component.Ready) {
- var dynamicObject = component.createObject(gameCanvas);
- if (dynamicObject == null) {
+ if(component.status == Component.Ready){
+ var dynamicObject = component.createObject(gameCanvas,
+ {"type": Math.floor(Math.random() * 3),
+ "x": column*gameCanvas.blockSize,
+ "width": gameCanvas.blockSize,
+ "height": gameCanvas.blockSize});
+ if(dynamicObject == null){
console.log("error creating block");
console.log(component.errorString());
return false;
}
- dynamicObject.type = Math.floor(Math.random() * 3);
- dynamicObject.x = column * gameCanvas.blockSize;
- dynamicObject.y = row * gameCanvas.blockSize;
- dynamicObject.width = gameCanvas.blockSize;
- dynamicObject.height = gameCanvas.blockSize;
+ dynamicObject.y = row*gameCanvas.blockSize;
dynamicObject.spawned = true;
- board[index(column, row)] = dynamicObject;
- } else {
+
+ board[index(column,row)] = dynamicObject;
+ }else{
console.log("error loading block component");
console.log(component.errorString());
return false;
diff --git a/demos/declarative/samegame/samegame.qml b/demos/declarative/samegame/samegame.qml
index ebb8e4a..ab64156 100644
--- a/demos/declarative/samegame/samegame.qml
+++ b/demos/declarative/samegame/samegame.qml
@@ -39,7 +39,7 @@
**
****************************************************************************/
-import QtQuick 1.0
+import QtQuick 1.1
import "SamegameCore"
import "SamegameCore/samegame.js" as Logic
diff --git a/demos/declarative/snake/snake.qml b/demos/declarative/snake/snake.qml
index 7565058..d81ce9e 100644
--- a/demos/declarative/snake/snake.qml
+++ b/demos/declarative/snake/snake.qml
@@ -105,7 +105,7 @@ Rectangle {
source: "content/pics/pause.png"
anchors.centerIn: parent;
//opacity is deliberately not animated
- opacity: activeGame && !runtime.isActiveWindow
+ opacity: activeGame && !Qt.application.active
}
Image {
diff --git a/demos/declarative/webbrowser/content/FlickableWebView.qml b/demos/declarative/webbrowser/content/FlickableWebView.qml
index 737d11f..947b843 100644
--- a/demos/declarative/webbrowser/content/FlickableWebView.qml
+++ b/demos/declarative/webbrowser/content/FlickableWebView.qml
@@ -128,7 +128,7 @@ Flickable {
if (!heuristicZoom(clickX,clickY,2.5)) {
var zf = flickable.width / contentsSize.width
if (zf >= contentsScale)
- zf = 2.0/zoomFactor // zoom in (else zooming out)
+ zf = 2.0*contentsScale // zoom in (else zooming out)
doZoom(zf,clickX*zf,clickY*zf)
}
}