summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-07-21 13:32:04 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-07-21 13:32:04 (GMT)
commitb05e07835c376857da0a0f9cb85bbab001f145dd (patch)
treed3efb13f1e00515f3deabfc6da1eb381472dac37 /examples
parent3a7b70637f94a85702c6578bb13a1e6594358d08 (diff)
parent2c6312bcb2a80431e6f0cf16d6c4c1d016d40b03 (diff)
downloadQt-b05e07835c376857da0a0f9cb85bbab001f145dd.zip
Qt-b05e07835c376857da0a0f9cb85bbab001f145dd.tar.gz
Qt-b05e07835c376857da0a0f9cb85bbab001f145dd.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: (26 commits) Expand QDeclarativeExtensionPlugin docs Add missing snippet files Expand QtObject doc Indicate default values Use snippets instead to avoid quoting license headers Rename remaining 'wantsFocus'. Bounding rect of text was not always calculated correctly. Add QML tutorials to the tutorials page QML focus API updates. Do not show copyright header in documentation. Ensure redirects (and indeed all reply process) is done in the right thread. Only ignore the same target value for a Behavior when it is running. Fix clock example: make sure hands always moves forward. font.letterSpacing used percentage rather than absolute values. Rewinding AnchorChanges should not make target item's implicit width and height explicit Compile: include <float.h> for usage of FLT_MAX. Restore the FLT_MAX define. Make Item::transformOriginPoint read-only Ensure the boundingRect() of Text is correctly calculated. Better defaults for MouseArea's drag. ...
Diffstat (limited to 'examples')
-rw-r--r--examples/declarative/cppextensions/plugins/plugin.cpp6
-rw-r--r--examples/declarative/cppextensions/plugins/plugins.qml3
-rw-r--r--examples/declarative/keyinteraction/focus/Core/GridMenu.qml6
-rw-r--r--examples/declarative/keyinteraction/focus/Core/ListViewDelegate.qml4
-rw-r--r--examples/declarative/keyinteraction/focus/Core/ListViews.qml8
-rw-r--r--examples/declarative/keyinteraction/focus/focus.qml4
-rw-r--r--examples/declarative/toys/clocks/content/Clock.qml6
-rw-r--r--examples/declarative/toys/dynamicscene/dynamicscene.qml1
8 files changed, 22 insertions, 16 deletions
diff --git a/examples/declarative/cppextensions/plugins/plugin.cpp b/examples/declarative/cppextensions/plugins/plugin.cpp
index 355ca3f..01d5361 100644
--- a/examples/declarative/cppextensions/plugins/plugin.cpp
+++ b/examples/declarative/cppextensions/plugins/plugin.cpp
@@ -96,11 +96,13 @@ private:
QBasicTimer timer;
};
+//![0]
class TimeModel : public QObject
{
Q_OBJECT
Q_PROPERTY(int hour READ hour NOTIFY timeChanged)
Q_PROPERTY(int minute READ minute NOTIFY timeChanged)
+//![0]
public:
TimeModel(QObject *parent=0) : QObject(parent)
@@ -135,6 +137,7 @@ private:
int TimeModel::instances=0;
MinuteTimer *TimeModel::timer=0;
+//![plugin]
class QExampleQmlPlugin : public QDeclarativeExtensionPlugin
{
Q_OBJECT
@@ -145,7 +148,10 @@ public:
qmlRegisterType<TimeModel>(uri, 1, 0, "Time");
}
};
+//![plugin]
#include "plugin.moc"
+//![export]
Q_EXPORT_PLUGIN2(qmlqtimeexampleplugin, QExampleQmlPlugin);
+//![export]
diff --git a/examples/declarative/cppextensions/plugins/plugins.qml b/examples/declarative/cppextensions/plugins/plugins.qml
index 1832017..8d1085c 100644
--- a/examples/declarative/cppextensions/plugins/plugins.qml
+++ b/examples/declarative/cppextensions/plugins/plugins.qml
@@ -37,7 +37,7 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-
+//![0]
import com.nokia.TimeExample 1.0 // import types from the plugin
Clock { // this class is defined in QML (com/nokia/TimeExample/Clock.qml)
@@ -49,3 +49,4 @@ Clock { // this class is defined in QML (com/nokia/TimeExample/Clock.qml)
hours: time.hour
minutes: time.minute
}
+//![0]
diff --git a/examples/declarative/keyinteraction/focus/Core/GridMenu.qml b/examples/declarative/keyinteraction/focus/Core/GridMenu.qml
index 9a8d3f3..19f7235 100644
--- a/examples/declarative/keyinteraction/focus/Core/GridMenu.qml
+++ b/examples/declarative/keyinteraction/focus/Core/GridMenu.qml
@@ -43,7 +43,7 @@ import Qt 4.7
FocusScope {
property alias interactive: gridView.interactive
- onWantsFocusChanged: if (wantsFocus) mainView.state = ""
+ onActiveFocusChanged: if (activeFocus) mainView.state = ""
Rectangle {
anchors.fill: parent
@@ -84,12 +84,12 @@ FocusScope {
onClicked: {
GridView.view.currentIndex = index
- container.forceFocus()
+ container.forceActiveFocus()
}
}
states: State {
- name: "active"; when: container.focus == true
+ name: "active"; when: container.activeFocus
PropertyChanges { target: content; color: "#FCFFF5"; scale: 1.1 }
}
diff --git a/examples/declarative/keyinteraction/focus/Core/ListViewDelegate.qml b/examples/declarative/keyinteraction/focus/Core/ListViewDelegate.qml
index cc13637..602b52b 100644
--- a/examples/declarative/keyinteraction/focus/Core/ListViewDelegate.qml
+++ b/examples/declarative/keyinteraction/focus/Core/ListViewDelegate.qml
@@ -69,12 +69,12 @@ Item {
onClicked: {
ListView.view.currentIndex = index
- container.forceFocus()
+ container.forceActiveFocus()
}
}
states: State {
- name: "active"; when: container.focus == true
+ name: "active"; when: container.activeFocus
PropertyChanges { target: content; color: "#FCFFF5"; scale: 1.1 }
PropertyChanges { target: label; font.pixelSize: 16 }
}
diff --git a/examples/declarative/keyinteraction/focus/Core/ListViews.qml b/examples/declarative/keyinteraction/focus/Core/ListViews.qml
index 6f9ceb4..3d6ceab 100644
--- a/examples/declarative/keyinteraction/focus/Core/ListViews.qml
+++ b/examples/declarative/keyinteraction/focus/Core/ListViews.qml
@@ -43,11 +43,11 @@ import Qt 4.7
FocusScope {
clip: true
- onWantsFocusChanged: if (wantsFocus) mainView.state = "showListViews"
+ onActiveFocusChanged: if (activeFocus) mainView.state = "showListViews"
ListView {
id: list1
- y: wantsFocus ? 10 : 40; width: parent.width / 3; height: parent.height - 20
+ y: activeFocus ? 10 : 40; width: parent.width / 3; height: parent.height - 20
focus: true
KeyNavigation.up: gridMenu; KeyNavigation.left: contextMenu; KeyNavigation.right: list2
model: 10; cacheBuffer: 200
@@ -60,7 +60,7 @@ FocusScope {
ListView {
id: list2
- y: wantsFocus ? 10 : 40; x: parseInt(parent.width / 3); width: parent.width / 3; height: parent.height - 20
+ y: activeFocus ? 10 : 40; x: parseInt(parent.width / 3); width: parent.width / 3; height: parent.height - 20
KeyNavigation.up: gridMenu; KeyNavigation.left: list1; KeyNavigation.right: list3
model: 10; cacheBuffer: 200
delegate: ListViewDelegate {}
@@ -72,7 +72,7 @@ FocusScope {
ListView {
id: list3
- y: wantsFocus ? 10 : 40; x: parseInt(2 * parent.width / 3); width: parent.width / 3; height: parent.height - 20
+ y: activeFocus ? 10 : 40; x: parseInt(2 * parent.width / 3); width: parent.width / 3; height: parent.height - 20
KeyNavigation.up: gridMenu; KeyNavigation.left: list2
model: 10; cacheBuffer: 200
delegate: ListViewDelegate {}
diff --git a/examples/declarative/keyinteraction/focus/focus.qml b/examples/declarative/keyinteraction/focus/focus.qml
index 8b2af70..56fdffc 100644
--- a/examples/declarative/keyinteraction/focus/focus.qml
+++ b/examples/declarative/keyinteraction/focus/focus.qml
@@ -58,7 +58,7 @@ Rectangle {
width: parent.width; height: 320
focus: true
- interactive: parent.wantsFocus
+ interactive: parent.activeFocus
}
ListViews {
@@ -98,7 +98,7 @@ Rectangle {
states: State {
name: "contextMenuOpen"
- when: !mainView.wantsFocus
+ when: !mainView.activeFocus
PropertyChanges { target: contextMenu; x: 0; open: true }
PropertyChanges { target: mainView; x: 130 }
PropertyChanges { target: shade; opacity: 0.25 }
diff --git a/examples/declarative/toys/clocks/content/Clock.qml b/examples/declarative/toys/clocks/content/Clock.qml
index 24a07ec..eaa14c6 100644
--- a/examples/declarative/toys/clocks/content/Clock.qml
+++ b/examples/declarative/toys/clocks/content/Clock.qml
@@ -77,7 +77,7 @@ Item {
origin.x: 7.5; origin.y: 73;
angle: (clock.hours * 30) + (clock.minutes * 0.5)
Behavior on angle {
- NumberAnimation{}
+ RotationAnimation{ direction: RotationAnimation.Clockwise }
}
}
}
@@ -91,7 +91,7 @@ Item {
origin.x: 6.5; origin.y: 83;
angle: clock.minutes * 6
Behavior on angle {
- NumberAnimation{}
+ RotationAnimation{ direction: RotationAnimation.Clockwise }
}
}
}
@@ -105,7 +105,7 @@ Item {
origin.x: 2.5; origin.y: 80;
angle: clock.seconds * 6
Behavior on angle {
- NumberAnimation{}
+ RotationAnimation{ direction: RotationAnimation.Clockwise }
}
}
}
diff --git a/examples/declarative/toys/dynamicscene/dynamicscene.qml b/examples/declarative/toys/dynamicscene/dynamicscene.qml
index 1edb841..2a22a5f 100644
--- a/examples/declarative/toys/dynamicscene/dynamicscene.qml
+++ b/examples/declarative/toys/dynamicscene/dynamicscene.qml
@@ -184,7 +184,6 @@ Item {
id: qmlText
anchors.fill: parent; anchors.margins: 5
readOnly: false
- focusOnPress: true
font.pixelSize: 14
wrapMode: TextEdit.WordWrap