summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-08-26 06:03:10 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-08-26 06:03:10 (GMT)
commitfe9dcaabe564c922696c9dcdad65fc56181e0d44 (patch)
treee10f12aaf406cfa14333005e8492753274b7818e
parentdac9c7f42765a46d445aae35fd0e85b402ceb164 (diff)
parent441c9ebdebb17cd31c39a615e82a3ea26f101465 (diff)
downloadQt-fe9dcaabe564c922696c9dcdad65fc56181e0d44.zip
Qt-fe9dcaabe564c922696c9dcdad65fc56181e0d44.tar.gz
Qt-fe9dcaabe564c922696c9dcdad65fc56181e0d44.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
-rw-r--r--demos/declarative/calculator/Core/calculator.js10
-rw-r--r--demos/declarative/calculator/calculator.qml16
-rw-r--r--demos/declarative/minehunt/MinehuntCore/pics/No-Ones-Laughing-3.jpgbin30730 -> 0 bytes
-rw-r--r--demos/declarative/minehunt/MinehuntCore/pics/background.pngbin0 -> 313930 bytes
-rw-r--r--demos/declarative/minehunt/MinehuntCore/pics/quit.pngbin0 -> 583 bytes
-rw-r--r--demos/declarative/minehunt/main.cpp1
-rw-r--r--demos/declarative/minehunt/minehunt.qml14
-rw-r--r--demos/declarative/photoviewer/photoviewer.qml5
-rw-r--r--demos/declarative/rssnews/rssnews.qml20
-rw-r--r--demos/declarative/snake/snake.qml6
-rw-r--r--demos/declarative/twitter/TwitterCore/TitleBar.qml12
-rw-r--r--demos/declarative/twitter/TwitterCore/images/quit.pngbin0 -> 2369 bytes
-rw-r--r--demos/declarative/webbrowser/content/Header.qml30
-rw-r--r--demos/declarative/webbrowser/content/pics/edit-delete.pngbin1333 -> 831 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/go-jump-locationbar.pngbin714 -> 408 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/go-next-view.pngbin1187 -> 1310 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/go-previous-view.pngbin1226 -> 1080 bytes
-rw-r--r--examples/declarative/animation/states/qt-logo.pngbin0 -> 5149 bytes
-rw-r--r--examples/declarative/animation/states/states.qml8
-rw-r--r--examples/declarative/animation/states/transitions.qml8
-rw-r--r--examples/declarative/animation/states/user.pngbin4886 -> 0 bytes
-rw-r--r--examples/declarative/imageelements/image/ImageCell.qml2
-rw-r--r--examples/declarative/imageelements/image/face-smile.pngbin15408 -> 0 bytes
-rw-r--r--examples/declarative/imageelements/image/qt-logo.pngbin0 -> 5149 bytes
-rw-r--r--examples/declarative/modelviews/listview/content/pics/arrow-down.pngbin892 -> 0 bytes
-rw-r--r--examples/declarative/modelviews/listview/content/pics/arrow-up.pngbin929 -> 0 bytes
-rw-r--r--examples/declarative/modelviews/listview/content/pics/list-delete.pngbin1074 -> 0 bytes
-rw-r--r--examples/declarative/positioners/add.pngbin1577 -> 810 bytes
-rw-r--r--examples/declarative/positioners/del.pngbin1661 -> 488 bytes
29 files changed, 102 insertions, 30 deletions
diff --git a/demos/declarative/calculator/Core/calculator.js b/demos/declarative/calculator/Core/calculator.js
index 16cc309..7c363c7 100644
--- a/demos/declarative/calculator/Core/calculator.js
+++ b/demos/declarative/calculator/Core/calculator.js
@@ -74,6 +74,11 @@ function doOperation(op) {
memory = display.text.valueOf()
} else if (op == leftArrow) {
display.text = display.text.toString().slice(0, -1)
+ if (display.text.length == 0) {
+ display.text = "0"
+ }
+ } else if (op == "Off") {
+ Qt.quit();
} else if (op == "C") {
display.text = "0"
} else if (op == "AC") {
@@ -82,10 +87,5 @@ function doOperation(op) {
lastOp = ""
display.text ="0"
}
-
- if (op == rotateRight)
- main.state = "orientation " + Orientation.Landscape
- if (op == rotateLeft)
- main.state = ''
}
diff --git a/demos/declarative/calculator/calculator.qml b/demos/declarative/calculator/calculator.qml
index 288455b..68c922b 100644
--- a/demos/declarative/calculator/calculator.qml
+++ b/demos/declarative/calculator/calculator.qml
@@ -58,7 +58,7 @@ Rectangle {
property string plusminus : "\u00b1"
function doOp(operation) { CalcEngine.doOperation(operation) }
-
+
Item {
id: main
state: "orientation " + runtime.orientation
@@ -70,8 +70,10 @@ Rectangle {
anchors { fill: parent; topMargin: 6; bottomMargin: 6; leftMargin: 6; rightMargin: 6 }
- Row {
- Display { id: display; width: box.width; height: 64 }
+ Display {
+ id: display
+ width: box.width-3
+ height: 64
}
Column {
@@ -82,11 +84,7 @@ Rectangle {
Row {
spacing: 6
-
- Button {
- id: rotateButton
- width: column.w; height: column.h; color: 'purple'; operation: rotateRight
- }
+ Button { width: column.w; height: column.h; color: 'purple'; operation: "Off" }
Button { width: column.w; height: column.h; color: 'purple'; operation: leftArrow }
Button { width: column.w; height: column.h; color: 'purple'; operation: "C" }
Button { width: column.w; height: column.h; color: 'purple'; operation: "AC" }
@@ -103,7 +101,7 @@ Rectangle {
}
Grid {
- id: grid; rows: 4; columns: 5; spacing: 6
+ id: grid; rows: 5; columns: 5; spacing: 6
property real w: (box.width / columns) - ((spacing * (columns - 1)) / columns)
diff --git a/demos/declarative/minehunt/MinehuntCore/pics/No-Ones-Laughing-3.jpg b/demos/declarative/minehunt/MinehuntCore/pics/No-Ones-Laughing-3.jpg
deleted file mode 100644
index 445567f..0000000
--- a/demos/declarative/minehunt/MinehuntCore/pics/No-Ones-Laughing-3.jpg
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/minehunt/MinehuntCore/pics/background.png b/demos/declarative/minehunt/MinehuntCore/pics/background.png
new file mode 100644
index 0000000..3734a27
--- /dev/null
+++ b/demos/declarative/minehunt/MinehuntCore/pics/background.png
Binary files differ
diff --git a/demos/declarative/minehunt/MinehuntCore/pics/quit.png b/demos/declarative/minehunt/MinehuntCore/pics/quit.png
new file mode 100644
index 0000000..b822057
--- /dev/null
+++ b/demos/declarative/minehunt/MinehuntCore/pics/quit.png
Binary files differ
diff --git a/demos/declarative/minehunt/main.cpp b/demos/declarative/minehunt/main.cpp
index fc223dd..8bbaee9 100644
--- a/demos/declarative/minehunt/main.cpp
+++ b/demos/declarative/minehunt/main.cpp
@@ -59,6 +59,7 @@ int main(int argc, char *argv[])
#endif
canvas.engine()->rootContext()->setContextObject(game);
canvas.setSource(QString("minehunt.qml"));
+ QObject::connect(canvas.engine(), SIGNAL(quit()), &app, SLOT(quit()));
#ifdef Q_OS_SYMBIAN
canvas.showFullScreen();
diff --git a/demos/declarative/minehunt/minehunt.qml b/demos/declarative/minehunt/minehunt.qml
index 136f56a..4accb52 100644
--- a/demos/declarative/minehunt/minehunt.qml
+++ b/demos/declarative/minehunt/minehunt.qml
@@ -49,7 +49,7 @@ Item {
width: 450; height: 450
- Image { source: "MinehuntCore/pics/No-Ones-Laughing-3.jpg"; anchors.fill: parent; fillMode: Image.Tile }
+ Image { source: "MinehuntCore/pics/background.png"; anchors.fill: parent; fillMode: Image.Tile }
Grid {
anchors.horizontalCenter: parent.horizontalCenter
@@ -67,6 +67,18 @@ Item {
x: 20; spacing: 20
anchors.bottom: field.bottom; anchors.bottomMargin: 15
+ Image {
+ source: "MinehuntCore/pics/quit.png"
+ scale: quitMouse.pressed ? 0.8 : 1.0
+ smooth: quitMouse.pressed
+ y: 10
+ MouseArea {
+ id: quitMouse
+ anchors.fill: parent
+ anchors.margins: -20
+ onClicked: Qt.quit()
+ }
+ }
Column {
spacing: 2
Image { source: "MinehuntCore/pics/bomb-color.png" }
diff --git a/demos/declarative/photoviewer/photoviewer.qml b/demos/declarative/photoviewer/photoviewer.qml
index 4ed3105..3072ea2 100644
--- a/demos/declarative/photoviewer/photoviewer.qml
+++ b/demos/declarative/photoviewer/photoviewer.qml
@@ -81,6 +81,11 @@ Rectangle {
onClicked: mainWindow.editMode = !mainWindow.editMode
anchors.horizontalCenter: parent.horizontalCenter
}
+ Button {
+ id: quitButton; label: qsTr("Quit"); rotation: -2;
+ onClicked: Qt.quit()
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
}
Rectangle {
diff --git a/demos/declarative/rssnews/rssnews.qml b/demos/declarative/rssnews/rssnews.qml
index def3e2c..fb5b5a3 100644
--- a/demos/declarative/rssnews/rssnews.qml
+++ b/demos/declarative/rssnews/rssnews.qml
@@ -71,6 +71,7 @@ Rectangle {
id: categories
anchors.fill: parent
model: rssFeeds
+ footer: quitButtonDelegate
delegate: CategoryDelegate {}
highlight: Rectangle { color: "steelblue" }
highlightMoveSpeed: 9999999
@@ -87,7 +88,24 @@ Rectangle {
delegate: NewsDelegate {}
}
}
-
+ Component {
+ id: quitButtonDelegate
+ Item {
+ width: categories.width; height: 60
+ Text {
+ text: "Quit"
+ font { family: "Helvetica"; pixelSize: 16; bold: true }
+ anchors {
+ left: parent.left; leftMargin: 15
+ verticalCenter: parent.verticalCenter
+ }
+ }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: Qt.quit()
+ }
+ }
+ }
ScrollBar { scrollArea: list; height: list.height; width: 8; anchors.right: window.right }
Rectangle { x: 220; height: window.height; width: 1; color: "#cccccc" }
}
diff --git a/demos/declarative/snake/snake.qml b/demos/declarative/snake/snake.qml
index ed3bac9..12ad71c 100644
--- a/demos/declarative/snake/snake.qml
+++ b/demos/declarative/snake/snake.qml
@@ -194,6 +194,12 @@ Rectangle {
anchors.verticalCenter: parent.verticalCenter
}
+ Content.Button {
+ text: "Quit"
+ anchors { left: btnA.right; leftMargin: 3; verticalCenter: parent.verticalCenter }
+ onClicked: Qt.quit();
+ }
+
Text {
color: activePalette.text
text: "Score: " + score; font.bold: true
diff --git a/demos/declarative/twitter/TwitterCore/TitleBar.qml b/demos/declarative/twitter/TwitterCore/TitleBar.qml
index 558bc18..479aa20 100644
--- a/demos/declarative/twitter/TwitterCore/TitleBar.qml
+++ b/demos/declarative/twitter/TwitterCore/TitleBar.qml
@@ -58,10 +58,20 @@ Item {
rssModel.tags = editor.text
}
+ Image {
+ id: quitButton
+ x: 5
+ anchors.verticalCenter: parent.verticalCenter
+ source: "images/quit.png"
+ MouseArea {
+ anchors.fill: parent
+ onClicked: Qt.quit()
+ }
+ }
Text {
id: categoryText
anchors {
- left: parent.left; right: tagButton.left; leftMargin: 10; rightMargin: 10
+ left: quitButton.right; right: tagButton.left; leftMargin: 5; rightMargin: 10
verticalCenter: parent.verticalCenter
}
elide: Text.ElideLeft
diff --git a/demos/declarative/twitter/TwitterCore/images/quit.png b/demos/declarative/twitter/TwitterCore/images/quit.png
new file mode 100644
index 0000000..5bda1b6
--- /dev/null
+++ b/demos/declarative/twitter/TwitterCore/images/quit.png
Binary files differ
diff --git a/demos/declarative/webbrowser/content/Header.qml b/demos/declarative/webbrowser/content/Header.qml
index 5abf440..d3ccae3 100644
--- a/demos/declarative/webbrowser/content/Header.qml
+++ b/demos/declarative/webbrowser/content/Header.qml
@@ -51,7 +51,6 @@ Image {
x: webView.contentX < 0 ? -webView.contentX : webView.contentX > webView.contentWidth-webView.width
? -webView.contentX+webView.contentWidth-webView.width : 0
-
y: {
if (webView.progress < 1.0)
return 0;
@@ -59,7 +58,6 @@ Image {
webView.contentY < 0 ? -webView.contentY : webView.contentY > height ? -height : -webView.contentY
}
}
-
Column {
width: parent.width
@@ -101,14 +99,38 @@ Image {
Button {
id: reloadButton
- anchors { right: parent.right; rightMargin: 4 }
+ anchors { right: quitButton.left; rightMargin: 10 }
action: webView.reload; image: "pics/view-refresh.png"
visible: webView.progress == 1.0 && !header.urlChanged
}
+ Text {
+ id: quitButton
+ color: "white"
+ style: Text.Sunken
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+ font.pixelSize: 18
+ width: 60
+ text: "Quit"
+ MouseArea {
+ anchors.fill: parent
+ onClicked: Qt.quit()
+ }
+ Rectangle {
+ width: 1
+ y: 5
+ height: parent.height-10
+ anchors.right: parent.left
+ color: "darkgray"
+ }
+ }
Button {
id: stopButton
- anchors { right: parent.right; rightMargin: 4 }
+ anchors { right: quitButton.left; rightMargin: 10 }
action: webView.stop; image: "pics/edit-delete.png"
visible: webView.progress < 1.0 && !header.urlChanged
}
diff --git a/demos/declarative/webbrowser/content/pics/edit-delete.png b/demos/declarative/webbrowser/content/pics/edit-delete.png
index 351659b..df2a147 100644
--- a/demos/declarative/webbrowser/content/pics/edit-delete.png
+++ b/demos/declarative/webbrowser/content/pics/edit-delete.png
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/go-jump-locationbar.png b/demos/declarative/webbrowser/content/pics/go-jump-locationbar.png
index 636fe38..61f779c 100644
--- a/demos/declarative/webbrowser/content/pics/go-jump-locationbar.png
+++ b/demos/declarative/webbrowser/content/pics/go-jump-locationbar.png
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/go-next-view.png b/demos/declarative/webbrowser/content/pics/go-next-view.png
index 3bce02d..a585cab 100644
--- a/demos/declarative/webbrowser/content/pics/go-next-view.png
+++ b/demos/declarative/webbrowser/content/pics/go-next-view.png
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/go-previous-view.png b/demos/declarative/webbrowser/content/pics/go-previous-view.png
index 3ec011e..612fb34 100644
--- a/demos/declarative/webbrowser/content/pics/go-previous-view.png
+++ b/demos/declarative/webbrowser/content/pics/go-previous-view.png
Binary files differ
diff --git a/examples/declarative/animation/states/qt-logo.png b/examples/declarative/animation/states/qt-logo.png
new file mode 100644
index 0000000..14ddf2a
--- /dev/null
+++ b/examples/declarative/animation/states/qt-logo.png
Binary files differ
diff --git a/examples/declarative/animation/states/states.qml b/examples/declarative/animation/states/states.qml
index 77101d0..34cdae3 100644
--- a/examples/declarative/animation/states/states.qml
+++ b/examples/declarative/animation/states/states.qml
@@ -48,14 +48,14 @@ Rectangle {
Image {
id: userIcon
x: topLeftRect.x; y: topLeftRect.y
- source: "user.png"
+ source: "qt-logo.png"
}
Rectangle {
id: topLeftRect
anchors { left: parent.left; top: parent.top; leftMargin: 10; topMargin: 20 }
- width: 64; height: 64
+ width: 46; height: 54
color: "Transparent"; border.color: "Gray"; radius: 6
// Clicking in here sets the state to the default state, returning the image to
@@ -67,7 +67,7 @@ Rectangle {
id: middleRightRect
anchors { right: parent.right; verticalCenter: parent.verticalCenter; rightMargin: 20 }
- width: 64; height: 64
+ width: 46; height: 54
color: "Transparent"; border.color: "Gray"; radius: 6
// Clicking in here sets the state to 'middleRight'
@@ -78,7 +78,7 @@ Rectangle {
id: bottomLeftRect
anchors { left: parent.left; bottom: parent.bottom; leftMargin: 10; bottomMargin: 20 }
- width: 64; height: 64
+ width: 46; height: 54
color: "Transparent"; border.color: "Gray"; radius: 6
// Clicking in here sets the state to 'bottomLeft'
diff --git a/examples/declarative/animation/states/transitions.qml b/examples/declarative/animation/states/transitions.qml
index 1df60ae..884779c 100644
--- a/examples/declarative/animation/states/transitions.qml
+++ b/examples/declarative/animation/states/transitions.qml
@@ -54,14 +54,14 @@ Rectangle {
Image {
id: userIcon
x: topLeftRect.x; y: topLeftRect.y
- source: "user.png"
+ source: "qt-logo.png"
}
Rectangle {
id: topLeftRect
anchors { left: parent.left; top: parent.top; leftMargin: 10; topMargin: 20 }
- width: 64; height: 64
+ width: 46; height: 54
color: "Transparent"; border.color: "Gray"; radius: 6
// Clicking in here sets the state to the default state, returning the image to
@@ -73,7 +73,7 @@ Rectangle {
id: middleRightRect
anchors { right: parent.right; verticalCenter: parent.verticalCenter; rightMargin: 20 }
- width: 64; height: 64
+ width: 46; height: 54
color: "Transparent"; border.color: "Gray"; radius: 6
// Clicking in here sets the state to 'middleRight'
@@ -84,7 +84,7 @@ Rectangle {
id: bottomLeftRect
anchors { left: parent.left; bottom: parent.bottom; leftMargin: 10; bottomMargin: 20 }
- width: 64; height: 64
+ width: 46; height: 54
color: "Transparent"; border.color: "Gray"; radius: 6
// Clicking in here sets the state to 'bottomLeft'
diff --git a/examples/declarative/animation/states/user.png b/examples/declarative/animation/states/user.png
deleted file mode 100644
index dd7d7a2..0000000
--- a/examples/declarative/animation/states/user.png
+++ /dev/null
Binary files differ
diff --git a/examples/declarative/imageelements/image/ImageCell.qml b/examples/declarative/imageelements/image/ImageCell.qml
index bd232b9..71a17fe 100644
--- a/examples/declarative/imageelements/image/ImageCell.qml
+++ b/examples/declarative/imageelements/image/ImageCell.qml
@@ -48,7 +48,7 @@ Item {
Image {
id: image
width: parent.width; height: parent.height - captionItem.height
- source: "face-smile.png"
+ source: "qt-logo.png"
clip: true // only makes a difference if mode is PreserveAspectCrop
smooth: true
}
diff --git a/examples/declarative/imageelements/image/face-smile.png b/examples/declarative/imageelements/image/face-smile.png
deleted file mode 100644
index 3d66d72..0000000
--- a/examples/declarative/imageelements/image/face-smile.png
+++ /dev/null
Binary files differ
diff --git a/examples/declarative/imageelements/image/qt-logo.png b/examples/declarative/imageelements/image/qt-logo.png
new file mode 100644
index 0000000..14ddf2a
--- /dev/null
+++ b/examples/declarative/imageelements/image/qt-logo.png
Binary files differ
diff --git a/examples/declarative/modelviews/listview/content/pics/arrow-down.png b/examples/declarative/modelviews/listview/content/pics/arrow-down.png
deleted file mode 100644
index 63331a5..0000000
--- a/examples/declarative/modelviews/listview/content/pics/arrow-down.png
+++ /dev/null
Binary files differ
diff --git a/examples/declarative/modelviews/listview/content/pics/arrow-up.png b/examples/declarative/modelviews/listview/content/pics/arrow-up.png
deleted file mode 100644
index 4459024..0000000
--- a/examples/declarative/modelviews/listview/content/pics/arrow-up.png
+++ /dev/null
Binary files differ
diff --git a/examples/declarative/modelviews/listview/content/pics/list-delete.png b/examples/declarative/modelviews/listview/content/pics/list-delete.png
deleted file mode 100644
index 9640f6b..0000000
--- a/examples/declarative/modelviews/listview/content/pics/list-delete.png
+++ /dev/null
Binary files differ
diff --git a/examples/declarative/positioners/add.png b/examples/declarative/positioners/add.png
index f29d84b..1ee4542 100644
--- a/examples/declarative/positioners/add.png
+++ b/examples/declarative/positioners/add.png
Binary files differ
diff --git a/examples/declarative/positioners/del.png b/examples/declarative/positioners/del.png
index 1d753a3..8d2eaed 100644
--- a/examples/declarative/positioners/del.png
+++ b/examples/declarative/positioners/del.png
Binary files differ