summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-06-08 17:08:33 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-06-08 17:08:33 (GMT)
commit00b157dc4aad203e78b8e4d821470a1d01a195c0 (patch)
treee7756c85df4a4dd4dbac715173c44da4e71f39f3 /demos
parent2ae808a23ce05bf9768ad9df107c16bb0c555ee7 (diff)
parente5567b2e0513f5a03987f78df2d565c0e6c6a951 (diff)
downloadQt-00b157dc4aad203e78b8e4d821470a1d01a195c0.zip
Qt-00b157dc4aad203e78b8e4d821470a1d01a195c0.tar.gz
Qt-00b157dc4aad203e78b8e4d821470a1d01a195c0.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: (25 commits) Fix snake demo Add qmlmethod Item::childAt() to delarative item Cursor positioning in QTextDocument after undo() Fix slow network access in qmlviewer (Windows) Don't layout multiple times when an ancestor becomes (in)visible. Add an example of animated item add/remove in ListView Add test for PropertyChanges with attached properties. Make declarative autotests compile on Symbian abld build system Accept enter key in the webbrower demo url input. Keep reported point/pixel size in sync. Remove unnecessary CloseSoftwareInputPanel events after TextEdit or TextInput has lost focus Ensure state operations assigned to the default state are triggered Add image example. Fix regression in input panel autotests Improve docs about Qml component case sensitivity. Add some performance tips to QML docs. Move QListModelInterface into util. Ensure ParticleMotionGravity always pulls in the right direction. Remove version ifdefs from Particles; only 4.7 is supported. Update docs for the runtime.orientation values ...
Diffstat (limited to 'demos')
-rw-r--r--demos/declarative/flickr/mobile/TitleBar.qml2
-rw-r--r--demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml2
-rw-r--r--demos/declarative/samegame/SamegameCore/Dialog.qml5
-rw-r--r--demos/declarative/samegame/samegame.qml20
-rw-r--r--demos/declarative/snake/content/HighScoreModel.qml2
-rw-r--r--demos/declarative/snake/content/snake.js1
-rw-r--r--demos/declarative/snake/snake.qml12
-rw-r--r--demos/declarative/twitter/TwitterCore/HomeTitleBar.qml2
-rw-r--r--demos/declarative/twitter/TwitterCore/TitleBar.qml2
-rw-r--r--demos/declarative/twitter/twitter.qml5
-rw-r--r--demos/declarative/webbrowser/content/UrlInput.qml4
11 files changed, 44 insertions, 13 deletions
diff --git a/demos/declarative/flickr/mobile/TitleBar.qml b/demos/declarative/flickr/mobile/TitleBar.qml
index da144d4..c7e1a53 100644
--- a/demos/declarative/flickr/mobile/TitleBar.qml
+++ b/demos/declarative/flickr/mobile/TitleBar.qml
@@ -118,7 +118,7 @@ Item {
name: "Tags"
PropertyChanges { target: container; x: -tagButton.x + 5 }
PropertyChanges { target: tagButton; text: "OK" }
- PropertyChanges { target: lineEdit; focus: true }
+ PropertyChanges { target: editor; focus: true }
}
transitions: Transition {
diff --git a/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml b/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml
index e15adbc..6109535 100644
--- a/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml
+++ b/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml
@@ -77,6 +77,6 @@ Item {
MouseArea {
anchors { fill: parent; leftMargin: -20; topMargin: -20; rightMargin: -20; bottomMargin: -20 }
- onClicked: textInput.forceFocus()
+ onClicked: { textInput.forceFocus(); textInput.openSoftwareInputPanel(); }
}
}
diff --git a/demos/declarative/samegame/SamegameCore/Dialog.qml b/demos/declarative/samegame/SamegameCore/Dialog.qml
index 8dd12f6..c71a4b3 100644
--- a/demos/declarative/samegame/SamegameCore/Dialog.qml
+++ b/demos/declarative/samegame/SamegameCore/Dialog.qml
@@ -47,13 +47,14 @@ Rectangle {
property Item text: dialogText
signal closed
-
+ signal opened
function forceClose() {
page.closed();
page.opacity = 0;
}
function show(txt) {
+ page.opened();
dialogText.text = txt;
page.opacity = 1;
}
@@ -62,7 +63,7 @@ Rectangle {
color: "white"
border.width: 1
opacity: 0
-
+ visible: opacity > 0
Behavior on opacity {
NumberAnimation { duration: 1000 }
}
diff --git a/demos/declarative/samegame/samegame.qml b/demos/declarative/samegame/samegame.qml
index 54c18d6..9a721da 100644
--- a/demos/declarative/samegame/samegame.qml
+++ b/demos/declarative/samegame/samegame.qml
@@ -90,17 +90,31 @@ Rectangle {
enabled: initialWidth != 0
}
+ onOpened: nameInputText.focus = true;
+ onClosed: {
+ nameInputText.focus = false;
+ if (nameInputText.text != "")
+ Logic.saveHighScore(nameInputText.text);
+ }
Text {
id: dialogText
anchors { left: nameInputDialog.left; leftMargin: 20; verticalCenter: parent.verticalCenter }
text: "You won! Please enter your name: "
}
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ if (nameInputText.text == "")
+ nameInputText.openSoftwareInputPanel();
+ else
+ nameInputDialog.forceClose();
+ }
+ }
TextInput {
id: nameInputText
anchors { verticalCenter: parent.verticalCenter; left: dialogText.right }
- focus: true
-
+ focus: false
onTextChanged: {
var newWidth = nameInputText.width + dialogText.width + 40;
if ( (newWidth > nameInputDialog.width && newWidth < screen.width)
@@ -108,8 +122,6 @@ Rectangle {
nameInputDialog.width = newWidth;
}
onAccepted: {
- if (nameInputDialog.opacity == 1 && nameInputText.text != "")
- Logic.saveHighScore(nameInputText.text);
nameInputDialog.forceClose();
}
}
diff --git a/demos/declarative/snake/content/HighScoreModel.qml b/demos/declarative/snake/content/HighScoreModel.qml
index 99799c8..42482f8 100644
--- a/demos/declarative/snake/content/HighScoreModel.qml
+++ b/demos/declarative/snake/content/HighScoreModel.qml
@@ -106,7 +106,7 @@ ListModel {
}
if (rs.rows.length > maxScores)
tx.executeSql("DELETE FROM HighScores WHERE game=? AND score <= ?",
- [rs.rows.item(maxScores).score]);
+ [game, rs.rows.item(maxScores).score]);
}
}
)
diff --git a/demos/declarative/snake/content/snake.js b/demos/declarative/snake/content/snake.js
index 6f78b33..4d05e33 100644
--- a/demos/declarative/snake/content/snake.js
+++ b/demos/declarative/snake/content/snake.js
@@ -37,6 +37,7 @@ function startNewGame()
startNewGameTimer.running = true;
return;
}
+
numRows = numRowsAvailable;
numColumns = numColumnsAvailable;
board = new Array(numRows * numColumns);
diff --git a/demos/declarative/snake/snake.qml b/demos/declarative/snake/snake.qml
index 565e92c..46114f5 100644
--- a/demos/declarative/snake/snake.qml
+++ b/demos/declarative/snake/snake.qml
@@ -86,7 +86,7 @@ Rectangle {
onTriggered: { Logic.moveSkull() }
}
Timer {
-
+ id: startNewGameTimer;
interval: 700;
onTriggered: { Logic.startNewGame(); }
}
@@ -177,7 +177,6 @@ Rectangle {
id: progressIndicator
color: "#221edd";
width: 0;
- Behavior on width { NumberAnimation { duration: startHeartbeatTimer.running ? 1000 : 0}}
height: 30;
}
}
@@ -227,4 +226,13 @@ Rectangle {
}
]
+ transitions: [
+ Transition {
+ from: "*"
+ to: "starting"
+ NumberAnimation { target: progressIndicator; property: "width"; duration: 1000 }
+
+ }
+ ]
+
}
diff --git a/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml b/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml
index 3828a40..52164ed 100644
--- a/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml
+++ b/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml
@@ -148,7 +148,7 @@ Item {
PropertyChanges { target: tagButton; text: "OK" }
PropertyChanges { target: tagButton; width: 28 }
PropertyChanges { target: tagButton; height: 24 }
- PropertyChanges { target: txtEdit; focus: true }
+ PropertyChanges { target: editor; focus: true }
}
]
transitions: [
diff --git a/demos/declarative/twitter/TwitterCore/TitleBar.qml b/demos/declarative/twitter/TwitterCore/TitleBar.qml
index 0cf79a3..6cd0a50 100644
--- a/demos/declarative/twitter/TwitterCore/TitleBar.qml
+++ b/demos/declarative/twitter/TwitterCore/TitleBar.qml
@@ -107,7 +107,7 @@ Item {
name: "Tags"
PropertyChanges { target: container; x: -tagButton.x + 5 }
PropertyChanges { target: tagButton; text: "OK" }
- PropertyChanges { target: lineEdit; focus: true }
+ PropertyChanges { target: editor; focus: true }
}
transitions: Transition {
diff --git a/demos/declarative/twitter/twitter.qml b/demos/declarative/twitter/twitter.qml
index aa216cc..08cecb0 100644
--- a/demos/declarative/twitter/twitter.qml
+++ b/demos/declarative/twitter/twitter.qml
@@ -70,6 +70,11 @@ Item {
Image { source: "TwitterCore/images/stripes.png"; fillMode: Image.Tile; anchors.fill: parent; opacity: 0.3 }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: screen.focus = false;
+ }
+
Twitter.RssModel { id: rssModel }
Twitter.Loading { anchors.centerIn: parent; visible: rssModel.status==XmlListModel.Loading && state!='unauthed'}
Text {
diff --git a/demos/declarative/webbrowser/content/UrlInput.qml b/demos/declarative/webbrowser/content/UrlInput.qml
index 9ea1904..b57fae6 100644
--- a/demos/declarative/webbrowser/content/UrlInput.qml
+++ b/demos/declarative/webbrowser/content/UrlInput.qml
@@ -73,6 +73,10 @@ Item {
urlText.text = webView.url
webView.focus = true
}
+ Keys.onEnterPressed: {
+ container.urlEntered(urlText.text)
+ webView.focus = true
+ }
Keys.onReturnPressed: {
container.urlEntered(urlText.text)
webView.focus = true