summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-07-23 08:51:25 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-07-23 08:51:25 (GMT)
commitbe7edc40324bb135548888853df28bf94eb2aa79 (patch)
tree0ed8e4a9085a2100311530d494acba7385c3eb3a /examples
parent3124d14be27766ddf3c86528c913165e09317111 (diff)
parent9df05c922fc0408489cb93ae67e187b717599254 (diff)
downloadQt-be7edc40324bb135548888853df28bf94eb2aa79.zip
Qt-be7edc40324bb135548888853df28bf94eb2aa79.tar.gz
Qt-be7edc40324bb135548888853df28bf94eb2aa79.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: (42 commits) Update QtDeclarative def files Fix crash in MouseArea Compile Fixes undeleted timers (and endless warning from the event loop about Remove unneeded member variable. Fix test. Generalize qml "registration" Fix compiler warning Fix TextInput echoMode autotest on Linux Reuse QML lexer to simplify .pragma script logic Fix TextEdit text attribute and text stored in the internal QTextDocument having different contents Remove QDeclarativeItem::childrenChanged() signal overload Update QtGui and QtDeclarative def files Make rootContext and engine pointers in QDeclarativeView API const Add additional QVariant benchmarks. Allow MouseArea dragging to filter mouse events from descendants Expand QDeclarativeExtensionPlugin docs Add missing snippet files Expand QtObject doc Indicate default values ...
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