summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-05-19 14:55:11 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-05-19 14:55:11 (GMT)
commit83df329a42107764889f46b9019a37804c36776a (patch)
treeb80e45fb0df8f8384724a9a788a61d30e9d2751c /demos
parent8a97a1cac688d0e6e6aef40bfa396a81d7bfc0b8 (diff)
parente758b6fcbda482d1482c2a7258413711801bd746 (diff)
downloadQt-83df329a42107764889f46b9019a37804c36776a.zip
Qt-83df329a42107764889f46b9019a37804c36776a.tar.gz
Qt-83df329a42107764889f46b9019a37804c36776a.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: (37 commits) Search for QML import libraries also in application directory Doc improvements Disable mouse-based selection in TextInput/TextEdit Rename qml executable to qmlviewer Don't crash if the target parent is destroyed. Introduce a threaded interpreter for QML binding bytecode Bug moved. doc doc Remove image example (covered in class docs) When changing Loader source, remove old item from scene immediately. Add missing .qmlproject files Fix folderlistmodel with qt namespace Renaming "Qml Launcher" back to "QML Viewer" Rename some examples: proxyviewer -> networkaccessmanagerfactory, Regression fix for Loader anchors not working Make Qt.include() work for js files that have '.pragma library' doc fix Improve docs for Qt.quit() Prevent assignment of values (string, number, bool) to signal handlers. ...
Diffstat (limited to 'demos')
-rw-r--r--demos/declarative/photoviewer/PhotoViewerCore/Button.qml4
-rw-r--r--demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml40
-rw-r--r--demos/declarative/rssnews/rssnews.qmlproject16
3 files changed, 32 insertions, 28 deletions
diff --git a/demos/declarative/photoviewer/PhotoViewerCore/Button.qml b/demos/declarative/photoviewer/PhotoViewerCore/Button.qml
index c681064..5be096a 100644
--- a/demos/declarative/photoviewer/PhotoViewerCore/Button.qml
+++ b/demos/declarative/photoviewer/PhotoViewerCore/Button.qml
@@ -4,7 +4,7 @@ Item {
id: container
property alias label: labelText.text
- property color tint: "#FFFFFFFF"
+ property string tint: ""
signal clicked
width: labelText.width + 70 ; height: labelText.height + 18
@@ -19,7 +19,7 @@ Item {
Rectangle {
anchors.fill: container; color: container.tint; visible: container.tint != ""
- opacity: 0.1; smooth: true
+ opacity: 0.25; smooth: true
}
Text { id: labelText; font.pixelSize: 15; anchors.centerIn: parent; smooth: true }
diff --git a/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml b/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml
index ccfda02..15ffe56 100644
--- a/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml
+++ b/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml
@@ -4,11 +4,10 @@ Item {
id: container
property string label
- property color tint: "#FFFFFFFF"
signal clicked
signal labelChanged(string label)
- width: labelText.width + 70 ; height: labelText.height + 18
+ width: textInput.width + 70 ; height: textInput.height + 18
BorderImage {
anchors { fill: container; leftMargin: -6; topMargin: -6; rightMargin: -8; bottomMargin: -8 }
@@ -18,36 +17,25 @@ Item {
Image { anchors.fill: parent; source: "images/cardboard.png"; smooth: true }
- Rectangle {
- anchors.fill: container; color: container.tint; visible: container.tint != ""
- opacity: 0.1; smooth: true
- }
-
- Text { id: labelText; text: label; font.pixelSize: 15; anchors.centerIn: parent; smooth: true }
-
TextInput {
- id: textInput; text: label; font.pixelSize: 15; anchors.centerIn: parent; smooth: true; visible: false
- Keys.onReturnPressed: container.labelChanged(textInput.text)
+ id: textInput; text: label; font.pixelSize: 15; anchors.centerIn: parent; smooth: true
+ Keys.onReturnPressed: {
+ container.labelChanged(textInput.text)
+ container.focus = true
+ }
Keys.onEscapePressed: {
- textInput.text = labelText.text
- container.state = ''
+ textInput.text = container.label
+ container.focus = true
}
}
- MouseArea {
- anchors { fill: parent; leftMargin: -20; topMargin: -20; rightMargin: -20; bottomMargin: -20 }
- onClicked: container.state = "editMode"
- }
-
- states: State {
- name: "editMode"
- PropertyChanges { target: container; width: textInput.width + 70; height: textInput.height + 17 }
- PropertyChanges { target: textInput; visible: true; focus: true }
- PropertyChanges { target: labelText; visible: false }
+ Rectangle {
+ anchors.fill: container; border.color: "steelblue"; border.width: 4
+ color: "transparent"; visible: textInput.focus; smooth: true
}
- onLabelChanged: {
- labelText.text = label
- container.state = ''
+ MouseArea {
+ anchors { fill: parent; leftMargin: -20; topMargin: -20; rightMargin: -20; bottomMargin: -20 }
+ onClicked: textInput.forceFocus()
}
}
diff --git a/demos/declarative/rssnews/rssnews.qmlproject b/demos/declarative/rssnews/rssnews.qmlproject
new file mode 100644
index 0000000..d4909f8
--- /dev/null
+++ b/demos/declarative/rssnews/rssnews.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}