summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/src/declarative/qdeclarativemodels.qdoc20
-rw-r--r--src/declarative/QmlChanges.txt48
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp6
3 files changed, 48 insertions, 26 deletions
diff --git a/doc/src/declarative/qdeclarativemodels.qdoc b/doc/src/declarative/qdeclarativemodels.qdoc
index f7d1a73..e80824d 100644
--- a/doc/src/declarative/qdeclarativemodels.qdoc
+++ b/doc/src/declarative/qdeclarativemodels.qdoc
@@ -191,6 +191,23 @@ will be positioned by the view.
\section2 QAbstractItemModel
QAbstractItemModel provides the roles set via the QAbstractItemModel::setRoleNames() method.
+The default role names set by Qt are:
+
+\table
+\header
+\o Qt Role
+\o QML Role Name
+\row
+\o Qt::DisplayRole
+\o display
+\row
+\o Qt::DecorationRole
+\o decoration
+\endtable
+
+QAbstractItemModel presents a heirachy of tables. Views currently provided by QML
+can only display list data. In order to display child lists of a heirachical model
+use the VisualDataModel element with \e rootIndex set to a parent node.
\section2 QStringList
@@ -198,9 +215,6 @@ QAbstractItemModel provides the roles set via the QAbstractItemModel::setRoleNam
QStringList provides the contents of the list via the \e modelData role:
\table
-\header
-\o
-\o
\row
\o
\code
diff --git a/src/declarative/QmlChanges.txt b/src/declarative/QmlChanges.txt
index 13b1eee..6d0f16f 100644
--- a/src/declarative/QmlChanges.txt
+++ b/src/declarative/QmlChanges.txt
@@ -1,26 +1,45 @@
=============================================================================
-The changes below are pre Qt 4.7.0 alpha
+The changes below are pre Qt 4.7.0 beta
PathView: offset property now uses range 0-1.0 rather than 0-100
ListView, GridView::positionViewAtIndex() gained a 'mode' parameter
+Removed Qt.playSound (replaced by SoundEffect element)
+Removed Qt.closestAngle (use RotationAnimation instead)
+Removed NumberFormatter
+Removed DateTimeFormatter (use Qt.formatDateTime() instead)
+Using WebView now requires "import org.webkit 1.0"
+Using Particles now requires "import Qt.labs.particles 1.0"
+AnchorAnimation must now be used to animate anchor changes (and not NumberAnimation)
+
+C++ API
+-------
+QDeclarativeContext::addDefaultObject() has been replaced with
+QDeclarativeContext::setContextObject()
+
+Behavior and Animation syntax
+-----------------------------
+Previously animations and behaviors could be "assigned" to properties like this:
+ Item { x: Behavior {}; y: NumberAnimation {} }
+To make it more obvious that these are not regular value assignments a new "on"
+syntax has been introduced:
+ Item { Behavior on x {}; NumberAnimation on y {} }
+Only the syntax has changed, the behavior is identical.
+
+
+=============================================================================
+The changes below are pre Qt 4.7.0 alpha
+
Flickable: renamed viewportWidth -> contentWidth
Flickable: renamed viewportHeight -> contentHeight
Flickable: renamed viewportX -> contentX
Flickable: renamed viewportY -> contentY
Removed Flickable.reportedVelocitySmoothing
-Removed Qt.playSound (replaced by SoundEffect element)
-Removed Qt.closestAngle (use RotationAnimation instead)
-Removed NumberFormatter
-Removed DateTimeFormatter (use Qt.formatDateTime() instead)
Renamed MouseRegion -> MouseArea
Connection: syntax and rename:
Connection { sender: a; signal: foo(); script: xxx }
Connection { sender: a; signal: bar(); script: yyy }
becomes:
Connections { target: a; onFoo: xxx; onBar: yyy }
-Using WebView now requires "import org.webkit 1.0"
-Using Particles now requires "import Qt.labs.particles 1.0"
-AnchorAnimation must now be used to animate anchor changes (and not NumberAnimation)
QmlView
-------
@@ -55,25 +74,12 @@ should also consider using the QmlExtensionPlugin (previously named QmlModulePlu
as a cleaner mechanism for publishing libraries of QML types, or the upcoming
application plugin features of the qmlviewer / qmlruntime / qml.
-QDeclarativeContext::addDefaultObject() has been replaced with
-QDeclarativeContext::setContextObject()
-
PropertyAnimation
------------------
matchProperties and matchTargets have been renamed back to properties and targets.
The semantics are explained in the PropertyAnimation::properties documentation
and the animation overview documentation.
-Behavior and Animation syntax
------------------------------
-
-Previously animations and behaviors could be "assigned" to properties like this:
- Item { x: Behavior {}; y: NumberAnimation {} }
-To make it more obvious that these are not regular value assignments a new "on"
-syntax has been introduced:
- Item { Behavior on x {}; NumberAnimation on y {} }
-Only the syntax has changed, the behavior is identical.
-
=============================================================================
The changes below are pre-4.6.0 release.
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index e82d91a..a3f8250 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -673,14 +673,16 @@ void QDeclarativeEngine::setContextForObject(QObject *object, QDeclarativeContex
Ownership controls whether or not QML automatically destroys the QObject when the object
is garbage collected by the JavaScript engine. The two ownership options are:
-\o CppOwnership The object is owned by C++ code, and will never be deleted by QML. The
+\list
+\o CppOwnership - The object is owned by C++ code, and will never be deleted by QML. The
JavaScript destroy() method cannot be used on objects with CppOwnership. This option
is similar to QScriptEngine::QtOwnership.
-\o JavaScriptOwnership The object is owned by JavaScript. When the object is returned to QML
+\o JavaScriptOwnership - The object is owned by JavaScript. When the object is returned to QML
as the return value of a method call or property access, QML will delete the object if there
are no remaining JavaScript references to it and it has no QObject::parent(). This option
is similar to QScriptEngine::ScriptOwnership.
+\endlist
Generally an application doesn't need to set an object's ownership explicitly. QML uses
a heuristic to set the default object ownership. By default, an object that is created by