Add QtQml.Models module
authorAlan Alpert <aalpert@rim.com>
Wed, 23 Jan 2013 22:08:58 +0000 (14:08 -0800)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 12 Mar 2013 22:25:48 +0000 (23:25 +0100)
The moved Model classes can now be exposed in a QtQml import.

To keep the QtQml import resticted to more core functionality, they are
being exposed in a plugin module.

Change-Id: I0a84642a72c7c9bbf9b6ffd2a6c33549f8e61c29
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
41 files changed:
examples/quick/demos/photoviewer/PhotoViewerCore/AlbumDelegate.qml
examples/quick/demos/photoviewer/photoviewer.qml
examples/quick/demos/stocqt/stocqt.qml
examples/quick/draganddrop/doc/src/draganddrop.qdoc
examples/quick/draganddrop/views/gridview.qml
examples/quick/shadereffects/shadereffects.qml
examples/quick/tutorials/dynamicview/dynamicview3/dynamicview.qml
examples/quick/tutorials/dynamicview/dynamicview4/dynamicview.qml
examples/quick/tutorials/gettingStartedQml/core/MenuBar.qml
examples/quick/tutorials/gettingStartedQml/parts/part2/MenuBar.qml
examples/quick/tutorials/gettingStartedQml/parts/part3/MenuBar.qml
examples/quick/tutorials/gettingStartedQml/parts/part4/MenuBar.qml
examples/quick/tutorials/gettingStartedQml/parts/part5/core/MenuBar.qml
examples/quick/views/doc/src/views.qdoc
examples/quick/views/objectmodel/objectmodel.qml [moved from examples/quick/views/visualitemmodel/visualitemmodel.qml with 98% similarity]
examples/quick/views/package/view.qml
examples/quick/views/parallax/content/ParallaxView.qml
examples/quick/views/views.qml
examples/quick/views/views.qrc
examples/quick/views/visualdatamodel/dragselection.qml
examples/quick/views/visualdatamodel/slideshow.qml
src/imports/imports.pro
src/imports/models/models.pro [new file with mode: 0644]
src/imports/models/plugin.cpp [new file with mode: 0644]
src/imports/models/qmldir [new file with mode: 0644]
src/qml/items/items.pri
src/qml/items/qqmldelegatemodel.cpp
src/qml/items/qqmldelegatemodel_p.h
src/qml/items/qqmldelegatemodel_p_p.h
src/qml/items/qqmlmodelsmodule.cpp [new file with mode: 0644]
src/qml/items/qqmlmodelsmodule_p.h [new file with mode: 0644]
src/qml/items/qqmlobjectmodel.cpp
src/qml/qml/qqmlengine.cpp
src/qml/qml/qqmllistmodel.cpp
tests/auto/qml/qml.pro
tests/auto/qml/qtqmlmodules/data/base.qml [new file with mode: 0644]
tests/auto/qml/qtqmlmodules/data/models.qml [new file with mode: 0644]
tests/auto/qml/qtqmlmodules/data/unavailable.qml [new file with mode: 0644]
tests/auto/qml/qtqmlmodules/qtqmlmodules.pro [new file with mode: 0644]
tests/auto/qml/qtqmlmodules/tst_qtqmlmodules.cpp [new file with mode: 0644]
tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp

index 4bd5e33..d94231c 100644 (file)
@@ -41,6 +41,7 @@
 
 import QtQuick 2.0
 import QtQuick.XmlListModel 2.0
+import QtQml.Models 2.1
 
 Component {
     id: albumDelegate
@@ -69,7 +70,7 @@ Component {
             Package.name: 'album'
             id: albumWrapper; width: 210; height: 220
 
-            VisualDataModel {
+            DelegateModel {
                 id: visualModel; delegate: PhotoDelegate { }
                 model: RssModel { id: rssModel; tags: tag }
             }
index fa7c83f..df344ac 100644 (file)
@@ -40,6 +40,7 @@
 ****************************************************************************/
 
 import QtQuick 2.0
+import QtQml.Models 2.1
 import "PhotoViewerCore"
 
 Rectangle {
@@ -58,7 +59,7 @@ Rectangle {
         ListElement { tag: "Prague" }
     }
 
-    VisualDataModel { id: albumVisualModel; model: photosModel; delegate: AlbumDelegate {} }
+    DelegateModel { id: albumVisualModel; model: photosModel; delegate: AlbumDelegate {} }
 
     GridView {
         id: albumView; width: parent.width; height: parent.height; cellWidth: 210; cellHeight: 220
index ec35373..9bcffd9 100644 (file)
@@ -39,6 +39,7 @@
 ****************************************************************************/
 
 import QtQuick 2.0
+import QtQml.Models 2.1
 import "./content"
 
 ListView {
@@ -66,7 +67,7 @@ ListView {
         }
     }
 
-    model: VisualItemModel {
+    model: ObjectModel {
         StockListView {
             id: listView
             width: root.width
index 1844c3b..ad32cbc 100644 (file)
@@ -49,7 +49,7 @@
 
     \section2 GridView adds drag and drop to a GridView, allowing you to reorder the list.
 
-    It uses a VisualDataModel to move a delegate item to the position of another item
+    It uses a DelegateModel to move a delegate item to the position of another item
     it is dragged over.
 
     \snippet quick/draganddrop/views/gridview.qml 0
index 4df265e..f2c9c75 100644 (file)
@@ -39,6 +39,7 @@
 ****************************************************************************/
 
 import QtQuick 2.0
+import QtQml.Models 2.1
 
 GridView {
     id: root
@@ -50,7 +51,7 @@ GridView {
     }
 
 //! [0]
-    model: VisualDataModel {
+    model: DelegateModel {
 //! [0]
         id: visualModel
         model: ListModel {
@@ -84,7 +85,7 @@ GridView {
         delegate: MouseArea {
             id: delegateRoot
 
-            property int visualIndex: VisualDataModel.itemsIndex
+            property int visualIndex: DelegateModel.itemsIndex
 
             width: 80; height: 80
             drag.target: icon
index 77de356..a8f0469 100644 (file)
@@ -40,6 +40,7 @@
 ****************************************************************************/
 
 import QtQuick 2.0
+import QtQml.Models 2.1
 import "content"
 
 Rectangle {
@@ -85,7 +86,7 @@ Rectangle {
                 height: 140
                 clip: true
                 snapMode: ListView.SnapOneItem
-                model: VisualItemModel {
+                model: ObjectModel {
                     Text {
                         width: 160
                         height: 140
index 09c69df..7f353f0 100644 (file)
@@ -39,6 +39,7 @@
 ****************************************************************************/
 
 import QtQuick 2.0
+import QtQml.Models 2.1
 //![0]
 Rectangle {
     id: root
@@ -111,8 +112,8 @@ Rectangle {
 
                 onEntered: {
                     visualModel.items.move(
-                            drag.source.VisualDataModel.itemsIndex,
-                            dragArea.VisualDataModel.itemsIndex)
+                            drag.source.DelegateModel.itemsIndex,
+                            dragArea.DelegateModel.itemsIndex)
                 }
             }
 //![3]
@@ -120,7 +121,7 @@ Rectangle {
     }
 //![2]
 //![4]
-    VisualDataModel {
+    DelegateModel {
         id: visualModel
 
         model: PetsModel {}
index 6ff3f7e..82639c2 100644 (file)
@@ -39,6 +39,7 @@
 ****************************************************************************/
 
 import QtQuick 2.0
+import QtQml.Models 2.1
 
 Rectangle {
     id: root
@@ -112,14 +113,14 @@ Rectangle {
 
                 onEntered: {
                     visualModel.items.move(
-                            drag.source.VisualDataModel.itemsIndex,
-                            dragArea.VisualDataModel.itemsIndex)
+                            drag.source.DelegateModel.itemsIndex,
+                            dragArea.DelegateModel.itemsIndex)
                 }
             }
         }
     }
 //![0]
-    VisualDataModel {
+    DelegateModel {
         id: visualModel
 //![4]
         property var lessThan: [
index c6edcab..b53fc1b 100644 (file)
@@ -39,6 +39,7 @@
 ****************************************************************************/
 
 import QtQuick 2.0
+import QtQml.Models 2.1
 
 Rectangle {
     id: menuBar
@@ -128,7 +129,7 @@ Rectangle {
         }
     }
     //a list of visual items already have delegates handling their display
-    VisualItemModel {
+    ObjectModel {
         id: menuListModel
 
         FileMenu {
index 929052f..63b2a1c 100644 (file)
@@ -39,6 +39,7 @@
 ****************************************************************************/
 
 import QtQuick 2.0
+import QtQml.Models 2.1
 
 Rectangle {
     id: menuBar
@@ -99,7 +100,7 @@ Rectangle {
     }
 
     //a list of visual items already have delegates handling their display
-    VisualItemModel{
+    ObjectModel{
         id: menuListModel
 
         FileMenu{
index 929052f..63b2a1c 100644 (file)
@@ -39,6 +39,7 @@
 ****************************************************************************/
 
 import QtQuick 2.0
+import QtQml.Models 2.1
 
 Rectangle {
     id: menuBar
@@ -99,7 +100,7 @@ Rectangle {
     }
 
     //a list of visual items already have delegates handling their display
-    VisualItemModel{
+    ObjectModel{
         id: menuListModel
 
         FileMenu{
index 39b74e9..7bb1d2d 100644 (file)
@@ -39,6 +39,7 @@
 ****************************************************************************/
 
 import QtQuick 2.0
+import QtQml.Models 2.1
 
 Rectangle {
     id: menuBar
@@ -105,7 +106,7 @@ Rectangle {
     }
 
     //a list of visual items already have delegates handling their display
-    VisualItemModel{
+    ObjectModel{
         id: menuListModel
 
         FileMenu{
index 7ffa90c..3600be7 100644 (file)
@@ -39,6 +39,7 @@
 ****************************************************************************/
 
 import QtQuick 2.0
+import QtQml.Models 2.1
 
 Rectangle {
     id: menuBar
@@ -129,7 +130,7 @@ Rectangle {
         }
     }
     //a list of visual items already have delegates handling their display
-    VisualItemModel{
+    ObjectModel{
         id: menuListModel
 
         FileMenu{
index e48a665..658e51c 100644 (file)
 
     \snippet quick/views/package/Delegate.qml 0
 
-    A VisualDataModel allows the individual views to access their specific items from
+    A DelegateModel allows the individual views to access their specific items from
     the shared package delegate.
 
     \snippet quick/views/package/view.qml 0
 
-    \section2 VisualItemModel uses a VisualItemModel for the model instead of a ListModel.
+    \section2 ObjectModel uses an ObjectModel for the model instead of a ListModel.
 
     \snippet quick/views/visualitemmodel/visualitemmodel.qml 0
 */
 ****************************************************************************/
 
 // This example demonstrates placing items in a view using
-// a VisualItemModel
+// an ObjectModel
 
 import QtQuick 2.0
+import QtQml.Models 2.1
 
 Rectangle {
     id: root
@@ -51,7 +52,7 @@ Rectangle {
     property bool printDestruction: false
 
 //! [0]
-    VisualItemModel {
+    ObjectModel {
         id: itemModel
 
         Rectangle {
index 58ae5a4..820eb40 100644 (file)
@@ -39,6 +39,7 @@
 ****************************************************************************/
 
 import QtQuick 2.0
+import QtQml.Models 2.1
 
 Rectangle {
     id: root
@@ -64,7 +65,7 @@ Rectangle {
         ListElement { display: "Eight" }
     }
     //![0]
-    VisualDataModel {
+    DelegateModel {
         id: visualModel
         delegate: Delegate {}
         model: myModel
index 5bfed1a..e8c67c7 100644 (file)
@@ -39,6 +39,7 @@
 ****************************************************************************/
 
 import QtQuick 2.0
+import QtQml.Models 2.1
 
 Item {
     id: root
@@ -63,7 +64,7 @@ Item {
 
         orientation: Qt.Horizontal
         boundsBehavior: Flickable.DragOverBounds
-        model: VisualItemModel { id: visualModel }
+        model: ObjectModel { id: visualModel }
 
         highlightRangeMode: ListView.StrictlyEnforceRange
         snapMode: ListView.SnapOneItem
index d1dda2a..0724d11 100644 (file)
@@ -39,6 +39,7 @@
 ****************************************************************************/
 
 import QtQuick 2.0
+import QtQml.Models 2.1
 import "../shared" as Examples
 
 /*!
@@ -51,50 +52,50 @@ import "../shared" as Examples
     are focused on the views side, which is the visual representation of the data in the models.
 
     \section2 GridView and PathView demonstrate usage of these elements to display views.
-    \snippet examples/quick/modelviews/gridview/gridview-example.qml 0
+    \snippet examples/quick/views/gridview/gridview-example.qml 0
 
     \section2 Dynamic List demonstrates animation of runtime additions and removals to a ListView.
 
     The ListView.onAdd signal handler runs an animation when new items are added to the
     view, and the ListView.onRemove another when they are removed.
-    \snippet examples/quick/modelviews/listview/dynamiclist.qml 0
-    \snippet examples/quick/modelviews/listview/dynamiclist.qml 1
+    \snippet examples/quick/views/listview/dynamiclist.qml 0
+    \snippet examples/quick/views/listview/dynamiclist.qml 1
 
     \section2 Expanding Delegates demonstrates delegates that expand when activated.
 
     It has a complex delegate the size and appearance of which can change, displacing
     other items in the view.
-    \snippet examples/quick/modelviews/listview/expandingdelegates.qml 0
-    \snippet examples/quick/modelviews/listview/expandingdelegates.qml 1
-    \snippet examples/quick/modelviews/listview/expandingdelegates.qml 2
-    \snippet examples/quick/modelviews/listview/expandingdelegates.qml 3
+    \snippet examples/quick/views/listview/expandingdelegates.qml 0
+    \snippet examples/quick/views/listview/expandingdelegates.qml 1
+    \snippet examples/quick/views/listview/expandingdelegates.qml 2
+    \snippet examples/quick/views/listview/expandingdelegates.qml 3
 
     \section2 Highlight demonstrates adding a custom highlight to a ListView.
-    \snippet examples/quick/modelviews/listview/highlight.qml 0
+    \snippet examples/quick/views/listview/highlight.qml 0
 
     \section2 Highlight Ranges shows the three different highlight range modes of ListView.
-    \snippet examples/quick/modelviews/listview/highlightranges.qml 0
-    \snippet examples/quick/modelviews/listview/highlightranges.qml 1
-    \snippet examples/quick/modelviews/listview/highlightranges.qml 2
+    \snippet examples/quick/views/listview/highlightranges.qml 0
+    \snippet examples/quick/views/listview/highlightranges.qml 1
+    \snippet examples/quick/views/listview/highlightranges.qml 2
 
     \section2 Sections demonstrates the various section headers and footers available to ListView.
-    \snippet examples/quick/modelviews/listview/sections.qml 0
+    \snippet examples/quick/views/listview/sections.qml 0
 
     \section2 Packages demonstrates using Packages to transition delegates between two views.
 
     It has a Package which defines delegate items for each view and an item that can
     be transferred between delegates.
 
-    \snippet examples/quick/modelviews/package/Delegate.qml 0
+    \snippet examples/quick/views/package/Delegate.qml 0
 
-    A VisualDataModel allows the individual views to access their specific items from
+    A DelegateModel allows the individual views to access their specific items from
     the shared package delegate.
 
-    \snippet examples/quick/modelviews/package/view.qml 0
+    \snippet examples/quick/views/package/view.qml 0
 
-    \section2 VisualItemModel uses a VisualItemModel for the model instead of a ListModel.
+    \section2 ObjectModel uses a ObjectModel for the model instead of a ListModel.
 
-    \snippet examples/quick/modelviews/visualitemmodel/visualitemmodel.qml 0
+    \snippet examples/quick/views/objectmodel/objectmodel.qml 0
     */
 
     Item {
@@ -112,7 +113,7 @@ import "../shared" as Examples
                 addExample("Sections", "ListView section headers and footers", Qt.resolvedUrl("listview/sections.qml"))
                 addExample("Packages", "Transitions between a ListView and GridView", Qt.resolvedUrl("package/view.qml"))
                 addExample("PathView", "A simple PathView", Qt.resolvedUrl("pathview/pathview-example.qml"))
-                addExample("VisualItemModel", "Using a VisualItemModel", Qt.resolvedUrl("visualitemmodel/visualitemmodel.qml"))
+                addExample("ObjectModel", "Using a ObjectModel", Qt.resolvedUrl("objectmodel/objectmodel.qml"))
             }
         }
 }
index e35f128..434fa78 100644 (file)
@@ -63,7 +63,7 @@
         <file>pathview/pics/VideoPlayer_48.png</file>
         <file>visualdatamodel/slideshow.qml</file>
         <file>visualdatamodel/dragselection.qml</file>
-        <file>visualitemmodel/visualitemmodel.qml</file>
+        <file>objectmodel/objectmodel.qml</file>
         <file>views.qml</file>
     </qresource>
 </RCC>
index ec80cc7..5578268 100644 (file)
@@ -39,6 +39,7 @@
 ****************************************************************************/
 
 import QtQuick 2.0
+import QtQml.Models 2.1
 
 Item {
     id: root
@@ -59,7 +60,7 @@ Item {
 
                 width: 64
                 height: 64
-                enabled: packageRoot.VisualDataModel.inSelected
+                enabled: packageRoot.DelegateModel.inSelected
 
                 drag.target: draggable
 
@@ -83,7 +84,7 @@ Item {
                 }
                 DropArea {
                     anchors.fill: parent
-                    onEntered: selectedItems.move(0, visualModel.items.get(packageRoot.VisualDataModel.itemsIndex), selectedItems.count)
+                    onEntered: selectedItems.move(0, visualModel.items.get(packageRoot.DelegateModel.itemsIndex), selectedItems.count)
                 }
             }
             Item {
@@ -112,7 +113,7 @@ Item {
                 border.width: 2
                 border.color: "#007423"
 
-                state: root.dragging && packageRoot.VisualDataModel.inSelected ? "selected" : "visible"
+                state: root.dragging && packageRoot.DelegateModel.inSelected ? "selected" : "visible"
 
                 Text {
                     anchors.fill: parent
@@ -126,7 +127,7 @@ Item {
                 Rectangle {
                     anchors { right: parent.right; top: parent.top; margins: 3 }
                     width: 12; height: 12
-                    color: packageRoot.VisualDataModel.inSelected ? "black" : "white"
+                    color: packageRoot.DelegateModel.inSelected ? "black" : "white"
                     radius: 6
 
                     border.color: "white"
@@ -134,7 +135,7 @@ Item {
 
                     MouseArea {
                         anchors.fill: parent
-                        onClicked: packageRoot.VisualDataModel.inSelected = !packageRoot.VisualDataModel.inSelected
+                        onClicked: packageRoot.DelegateModel.inSelected = !packageRoot.DelegateModel.inSelected
                     }
                 }
 
@@ -142,19 +143,19 @@ Item {
                     State {
                         name: "selected"
                         ParentChange { target: content; parent: selectionContainer; x: 3; y: 3 }
-                        PropertyChanges { target: packageRoot; VisualDataModel.inItems: visibleContainer.drag.active }
+                        PropertyChanges { target: packageRoot; DelegateModel.inItems: visibleContainer.drag.active }
                         PropertyChanges { target: gradientStart; color: "#017423" }
                         PropertyChanges { target: gradientStart; color: "#007423" }
                     }, State {
                         name: "visible"
-                        PropertyChanges { target: packageRoot; VisualDataModel.inItems: true }
+                        PropertyChanges { target: packageRoot; DelegateModel.inItems: true }
                         ParentChange { target: content; parent: visibleContainer; x: 3; y: 3 }
                         PropertyChanges { target: gradientStart; color: "#8AC953" }
                         PropertyChanges { target: gradientStart; color: "#8BC953" }
                     }
                 ]
                 transitions: Transition {
-                    PropertyAction { target: packageRoot; properties: "VisualDataModel.inItems" }
+                    PropertyAction { target: packageRoot; properties: "DelegateModel.inItems" }
                     ParentAnimation {
                         target: content
                         NumberAnimation { target: content; properties: "x,y"; duration: 500 }
@@ -165,7 +166,7 @@ Item {
         }
     }
 
-    VisualDataModel {
+    DelegateModel {
         id: visualModel
         model: 35
         delegate: packageDelegate
index 77fe980..d3a4013 100644 (file)
@@ -40,6 +40,7 @@
 
 import QtQuick 2.0
 import QtQuick.XmlListModel 2.0
+import QtQml.Models 2.1
 
 Rectangle {
     id: root
@@ -50,7 +51,7 @@ Rectangle {
 
     color: "black"
 
-    VisualDataModel {
+    DelegateModel {
         id: visualModel
 
         model: XmlListModel {
@@ -97,14 +98,14 @@ Rectangle {
                         name: "inDisplay";
                         ParentChange { target: image; parent: imageContainer; x: 75; y: 75; width: 150; height: 150 }
                         PropertyChanges { target: image; z: 2 }
-                        PropertyChanges { target: delegateItem; VisualDataModel.inItems: false }
+                        PropertyChanges { target: delegateItem; DelegateModel.inItems: false }
                     },
                     State {
                         when: root.displayItem !== delegateItem
                         name: "inList";
                         ParentChange { target: image; parent: delegateItem; x: 2; y: 2; width: 75; height: 75 }
                         PropertyChanges { target: image; z: 1 }
-                        PropertyChanges { target: delegateItem; VisualDataModel.inItems: true }
+                        PropertyChanges { target: delegateItem; DelegateModel.inItems: true }
                     }
                 ]
 
@@ -112,7 +113,7 @@ Rectangle {
                     Transition {
                         from: "inList"
                         SequentialAnimation {
-                            PropertyAction { target: delegateItem; property: "VisualDataModel.inPersistedItems"; value: true }
+                            PropertyAction { target: delegateItem; property: "DelegateModel.inPersistedItems"; value: true }
                             ParentAnimation {
                                 target: image;
                                 via: root
@@ -126,7 +127,7 @@ Rectangle {
                                 target: image
                                 NumberAnimation { target: image; properties: "x,y,width,height"; duration: 1000 }
                             }
-                            PropertyAction { target: delegateItem; property: "VisualDataModel.inPersistedItems"; value: false }
+                            PropertyAction { target: delegateItem; property: "DelegateModel.inPersistedItems"; value: false }
                         }
                     }
                 ]
index e411a4f..733c7c4 100644 (file)
@@ -2,7 +2,8 @@ TEMPLATE = subdirs
 
 SUBDIRS += \
     folderlistmodel \
-    localstorage
+    localstorage \
+    models
 
 qtHaveModule(quick) {
     SUBDIRS += \
diff --git a/src/imports/models/models.pro b/src/imports/models/models.pro
new file mode 100644 (file)
index 0000000..e96d4b9
--- /dev/null
@@ -0,0 +1,11 @@
+CXX_MODULE = qml
+TARGET  = modelsplugin
+TARGETPATH = QtQml/Models.2
+IMPORT_VERSION = 2.1
+
+SOURCES += \
+    plugin.cpp
+
+QT += qml-private
+
+load(qml_plugin)
diff --git a/src/imports/models/plugin.cpp b/src/imports/models/plugin.cpp
new file mode 100644 (file)
index 0000000..127c781
--- /dev/null
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Research In Motion.
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.  For licensing terms and
+** conditions see http://qt.digia.com/licensing.  For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights.  These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtQml/qqmlextensionplugin.h>
+
+#include <private/qqmlmodelsmodule_p.h>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+    \qmlmodule QtQml.Models 2
+    \title Qt Qml Model QML Types
+    \ingroup qmlmodules
+    \brief Provides QML types for data models
+    \since 5.1
+
+    This QML module contains types for defining data models in QML.
+
+    To use the types in this module, import the module with the following line:
+
+    \code
+    import QtQml.Models 2.1
+    \endcode
+
+    Note that QtQml.Models module started at version 2.1 to match the version of the parent module.
+*/
+
+
+
+//![class decl]
+class QtQmlModelsPlugin : public QQmlExtensionPlugin
+{
+    Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface/1.0")
+public:
+    virtual void registerTypes(const char *uri)
+    {
+        Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQml.Models"));
+        Q_UNUSED(uri);
+        QQmlModelsModule::defineModule();
+    }
+};
+//![class decl]
+
+QT_END_NAMESPACE
+
+#include "plugin.moc"
diff --git a/src/imports/models/qmldir b/src/imports/models/qmldir
new file mode 100644 (file)
index 0000000..9cad5ef
--- /dev/null
@@ -0,0 +1,2 @@
+module QtQml.Models
+plugin modelsplugin
index 0fa489f..f5224f0 100644 (file)
@@ -1,10 +1,12 @@
 SOURCES += \
     $$PWD/qquickpackage.cpp \
     $$PWD/qqmldelegatemodel.cpp \
-    $$PWD/qqmlobjectmodel.cpp
+    $$PWD/qqmlobjectmodel.cpp \
+    $$PWD/qqmlmodelsmodule.cpp
 
 HEADERS += \
     $$PWD/qquickpackage_p.h \
     $$PWD/qqmldelegatemodel_p.h \
     $$PWD/qqmldelegatemodel_p_p.h \
-    $$PWD/qqmlobjectmodel_p.h
+    $$PWD/qqmlobjectmodel_p.h \
+    $$PWD/qqmlmodelsmodule_p.h
index 131b539..efbd98b 100644 (file)
@@ -126,16 +126,36 @@ QQmlDelegateModelParts::QQmlDelegateModelParts(QQmlDelegateModel *parent)
     \brief Encapsulates a model and delegate
 
     The VisualDataModel type encapsulates a model and the delegate that will
+    be instantiated for items in a model.
+
+    This type is provided by QtQuick 2 for compatibility reasons. The same implementation
+    is now primarily available as DelegateModel in the QtQml.Models module.
+
+    \sa {QtQml.Models2::DelegateModel}
+*/
+/*!
+    \qmltype DelegateModel
+    \instantiates QQmlDelegateModel
+    \inqmlmodule QtQml.Models 2
+    \brief Encapsulates a model and delegate
+
+    The DelegateModel type encapsulates a model and the delegate that will
+    be instantiated for items in the model.
+
+    This element is also available as DelegateModel in the QtQuick module. For full details,
+    see the \l DelegateModel documentation.
+
+    The DelegateModel type encapsulates a model and the delegate that will
     be instantiated for items in the model.
 
-    It is usually not necessary to create a VisualDataModel.
+    It is usually not necessary to create a DelegateModel.
     However, it can be useful for manipulating and accessing the \l modelIndex
     when a QAbstractItemModel subclass is used as the
-    model. Also, VisualDataModel is used together with \l Package to
-    provide delegates to multiple views, and with VisualDataGroup to sort and filter
+    model. Also, DelegateModel is used together with \l Package to
+    provide delegates to multiple views, and with DelegateModelGroup to sort and filter
     delegate items.
 
-    The example below illustrates using a VisualDataModel with a ListView.
+    The example below illustrates using a DelegateModel with a ListView.
 
     \snippet qml/visualdatamodel.qml 0
 */
@@ -173,10 +193,10 @@ void QQmlDelegateModelPrivate::init()
     Q_Q(QQmlDelegateModel);
     m_compositor.setRemoveGroups(Compositor::GroupMask & ~Compositor::PersistedFlag);
 
-    m_items = new QQmlDataGroup(QStringLiteral("items"), q, Compositor::Default, q);
+    m_items = new QQmlDelegateModelGroup(QStringLiteral("items"), q, Compositor::Default, q);
     m_items->setDefaultInclude(true);
-    m_persistedItems = new QQmlDataGroup(QStringLiteral("persistedItems"), q, Compositor::Persisted, q);
-    QQmlDataGroupPrivate::get(m_items)->emitters.insert(this);
+    m_persistedItems = new QQmlDelegateModelGroup(QStringLiteral("persistedItems"), q, Compositor::Persisted, q);
+    QQmlDelegateModelGroupPrivate::get(m_items)->emitters.insert(this);
 }
 
 QQmlDelegateModel::QQmlDelegateModel()
@@ -230,9 +250,9 @@ void QQmlDelegateModel::componentComplete()
     QStringList groupNames;
     groupNames.append(QStringLiteral("items"));
     groupNames.append(QStringLiteral("persistedItems"));
-    if (QQmlDataGroupPrivate::get(d->m_items)->defaultInclude)
+    if (QQmlDelegateModelGroupPrivate::get(d->m_items)->defaultInclude)
         defaultGroups |= Compositor::DefaultFlag;
-    if (QQmlDataGroupPrivate::get(d->m_persistedItems)->defaultInclude)
+    if (QQmlDelegateModelGroupPrivate::get(d->m_persistedItems)->defaultInclude)
         defaultGroups |= Compositor::PersistedFlag;
     for (int i = Compositor::MinimumGroupCount; i < d->m_groupCount; ++i) {
         QString name = d->m_groups[i]->name();
@@ -241,14 +261,14 @@ void QQmlDelegateModel::componentComplete()
             --d->m_groupCount;
             --i;
         } else if (name.at(0).isUpper()) {
-            qmlInfo(d->m_groups[i]) << QQmlDataGroup::tr("Group names must start with a lower case letter");
+            qmlInfo(d->m_groups[i]) << QQmlDelegateModelGroup::tr("Group names must start with a lower case letter");
             d->m_groups[i] = d->m_groups[d->m_groupCount - 1];
             --d->m_groupCount;
             --i;
         } else {
             groupNames.append(name);
 
-            QQmlDataGroupPrivate *group = QQmlDataGroupPrivate::get(d->m_groups[i]);
+            QQmlDelegateModelGroupPrivate *group = QQmlDelegateModelGroupPrivate::get(d->m_groups[i]);
             group->setModel(this, Compositor::Group(i));
             if (group->defaultInclude)
                 defaultGroups |= (1 << i);
@@ -281,8 +301,8 @@ void QQmlDelegateModel::componentComplete()
 }
 
 /*!
-    \qmlproperty model QtQuick2::VisualDataModel::model
-    This property holds the model providing data for the VisualDataModel.
+    \qmlproperty model QtQml.Models2::DelegateModel::model
+    This property holds the model providing data for the DelegateModel.
 
     The model provides a set of data that is used to create the items
     for a view.  For large or dynamic datasets the model is usually
@@ -322,7 +342,7 @@ void QQmlDelegateModel::setModel(const QVariant &model)
 }
 
 /*!
-    \qmlproperty Component QtQuick2::VisualDataModel::delegate
+    \qmlproperty Component QtQml.Models2::DelegateModel::delegate
 
     The delegate provides a template defining each item instantiated by a view.
     The index is exposed as an accessible \c index property.  Properties of the
@@ -338,7 +358,7 @@ void QQmlDelegateModel::setDelegate(QQmlComponent *delegate)
 {
     Q_D(QQmlDelegateModel);
     if (d->m_transaction) {
-        qmlInfo(this) << tr("The delegate of a VisualDataModel cannot be changed within onUpdated.");
+        qmlInfo(this) << tr("The delegate of a DelegateModel cannot be changed within onUpdated.");
         return;
     }
     bool wasValid = d->m_delegate != 0;
@@ -346,13 +366,13 @@ void QQmlDelegateModel::setDelegate(QQmlComponent *delegate)
     d->m_delegateValidated = false;
     if (wasValid && d->m_complete) {
         for (int i = 1; i < d->m_groupCount; ++i) {
-            QQmlDataGroupPrivate::get(d->m_groups[i])->changeSet.remove(
+            QQmlDelegateModelGroupPrivate::get(d->m_groups[i])->changeSet.remove(
                     0, d->m_compositor.count(Compositor::Group(i)));
         }
     }
     if (d->m_complete && d->m_delegate) {
         for (int i = 1; i < d->m_groupCount; ++i) {
-            QQmlDataGroupPrivate::get(d->m_groups[i])->changeSet.insert(
+            QQmlDelegateModelGroupPrivate::get(d->m_groups[i])->changeSet.insert(
                     0, d->m_compositor.count(Compositor::Group(i)));
         }
     }
@@ -360,7 +380,7 @@ void QQmlDelegateModel::setDelegate(QQmlComponent *delegate)
 }
 
 /*!
-    \qmlproperty QModelIndex QtQuick2::VisualDataModel::rootIndex
+    \qmlproperty QModelIndex QtQml.Models2::DelegateModel::rootIndex
 
     QAbstractItemModel provides a hierarchical tree of data, whereas
     QML only operates on list data.  \c rootIndex allows the children of
@@ -420,7 +440,7 @@ void QQmlDelegateModel::setRootIndex(const QVariant &root)
 }
 
 /*!
-    \qmlmethod QModelIndex QtQuick2::VisualDataModel::modelIndex(int index)
+    \qmlmethod QModelIndex QtQml.Models2::DelegateModel::modelIndex(int index)
 
     QAbstractItemModel provides a hierarchical tree of data, whereas
     QML only operates on list data.  This function assists in using
@@ -438,7 +458,7 @@ QVariant QQmlDelegateModel::modelIndex(int idx) const
 }
 
 /*!
-    \qmlmethod QModelIndex QtQuick2::VisualDataModel::parentModelIndex()
+    \qmlmethod QModelIndex QtQml.Models2::DelegateModel::parentModelIndex()
 
     QAbstractItemModel provides a hierarchical tree of data, whereas
     QML only operates on list data.  This function assists in using
@@ -456,7 +476,7 @@ QVariant QQmlDelegateModel::parentModelIndex() const
 }
 
 /*!
-    \qmlproperty int QtQuick2::VisualDataModel::count
+    \qmlproperty int QtQml.Models2::DelegateModel::count
 */
 
 int QQmlDelegateModel::count() const
@@ -506,7 +526,7 @@ void QQmlDelegateModel::cancel(int index)
 {
     Q_D(QQmlDelegateModel);
     if (!d->m_delegate || index < 0 || index >= d->m_compositor.count(d->m_compositorGroup)) {
-        qWarning() << "VisualDataModel::cancel: index out range" << index << d->m_compositor.count(d->m_compositorGroup);
+        qWarning() << "DelegateModel::cancel: index out range" << index << d->m_compositor.count(d->m_compositorGroup);
         return;
     }
 
@@ -538,13 +558,13 @@ void QQmlDelegateModel::cancel(int index)
 }
 
 void QQmlDelegateModelPrivate::group_append(
-        QQmlListProperty<QQmlDataGroup> *property, QQmlDataGroup *group)
+        QQmlListProperty<QQmlDelegateModelGroup> *property, QQmlDelegateModelGroup *group)
 {
     QQmlDelegateModelPrivate *d = static_cast<QQmlDelegateModelPrivate *>(property->data);
     if (d->m_complete)
         return;
     if (d->m_groupCount == Compositor::MaximumGroupCount) {
-        qmlInfo(d->q_func()) << QQmlDelegateModel::tr("The maximum number of supported VisualDataGroups is 8");
+        qmlInfo(d->q_func()) << QQmlDelegateModel::tr("The maximum number of supported DelegateModelGroups is 8");
         return;
     }
     d->m_groups[d->m_groupCount] = group;
@@ -552,14 +572,14 @@ void QQmlDelegateModelPrivate::group_append(
 }
 
 int QQmlDelegateModelPrivate::group_count(
-        QQmlListProperty<QQmlDataGroup> *property)
+        QQmlListProperty<QQmlDelegateModelGroup> *property)
 {
     QQmlDelegateModelPrivate *d = static_cast<QQmlDelegateModelPrivate *>(property->data);
     return d->m_groupCount - 1;
 }
 
-QQmlDataGroup *QQmlDelegateModelPrivate::group_at(
-        QQmlListProperty<QQmlDataGroup> *property, int index)
+QQmlDelegateModelGroup *QQmlDelegateModelPrivate::group_at(
+        QQmlListProperty<QQmlDelegateModelGroup> *property, int index)
 {
     QQmlDelegateModelPrivate *d = static_cast<QQmlDelegateModelPrivate *>(property->data);
     return index >= 0 && index < d->m_groupCount - 1
@@ -568,16 +588,16 @@ QQmlDataGroup *QQmlDelegateModelPrivate::group_at(
 }
 
 /*!
-    \qmlproperty list<VisualDataGroup> QtQuick2::VisualDataModel::groups
+    \qmlproperty list<DelegateModelGroup> QtQml.Models2::DelegateModel::groups
 
     This property holds a visual data model's group definitions.
 
     Groups define a sub-set of the items in a visual data model and can be used to filter
     a model.
 
-    For every group defined in a VisualDataModel two attached properties are added to each
-    delegate item.  The first of the form VisualDataModel.in\e{GroupName} holds whether the
-    item belongs to the group and the second VisualDataModel.\e{groupName}Index holds the
+    For every group defined in a DelegateModel two attached properties are added to each
+    delegate item.  The first of the form DelegateModel.in\e{GroupName} holds whether the
+    item belongs to the group and the second DelegateModel.\e{groupName}Index holds the
     index of the item in that group.
 
     The following example illustrates using groups to select items in a model.
@@ -585,10 +605,10 @@ QQmlDataGroup *QQmlDelegateModelPrivate::group_at(
     \snippet qml/visualdatagroup.qml 0
 */
 
-QQmlListProperty<QQmlDataGroup> QQmlDelegateModel::groups()
+QQmlListProperty<QQmlDelegateModelGroup> QQmlDelegateModel::groups()
 {
     Q_D(QQmlDelegateModel);
-    return QQmlListProperty<QQmlDataGroup>(
+    return QQmlListProperty<QQmlDelegateModelGroup>(
             this,
             d,
             QQmlDelegateModelPrivate::group_append,
@@ -598,19 +618,19 @@ QQmlListProperty<QQmlDataGroup> QQmlDelegateModel::groups()
 }
 
 /*!
-    \qmlproperty VisualDataGroup QtQuick2::VisualDataModel::items
+    \qmlproperty DelegateModelGroup QtQml.Models2::DelegateModel::items
 
     This property holds visual data model's default group to which all new items are added.
 */
 
-QQmlDataGroup *QQmlDelegateModel::items()
+QQmlDelegateModelGroup *QQmlDelegateModel::items()
 {
     Q_D(QQmlDelegateModel);
     return d->m_items;
 }
 
 /*!
-    \qmlproperty VisualDataGroup QtQuick2::VisualDataModel::persistedItems
+    \qmlproperty DelegateModelGroup QtQml.Models2::DelegateModel::persistedItems
 
     This property holds visual data model's persisted items group.
 
@@ -618,22 +638,22 @@ QQmlDataGroup *QQmlDelegateModel::items()
     until removed from the group.
 
     An item can be removed from the persistedItems group by setting the
-    VisualDataModel.inPersistedItems property to false.  If the item is not referenced by a view
+    DelegateModel.inPersistedItems property to false.  If the item is not referenced by a view
     at that time it will be destroyed.  Adding an item to this group will not create a new
     instance.
 
-    Items returned by the \l QtQuick2::VisualDataGroup::create() function are automatically added
+    Items returned by the \l QtQml.Models2::DelegateModelGroup::create() function are automatically added
     to this group.
 */
 
-QQmlDataGroup *QQmlDelegateModel::persistedItems()
+QQmlDelegateModelGroup *QQmlDelegateModel::persistedItems()
 {
     Q_D(QQmlDelegateModel);
     return d->m_persistedItems;
 }
 
 /*!
-    \qmlproperty string QtQuick2::VisualDataModel::filterOnGroup
+    \qmlproperty string QtQml.Models2::DelegateModel::filterOnGroup
 
     This property holds the name of the group used to filter the visual data model.
 
@@ -653,7 +673,7 @@ void QQmlDelegateModel::setFilterGroup(const QString &group)
     Q_D(QQmlDelegateModel);
 
     if (d->m_transaction) {
-        qmlInfo(this) << tr("The group of a VisualDataModel cannot be changed within onChanged");
+        qmlInfo(this) << tr("The group of a DelegateModel cannot be changed within onChanged");
         return;
     }
 
@@ -684,7 +704,7 @@ void QQmlDelegateModelPrivate::updateFilterGroup()
         }
     }
 
-    QQmlDataGroupPrivate::get(m_groups[m_compositorGroup])->emitters.insert(this);
+    QQmlDelegateModelGroupPrivate::get(m_groups[m_compositorGroup])->emitters.insert(this);
     if (m_compositorGroup != previousGroup) {
         QVector<QQmlChangeSet::Remove> removes;
         QVector<QQmlChangeSet::Insert> inserts;
@@ -705,9 +725,9 @@ void QQmlDelegateModelPrivate::updateFilterGroup()
 }
 
 /*!
-    \qmlproperty object QtQuick2::VisualDataModel::parts
+    \qmlproperty object QtQml.Models2::DelegateModel::parts
 
-    The \a parts property selects a VisualDataModel which creates
+    The \a parts property selects a DelegateModel which creates
     delegates from the part named.  This is used in conjunction with
     the \l Package type.
 
@@ -715,7 +735,7 @@ void QQmlDelegateModelPrivate::updateFilterGroup()
     delegates named \e list from a \l Package:
 
     \code
-    VisualDataModel {
+    DelegateModel {
         id: visualModel
         delegate: Package {
             Item { Package.name: "list" }
@@ -743,19 +763,19 @@ QObject *QQmlDelegateModel::parts()
 void QQmlDelegateModelPrivate::emitCreatedPackage(QQDMIncubationTask *incubationTask, QQuickPackage *package)
 {
     for (int i = 1; i < m_groupCount; ++i)
-        QQmlDataGroupPrivate::get(m_groups[i])->createdPackage(incubationTask->index[i], package);
+        QQmlDelegateModelGroupPrivate::get(m_groups[i])->createdPackage(incubationTask->index[i], package);
 }
 
 void QQmlDelegateModelPrivate::emitInitPackage(QQDMIncubationTask *incubationTask, QQuickPackage *package)
 {
     for (int i = 1; i < m_groupCount; ++i)
-        QQmlDataGroupPrivate::get(m_groups[i])->initPackage(incubationTask->index[i], package);
+        QQmlDelegateModelGroupPrivate::get(m_groups[i])->initPackage(incubationTask->index[i], package);
 }
 
 void QQmlDelegateModelPrivate::emitDestroyingPackage(QQuickPackage *package)
 {
     for (int i = 1; i < m_groupCount; ++i)
-        QQmlDataGroupPrivate::get(m_groups[i])->destroyingPackage(package);
+        QQmlDelegateModelGroupPrivate::get(m_groups[i])->destroyingPackage(package);
 }
 
 void QQDMIncubationTask::statusChanged(Status status)
@@ -842,7 +862,7 @@ QObject *QQmlDelegateModelPrivate::object(Compositor::Group group, int index, bo
 {
     Q_Q(QQmlDelegateModel);
     if (!m_delegate || index < 0 || index >= m_compositor.count(group)) {
-        qWarning() << "VisualDataModel::item: index out range" << index << m_compositor.count(group);
+        qWarning() << "DelegateModel::item: index out range" << index << m_compositor.count(group);
         return 0;
     } else if (!m_context->isValid()) {
         return 0;
@@ -936,7 +956,7 @@ QObject *QQmlDelegateModel::object(int index, bool asynchronous)
 {
     Q_D(QQmlDelegateModel);
     if (!d->m_delegate || index < 0 || index >= d->m_compositor.count(d->m_compositorGroup)) {
-        qWarning() << "VisualDataModel::item: index out range" << index << d->m_compositor.count(d->m_compositorGroup);
+        qWarning() << "DelegateModel::item: index out range" << index << d->m_compositor.count(d->m_compositorGroup);
         return 0;
     }
 
@@ -1053,7 +1073,7 @@ void QQmlDelegateModelPrivate::itemsChanged(const QVector<Compositor::Change> &c
     }
 
     for (int i = 1; i < m_groupCount; ++i)
-        QQmlDataGroupPrivate::get(m_groups[i])->changeSet.change(translatedChanges.at(i));
+        QQmlDelegateModelGroupPrivate::get(m_groups[i])->changeSet.change(translatedChanges.at(i));
 }
 
 void QQmlDelegateModel::_q_itemsChanged(int index, int count, const QVector<int> &roles)
@@ -1148,7 +1168,7 @@ void QQmlDelegateModelPrivate::itemsInserted(const QVector<Compositor::Insert> &
         return;
 
     for (int i = 1; i < m_groupCount; ++i)
-        QQmlDataGroupPrivate::get(m_groups[i])->changeSet.insert(translatedInserts.at(i));
+        QQmlDelegateModelGroupPrivate::get(m_groups[i])->changeSet.insert(translatedInserts.at(i));
 }
 
 void QQmlDelegateModel::_q_itemsInserted(int index, int count)
@@ -1265,7 +1285,7 @@ void QQmlDelegateModelPrivate::itemsRemoved(const QVector<Compositor::Remove> &r
         return;
 
     for (int i = 1; i < m_groupCount; ++i)
-       QQmlDataGroupPrivate::get(m_groups[i])->changeSet.remove(translatedRemoves.at(i));
+       QQmlDelegateModelGroupPrivate::get(m_groups[i])->changeSet.remove(translatedRemoves.at(i));
 }
 
 void QQmlDelegateModel::_q_itemsRemoved(int index, int count)
@@ -1307,7 +1327,7 @@ void QQmlDelegateModelPrivate::itemsMoved(
         return;
 
     for (int i = 1; i < m_groupCount; ++i) {
-        QQmlDataGroupPrivate::get(m_groups[i])->changeSet.move(
+        QQmlDelegateModelGroupPrivate::get(m_groups[i])->changeSet.move(
                     translatedRemoves.at(i),
                     translatedInserts.at(i));
     }
@@ -1372,13 +1392,13 @@ void QQmlDelegateModelPrivate::emitChanges()
     m_transaction = true;
     QV8Engine *engine = QQmlEnginePrivate::getV8Engine(m_context->engine());
     for (int i = 1; i < m_groupCount; ++i)
-        QQmlDataGroupPrivate::get(m_groups[i])->emitChanges(engine);
+        QQmlDelegateModelGroupPrivate::get(m_groups[i])->emitChanges(engine);
     m_transaction = false;
 
     const bool reset = m_reset;
     m_reset = false;
     for (int i = 1; i < m_groupCount; ++i)
-        QQmlDataGroupPrivate::get(m_groups[i])->emitModelUpdated(reset);
+        QQmlDelegateModelGroupPrivate::get(m_groups[i])->emitModelUpdated(reset);
 
     foreach (QQmlDelegateModelItem *cacheItem, m_cache) {
         if (cacheItem->attached)
@@ -1931,7 +1951,7 @@ QQmlDelegateModelAttached::QQmlDelegateModelAttached(
 }
 
 /*!
-    \qmlattachedproperty int QtQuick2::VisualDataModel::model
+    \qmlattachedproperty int QtQml.Models2::DelegateModel::model
 
     This attached property holds the visual data model this delegate instance belongs to.
 
@@ -1944,9 +1964,9 @@ QQmlDelegateModel *QQmlDelegateModelAttached::model() const
 }
 
 /*!
-    \qmlattachedproperty stringlist QtQuick2::VisualDataModel::groups
+    \qmlattachedproperty stringlist QtQml.Models2::DelegateModel::groups
 
-    This attached property holds the name of VisualDataGroups the item belongs to.
+    This attached property holds the name of DelegateModelGroups the item belongs to.
 
     It is attached to each instance of the delegate.
 */
@@ -1978,12 +1998,12 @@ void QQmlDelegateModelAttached::setGroups(const QStringList &groups)
 }
 
 /*!
-    \qmlattachedproperty bool QtQuick2::VisualDataModel::isUnresolved
+    \qmlattachedproperty bool QtQml.Models2::DelegateModel::isUnresolved
 
     This attached property holds whether the visual item is bound to a data model index.
     Returns true if the item is not bound to the model, and false if it is.
 
-    An unresolved item can be bound to the data model using the VisualDataGroup::resolve()
+    An unresolved item can be bound to the data model using the DelegateModelGroup::resolve()
     function.
 
     It is attached to each instance of the delegate.
@@ -1998,9 +2018,9 @@ bool QQmlDelegateModelAttached::isUnresolved() const
 }
 
 /*!
-    \qmlattachedproperty int QtQuick2::VisualDataModel::inItems
+    \qmlattachedproperty int QtQml.Models2::DelegateModel::inItems
 
-    This attached property holds whether the item belongs to the default \l items VisualDataGroup.
+    This attached property holds whether the item belongs to the default \l items DelegateModelGroup.
 
     Changing this property will add or remove the item from the items group.
 
@@ -2008,17 +2028,17 @@ bool QQmlDelegateModelAttached::isUnresolved() const
 */
 
 /*!
-    \qmlattachedproperty int QtQuick2::VisualDataModel::itemsIndex
+    \qmlattachedproperty int QtQml.Models2::DelegateModel::itemsIndex
 
-    This attached property holds the index of the item in the default \l items VisualDataGroup.
+    This attached property holds the index of the item in the default \l items DelegateModelGroup.
 
     It is attached to each instance of the delegate.
 */
 
 /*!
-    \qmlattachedproperty int QtQuick2::VisualDataModel::inPersistedItems
+    \qmlattachedproperty int QtQml.Models2::DelegateModel::inPersistedItems
 
-    This attached property holds whether the item belongs to the \l persistedItems VisualDataGroup.
+    This attached property holds whether the item belongs to the \l persistedItems DelegateModelGroup.
 
     Changing this property will add or remove the item from the items group.  Change with caution
     as removing an item from the persistedItems group will destroy the current instance if it is
@@ -2028,9 +2048,9 @@ bool QQmlDelegateModelAttached::isUnresolved() const
 */
 
 /*!
-    \qmlattachedproperty int QtQuick2::VisualDataModel::persistedItemsIndex
+    \qmlattachedproperty int QtQml.Models2::DelegateModel::persistedItemsIndex
 
-    This attached property holds the index of the item in the \l persistedItems VisualDataGroup.
+    This attached property holds the index of the item in the \l persistedItems DelegateModelGroup.
 
     It is attached to each instance of the delegate.
 */
@@ -2065,22 +2085,22 @@ void QQmlDelegateModelAttached::emitChanges()
 
 //============================================================================
 
-void QQmlDataGroupPrivate::setModel(QQmlDelegateModel *m, Compositor::Group g)
+void QQmlDelegateModelGroupPrivate::setModel(QQmlDelegateModel *m, Compositor::Group g)
 {
     Q_ASSERT(!model);
     model = m;
     group = g;
 }
 
-bool QQmlDataGroupPrivate::isChangedConnected()
+bool QQmlDelegateModelGroupPrivate::isChangedConnected()
 {
-    Q_Q(QQmlDataGroup);
-    IS_SIGNAL_CONNECTED(q, QQmlDataGroup, changed, (const QQmlV8Handle &,const QQmlV8Handle &));
+    Q_Q(QQmlDelegateModelGroup);
+    IS_SIGNAL_CONNECTED(q, QQmlDelegateModelGroup, changed, (const QQmlV8Handle &,const QQmlV8Handle &));
 }
 
-void QQmlDataGroupPrivate::emitChanges(QV8Engine *engine)
+void QQmlDelegateModelGroupPrivate::emitChanges(QV8Engine *engine)
 {
-    Q_Q(QQmlDataGroup);
+    Q_Q(QQmlDelegateModelGroup);
     if (isChangedConnected() && !changeSet.isEmpty()) {
         v8::HandleScope handleScope;
         v8::Context::Scope contextScope(engine->context());
@@ -2092,101 +2112,116 @@ void QQmlDataGroupPrivate::emitChanges(QV8Engine *engine)
         emit q->countChanged();
 }
 
-void QQmlDataGroupPrivate::emitModelUpdated(bool reset)
+void QQmlDelegateModelGroupPrivate::emitModelUpdated(bool reset)
 {
-    for (QQmlDataGroupEmitterList::iterator it = emitters.begin(); it != emitters.end(); ++it)
+    for (QQmlDelegateModelGroupEmitterList::iterator it = emitters.begin(); it != emitters.end(); ++it)
         it->emitModelUpdated(changeSet, reset);
     changeSet.clear();
 }
 
-void QQmlDataGroupPrivate::createdPackage(int index, QQuickPackage *package)
+void QQmlDelegateModelGroupPrivate::createdPackage(int index, QQuickPackage *package)
 {
-    for (QQmlDataGroupEmitterList::iterator it = emitters.begin(); it != emitters.end(); ++it)
+    for (QQmlDelegateModelGroupEmitterList::iterator it = emitters.begin(); it != emitters.end(); ++it)
         it->createdPackage(index, package);
 }
 
-void QQmlDataGroupPrivate::initPackage(int index, QQuickPackage *package)
+void QQmlDelegateModelGroupPrivate::initPackage(int index, QQuickPackage *package)
 {
-    for (QQmlDataGroupEmitterList::iterator it = emitters.begin(); it != emitters.end(); ++it)
+    for (QQmlDelegateModelGroupEmitterList::iterator it = emitters.begin(); it != emitters.end(); ++it)
         it->initPackage(index, package);
 }
 
-void QQmlDataGroupPrivate::destroyingPackage(QQuickPackage *package)
+void QQmlDelegateModelGroupPrivate::destroyingPackage(QQuickPackage *package)
 {
-    for (QQmlDataGroupEmitterList::iterator it = emitters.begin(); it != emitters.end(); ++it)
+    for (QQmlDelegateModelGroupEmitterList::iterator it = emitters.begin(); it != emitters.end(); ++it)
         it->destroyingPackage(package);
 }
 
 /*!
-    \qmltype VisualDataGroup
-    \instantiates QQmlDataGroup
+    \qmltype DelegateModelGroup
+    \instantiates QQmlDelegateModelGroup
     \inqmlmodule QtQuick 2
     \ingroup qtquick-models
     \brief Encapsulates a filtered set of visual data items
 
-    The VisualDataGroup type provides a means to address the model data of a VisualDataModel's
+    The DelegateModelGroup type provides a means to address the model data of a DelegateModel's
     delegate items, as well as sort and filter these delegate items.
 
-    The initial set of instantiable delegate items in a VisualDataModel is represented
-    by its \l {QtQuick2::VisualDataModel::items}{items} group, which normally directly reflects
-    the contents of the model assigned to VisualDataModel::model.  This set can be changed to
-    the contents of any other member of VisualDataModel::groups by assigning the  \l name of that
-    VisualDataGroup to the VisualDataModel::filterOnGroup property.
+    The initial set of instantiable delegate items in a DelegateModel is represented
+    by its \l {QtQml.Models2::DelegateModel::items}{items} group, which normally directly reflects
+    the contents of the model assigned to DelegateModel::model.  This set can be changed to
+    the contents of any other member of DelegateModel::groups by assigning the  \l name of that
+    DelegateModelGroup to the DelegateModel::filterOnGroup property.
 
-    The data of an item in a VisualDataGroup can be accessed using the get() function, which returns
+    The data of an item in a DelegateModelGroup can be accessed using the get() function, which returns
     information about group membership and indexes as well as model data.  In combination
     with the move() function this can be used to implement view sorting, with remove() to filter
     items out of a view, or with setGroups() and \l Package delegates to categorize items into
     different views.
 
-    Data from models can be supplemented by inserting data directly into a VisualDataGroup
+    Data from models can be supplemented by inserting data directly into a DelegateModelGroup
     with the insert() function.  This can be used to introduce mock items into a view, or
     placeholder items that are later \l {resolve()}{resolved} to real model data when it becomes
     available.
 
-    Delegate items can also be be instantiated directly from a VisualDataGroup using the
-    create() function, making it possible to use VisualDataModel without an accompanying view
+    Delegate items can also be be instantiated directly from a DelegateModelGroup using the
+    create() function, making it possible to use DelegateModel without an accompanying view
     type or to cherry-pick specific items that should be instantiated irregardless of whether
     they're currently within a view's visible area.
 
     \sa {QML Dynamic View Ordering Tutorial}
 */
+/*!
+    \qmltype DelegateModelGroup
+    \instantiates QQmlDelegateModelGroup
+    \inqmlmodule QtQml.Models 2
+    \brief Encapsulates a filtered set of visual data items
+
+    The DelegateModelGroup type provides a means to address the model data of a DelegateModel's
+    delegate items, as well as sort and filter these delegate items.
+
+    This element is also available as DelegateModelGroup in the QtQuick module. For full details,
+    see the \l DelegateModelGroup documentation.
+
+    \sa {QtQuick::DelegateModelGroup}
+*/
+
 
-QQmlDataGroup::QQmlDataGroup(QObject *parent)
-    : QObject(*new QQmlDataGroupPrivate, parent)
+QQmlDelegateModelGroup::QQmlDelegateModelGroup(QObject *parent)
+    : QObject(*new QQmlDelegateModelGroupPrivate, parent)
 {
 }
 
-QQmlDataGroup::QQmlDataGroup(
+QQmlDelegateModelGroup::QQmlDelegateModelGroup(
         const QString &name, QQmlDelegateModel *model, int index, QObject *parent)
-    : QObject(*new QQmlDataGroupPrivate, parent)
+    : QObject(*new QQmlDelegateModelGroupPrivate, parent)
 {
-    Q_D(QQmlDataGroup);
+    Q_D(QQmlDelegateModelGroup);
     d->name = name;
     d->setModel(model, Compositor::Group(index));
 }
 
-QQmlDataGroup::~QQmlDataGroup()
+QQmlDelegateModelGroup::~QQmlDelegateModelGroup()
 {
 }
 
 /*!
-    \qmlproperty string QtQuick2::VisualDataGroup::name
+    \qmlproperty string QtQml.Models2::DelegateModelGroup::name
 
     This property holds the name of the group.
 
     Each group in a model must have a unique name starting with a lower case letter.
 */
 
-QString QQmlDataGroup::name() const
+QString QQmlDelegateModelGroup::name() const
 {
-    Q_D(const QQmlDataGroup);
+    Q_D(const QQmlDelegateModelGroup);
     return d->name;
 }
 
-void QQmlDataGroup::setName(const QString &name)
+void QQmlDelegateModelGroup::setName(const QString &name)
 {
-    Q_D(QQmlDataGroup);
+    Q_D(QQmlDelegateModelGroup);
     if (d->model)
         return;
     if (d->name != name) {
@@ -2196,34 +2231,34 @@ void QQmlDataGroup::setName(const QString &name)
 }
 
 /*!
-    \qmlproperty int QtQuick2::VisualDataGroup::count
+    \qmlproperty int QtQml.Models2::DelegateModelGroup::count
 
     This property holds the number of items in the group.
 */
 
-int QQmlDataGroup::count() const
+int QQmlDelegateModelGroup::count() const
 {
-    Q_D(const QQmlDataGroup);
+    Q_D(const QQmlDelegateModelGroup);
     if (!d->model)
         return 0;
     return QQmlDelegateModelPrivate::get(d->model)->m_compositor.count(d->group);
 }
 
 /*!
-    \qmlproperty bool QtQuick2::VisualDataGroup::includeByDefault
+    \qmlproperty bool QtQml.Models2::DelegateModelGroup::includeByDefault
 
     This property holds whether new items are assigned to this group by default.
 */
 
-bool QQmlDataGroup::defaultInclude() const
+bool QQmlDelegateModelGroup::defaultInclude() const
 {
-    Q_D(const QQmlDataGroup);
+    Q_D(const QQmlDelegateModelGroup);
     return d->defaultInclude;
 }
 
-void QQmlDataGroup::setDefaultInclude(bool include)
+void QQmlDelegateModelGroup::setDefaultInclude(bool include)
 {
-    Q_D(QQmlDataGroup);
+    Q_D(QQmlDelegateModelGroup);
     if (d->defaultInclude != include) {
         d->defaultInclude = include;
 
@@ -2238,32 +2273,32 @@ void QQmlDataGroup::setDefaultInclude(bool include)
 }
 
 /*!
-    \qmlmethod object QtQuick2::VisualDataGroup::get(int index)
+    \qmlmethod object QtQml.Models2::DelegateModelGroup::get(int index)
 
     Returns a javascript object describing the item at \a index in the group.
 
     The returned object contains the same information that is available to a delegate from the
-    VisualDataModel attached as well as the model for that item.  It has the properties:
+    DelegateModel attached as well as the model for that item.  It has the properties:
 
     \list
     \li \b model The model data of the item.  This is the same as the model context property in
     a delegate
     \li \b groups A list the of names of groups the item is a member of.  This property can be
     written to change the item's membership.
-    \li \b inItems Whether the item belongs to the \l {QtQuick2::VisualDataModel::items}{items} group.
+    \li \b inItems Whether the item belongs to the \l {QtQml.Models2::DelegateModel::items}{items} group.
     Writing to this property will add or remove the item from the group.
-    \li \b itemsIndex The index of the item within the \l {QtQuick2::VisualDataModel::items}{items} group.
+    \li \b itemsIndex The index of the item within the \l {QtQml.Models2::DelegateModel::items}{items} group.
     \li \b {in<GroupName>} Whether the item belongs to the dynamic group \e groupName.  Writing to
     this property will add or remove the item from the group.
     \li \b {<groupName>Index} The index of the item within the dynamic group \e groupName.
     \li \b isUnresolved Whether the item is bound to an index in the model assigned to
-    VisualDataModel::model.  Returns true if the item is not bound to the model, and false if it is.
+    DelegateModel::model.  Returns true if the item is not bound to the model, and false if it is.
     \endlist
 */
 
-QQmlV8Handle QQmlDataGroup::get(int index)
+QQmlV8Handle QQmlDelegateModelGroup::get(int index)
 {
-    Q_D(QQmlDataGroup);
+    Q_D(QQmlDelegateModelGroup);
     if (!d->model)
         return QQmlV8Handle::fromHandle(v8::Undefined());;
 
@@ -2300,7 +2335,7 @@ QQmlV8Handle QQmlDataGroup::get(int index)
     return QQmlV8Handle::fromHandle(handle);
 }
 
-bool QQmlDataGroupPrivate::parseIndex(
+bool QQmlDelegateModelGroupPrivate::parseIndex(
         const v8::Local<v8::Value> &value, int *index, Compositor::Group *group) const
 {
     if (value->IsInt32()) {
@@ -2321,25 +2356,25 @@ bool QQmlDataGroupPrivate::parseIndex(
 }
 
 /*!
-    \qmlmethod QtQuick2::VisualDataGroup::insert(int index, jsdict data, array groups = undefined)
-    \qmlmethod QtQuick2::VisualDataGroup::insert(jsdict data, var groups = undefined)
+    \qmlmethod QtQml.Models2::DelegateModelGroup::insert(int index, jsdict data, array groups = undefined)
+    \qmlmethod QtQml.Models2::DelegateModelGroup::insert(jsdict data, var groups = undefined)
 
-    Creates a new entry at \a index in a VisualDataModel with the values from \a data that
-    correspond to roles in the model assigned to VisualDataModel::model.
+    Creates a new entry at \a index in a DelegateModel with the values from \a data that
+    correspond to roles in the model assigned to DelegateModel::model.
 
     If no index is supplied the data is appended to the model.
 
     The optional \a groups parameter identifies the groups the new entry should belong to,
     if unspecified this is equal to the group insert was called on.
 
-    Data inserted into a VisualDataModel can later be merged with an existing entry in
-    VisualDataModel::model using the \l resolve() function.  This can be used to create placeholder
+    Data inserted into a DelegateModel can later be merged with an existing entry in
+    DelegateModel::model using the \l resolve() function.  This can be used to create placeholder
     items that are later replaced by actual data.
 */
 
-void QQmlDataGroup::insert(QQmlV8Function *args)
+void QQmlDelegateModelGroup::insert(QQmlV8Function *args)
 {
-    Q_D(QQmlDataGroup);
+    Q_D(QQmlDelegateModelGroup);
     QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(d->model);
 
     int index = model->m_compositor.count(d->group);
@@ -2377,9 +2412,9 @@ void QQmlDataGroup::insert(QQmlV8Function *args)
 }
 
 /*!
-    \qmlmethod QtQuick2::VisualDataGroup::create(int index)
-    \qmlmethod QtQuick2::VisualDataGroup::create(int index, jsdict data, array groups = undefined)
-    \qmlmethod QtQuick2::VisualDataGroup::create(jsdict data, array groups = undefined)
+    \qmlmethod QtQml.Models2::DelegateModelGroup::create(int index)
+    \qmlmethod QtQml.Models2::DelegateModelGroup::create(int index, jsdict data, array groups = undefined)
+    \qmlmethod QtQml.Models2::DelegateModelGroup::create(jsdict data, array groups = undefined)
 
     Returns a reference to the instantiated item at \a index in the group.
 
@@ -2389,13 +2424,13 @@ void QQmlDataGroup::insert(QQmlV8Function *args)
     was called on.
 
     All items returned by create are added to the
-    \l {QtQuick2::VisualDataModel::persistedItems}{persistedItems} group.  Items in this
+    \l {QtQml.Models2::DelegateModel::persistedItems}{persistedItems} group.  Items in this
     group remain instantiated when not referenced by any view.
 */
 
-void QQmlDataGroup::create(QQmlV8Function *args)
+void QQmlDelegateModelGroup::create(QQmlV8Function *args)
 {
-    Q_D(QQmlDataGroup);
+    Q_D(QQmlDelegateModelGroup);
     if (!d->model)
         return;
 
@@ -2450,24 +2485,24 @@ void QQmlDataGroup::create(QQmlV8Function *args)
 }
 
 /*!
-    \qmlmethod QtQuick2::VisualDataGroup::resolve(int from, int to)
+    \qmlmethod QtQml.Models2::DelegateModelGroup::resolve(int from, int to)
 
-    Binds an unresolved item at \a from to an item in VisualDataModel::model at index \a to.
+    Binds an unresolved item at \a from to an item in DelegateModel::model at index \a to.
 
-    Unresolved items are entries whose data has been \l {insert()}{inserted} into a VisualDataGroup
-    instead of being derived from a VisualDataModel::model index.  Resolving an item will replace
+    Unresolved items are entries whose data has been \l {insert()}{inserted} into a DelegateModelGroup
+    instead of being derived from a DelegateModel::model index.  Resolving an item will replace
     the item at the target index with the unresolved item. A resolved an item will reflect the data
     of the source model at its bound index and will move when that index moves like any other item.
 
-    If a new item is replaced in the VisualDataGroup onChanged() handler its insertion and
+    If a new item is replaced in the DelegateModelGroup onChanged() handler its insertion and
     replacement will be communicated to views as an atomic operation, creating the appearance
     that the model contents have not changed, or if the unresolved and model item are not adjacent
     that the previously unresolved item has simply moved.
 
 */
-void QQmlDataGroup::resolve(QQmlV8Function *args)
+void QQmlDelegateModelGroup::resolve(QQmlV8Function *args)
 {
-    Q_D(QQmlDataGroup);
+    Q_D(QQmlDelegateModelGroup);
     if (!d->model)
         return;
 
@@ -2560,14 +2595,14 @@ void QQmlDataGroup::resolve(QQmlV8Function *args)
 }
 
 /*!
-    \qmlmethod QtQuick2::VisualDataGroup::remove(int index, int count)
+    \qmlmethod QtQml.Models2::DelegateModelGroup::remove(int index, int count)
 
     Removes \a count items starting at \a index from the group.
 */
 
-void QQmlDataGroup::remove(QQmlV8Function *args)
+void QQmlDelegateModelGroup::remove(QQmlV8Function *args)
 {
-    Q_D(QQmlDataGroup);
+    Q_D(QQmlDelegateModelGroup);
     if (!d->model)
         return;
     Compositor::Group group = d->group;
@@ -2603,7 +2638,7 @@ void QQmlDataGroup::remove(QQmlV8Function *args)
     }
 }
 
-bool QQmlDataGroupPrivate::parseGroupArgs(
+bool QQmlDelegateModelGroupPrivate::parseGroupArgs(
         QQmlV8Function *args, Compositor::Group *group, int *index, int *count, int *groups) const
 {
     if (!model || !QQmlDelegateModelPrivate::get(model)->m_cacheMetaType)
@@ -2632,14 +2667,14 @@ bool QQmlDataGroupPrivate::parseGroupArgs(
 }
 
 /*!
-    \qmlmethod QtQuick2::VisualDataGroup::addGroups(int index, int count, stringlist groups)
+    \qmlmethod QtQml.Models2::DelegateModelGroup::addGroups(int index, int count, stringlist groups)
 
     Adds \a count items starting at \a index to \a groups.
 */
 
-void QQmlDataGroup::addGroups(QQmlV8Function *args)
+void QQmlDelegateModelGroup::addGroups(QQmlV8Function *args)
 {
-    Q_D(QQmlDataGroup);
+    Q_D(QQmlDelegateModelGroup);
     Compositor::Group group = d->group;
     int index = -1;
     int count = 1;
@@ -2662,14 +2697,14 @@ void QQmlDataGroup::addGroups(QQmlV8Function *args)
 }
 
 /*!
-    \qmlmethod QtQuick2::VisualDataGroup::removeGroups(int index, int count, stringlist groups)
+    \qmlmethod QtQml.Models2::DelegateModelGroup::removeGroups(int index, int count, stringlist groups)
 
     Removes \a count items starting at \a index from \a groups.
 */
 
-void QQmlDataGroup::removeGroups(QQmlV8Function *args)
+void QQmlDelegateModelGroup::removeGroups(QQmlV8Function *args)
 {
-    Q_D(QQmlDataGroup);
+    Q_D(QQmlDelegateModelGroup);
     Compositor::Group group = d->group;
     int index = -1;
     int count = 1;
@@ -2692,14 +2727,14 @@ void QQmlDataGroup::removeGroups(QQmlV8Function *args)
 }
 
 /*!
-    \qmlmethod QtQuick2::VisualDataGroup::setGroups(int index, int count, stringlist groups)
+    \qmlmethod QtQml.Models2::DelegateModelGroup::setGroups(int index, int count, stringlist groups)
 
     Sets the \a groups \a count items starting at \a index belong to.
 */
 
-void QQmlDataGroup::setGroups(QQmlV8Function *args)
+void QQmlDelegateModelGroup::setGroups(QQmlV8Function *args)
 {
-    Q_D(QQmlDataGroup);
+    Q_D(QQmlDelegateModelGroup);
     Compositor::Group group = d->group;
     int index = -1;
     int count = 1;
@@ -2722,20 +2757,20 @@ void QQmlDataGroup::setGroups(QQmlV8Function *args)
 }
 
 /*!
-    \qmlmethod QtQuick2::VisualDataGroup::setGroups(int index, int count, stringlist groups)
+    \qmlmethod QtQml.Models2::DelegateModelGroup::setGroups(int index, int count, stringlist groups)
 
     Sets the \a groups \a count items starting at \a index belong to.
 */
 
 /*!
-    \qmlmethod QtQuick2::VisualDataGroup::move(var from, var to, int count)
+    \qmlmethod QtQml.Models2::DelegateModelGroup::move(var from, var to, int count)
 
     Moves \a count at \a from in a group \a to a new position.
 */
 
-void QQmlDataGroup::move(QQmlV8Function *args)
+void QQmlDelegateModelGroup::move(QQmlV8Function *args)
 {
-    Q_D(QQmlDataGroup);
+    Q_D(QQmlDelegateModelGroup);
 
     if (args->Length() < 2)
         return;
@@ -2782,7 +2817,7 @@ void QQmlDataGroup::move(QQmlV8Function *args)
 }
 
 /*!
-    \qmlsignal QtQuick2::VisualDataGroup::onChanged(array removed, array inserted)
+    \qmlsignal QtQml.Models2::DelegateModelGroup::onChanged(array removed, array inserted)
 
     This handler is called when items have been removed from or inserted into the group.
 
@@ -2804,7 +2839,7 @@ QQmlPartsModel::QQmlPartsModel(QQmlDelegateModel *model, const QString &part, QO
 {
     QQmlDelegateModelPrivate *d = QQmlDelegateModelPrivate::get(m_model);
     if (d->m_cacheMetaType) {
-        QQmlDataGroupPrivate::get(d->m_groups[1])->emitters.insert(this);
+        QQmlDelegateModelGroupPrivate::get(d->m_groups[1])->emitters.insert(this);
         m_compositorGroup = Compositor::Default;
     } else {
         d->m_pendingParts.insert(this);
@@ -2825,7 +2860,7 @@ QString QQmlPartsModel::filterGroup() const
 void QQmlPartsModel::setFilterGroup(const QString &group)
 {
     if (QQmlDelegateModelPrivate::get(m_model)->m_transaction) {
-        qmlInfo(this) << tr("The group of a VisualDataModel cannot be changed within onChanged");
+        qmlInfo(this) << tr("The group of a DelegateModel cannot be changed within onChanged");
         return;
     }
 
@@ -2861,7 +2896,7 @@ void QQmlPartsModel::updateFilterGroup()
 
     QQmlListCompositor::Group previousGroup = m_compositorGroup;
     m_compositorGroup = Compositor::Default;
-    QQmlDataGroupPrivate::get(model->m_groups[Compositor::Default])->emitters.insert(this);
+    QQmlDelegateModelGroupPrivate::get(model->m_groups[Compositor::Default])->emitters.insert(this);
     for (int i = 1; i < model->m_groupCount; ++i) {
         if (m_filterGroup == model->m_cacheMetaType->groupNames.at(i - 1)) {
             m_compositorGroup = Compositor::Group(i);
@@ -2869,7 +2904,7 @@ void QQmlPartsModel::updateFilterGroup()
         }
     }
 
-    QQmlDataGroupPrivate::get(model->m_groups[m_compositorGroup])->emitters.insert(this);
+    QQmlDelegateModelGroupPrivate::get(model->m_groups[m_compositorGroup])->emitters.insert(this);
     if (m_compositorGroup != previousGroup) {
         QVector<QQmlChangeSet::Remove> removes;
         QVector<QQmlChangeSet::Insert> inserts;
@@ -2892,7 +2927,7 @@ void QQmlPartsModel::updateFilterGroup(
         return;
 
     m_compositorGroup = group;
-    QQmlDataGroupPrivate::get(QQmlDelegateModelPrivate::get(m_model)->m_groups[m_compositorGroup])->emitters.insert(this);
+    QQmlDelegateModelGroupPrivate::get(QQmlDelegateModelPrivate::get(m_model)->m_groups[m_compositorGroup])->emitters.insert(this);
 
     if (!changeSet.isEmpty())
         emit modelUpdated(changeSet, false);
@@ -2921,7 +2956,7 @@ QObject *QQmlPartsModel::object(int index, bool asynchronous)
     QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(m_model);
 
     if (!model->m_delegate || index < 0 || index >= model->m_compositor.count(m_compositorGroup)) {
-        qWarning() << "VisualDataModel::item: index out range" << index << model->m_compositor.count(m_compositorGroup);
+        qWarning() << "DelegateModel::item: index out range" << index << model->m_compositor.count(m_compositorGroup);
         return 0;
     }
 
@@ -3026,11 +3061,11 @@ v8::Handle<v8::Value> get_change_moveId(v8::Local<v8::String>, const v8::Accesso
     return info.This()->GetInternalField(2);
 }
 
-class QQmlDataGroupChangeArray : public QV8ObjectResource
+class QQmlDelegateModelGroupChangeArray : public QV8ObjectResource
 {
     V8_RESOURCE_TYPE(ChangeSetArrayType)
 public:
-    QQmlDataGroupChangeArray(QV8Engine *engine)
+    QQmlDelegateModelGroupChangeArray(QV8Engine *engine)
         : QV8ObjectResource(engine)
     {
     }
@@ -3040,7 +3075,7 @@ public:
 
     static v8::Handle<v8::Value> get_change(quint32 index, const v8::AccessorInfo &info)
     {
-        QQmlDataGroupChangeArray *array = v8_resource_cast<QQmlDataGroupChangeArray>(info.This());
+        QQmlDelegateModelGroupChangeArray *array = v8_resource_cast<QQmlDelegateModelGroupChangeArray>(info.This());
         V8ASSERT_TYPE(array, "Not a valid change array");
 
         if (index >= array->count())
@@ -3059,7 +3094,7 @@ public:
 
     static v8::Handle<v8::Value> get_length(v8::Local<v8::String>, const v8::AccessorInfo &info)
     {
-        QQmlDataGroupChangeArray *array = v8_resource_cast<QQmlDataGroupChangeArray>(info.This());
+        QQmlDelegateModelGroupChangeArray *array = v8_resource_cast<QQmlDelegateModelGroupChangeArray>(info.This());
         V8ASSERT_TYPE(array, "Not a valid change array");
 
         return v8::Integer::New(array->count());
@@ -3075,11 +3110,11 @@ public:
     }
 };
 
-class QQmlDataGroupRemoveArray : public QQmlDataGroupChangeArray
+class QQmlDelegateModelGroupRemoveArray : public QQmlDelegateModelGroupChangeArray
 {
 public:
-    QQmlDataGroupRemoveArray(QV8Engine *engine, const QVector<QQmlChangeSet::Remove> &changes)
-        : QQmlDataGroupChangeArray(engine)
+    QQmlDelegateModelGroupRemoveArray(QV8Engine *engine, const QVector<QQmlChangeSet::Remove> &changes)
+        : QQmlDelegateModelGroupChangeArray(engine)
         , changes(changes)
     {
     }
@@ -3091,11 +3126,11 @@ private:
     QVector<QQmlChangeSet::Remove> changes;
 };
 
-class QQmlDataGroupInsertArray : public QQmlDataGroupChangeArray
+class QQmlDelegateModelGroupInsertArray : public QQmlDelegateModelGroupChangeArray
 {
 public:
-    QQmlDataGroupInsertArray(QV8Engine *engine, const QVector<QQmlChangeSet::Insert> &changes)
-        : QQmlDataGroupChangeArray(engine)
+    QQmlDelegateModelGroupInsertArray(QV8Engine *engine, const QVector<QQmlChangeSet::Insert> &changes)
+        : QQmlDelegateModelGroupChangeArray(engine)
         , changes(changes)
     {
     }
@@ -3124,7 +3159,7 @@ QQmlDelegateModelEngineData::QQmlDelegateModelEngineData(QV8Engine *)
     change->InstanceTemplate()->SetAccessor(v8::String::New("moveId"), get_change_moveId);
     change->InstanceTemplate()->SetInternalFieldCount(3);
     constructorChange = qPersistentNew(change->GetFunction());
-    constructorChangeArray = qPersistentNew(QQmlDataGroupChangeArray::constructor());
+    constructorChangeArray = qPersistentNew(QQmlDelegateModelGroupChangeArray::constructor());
 }
 
 QQmlDelegateModelEngineData::~QQmlDelegateModelEngineData()
@@ -3138,7 +3173,7 @@ v8::Local<v8::Object> QQmlDelegateModelEngineData::array(
         QV8Engine *engine, const QVector<QQmlChangeSet::Remove> &changes)
 {
     v8::Local<v8::Object> array = constructorChangeArray->NewInstance();
-    array->SetExternalResource(new QQmlDataGroupRemoveArray(engine, changes));
+    array->SetExternalResource(new QQmlDelegateModelGroupRemoveArray(engine, changes));
     return array;
 }
 
@@ -3146,7 +3181,7 @@ v8::Local<v8::Object> QQmlDelegateModelEngineData::array(
         QV8Engine *engine, const QVector<QQmlChangeSet::Insert> &changes)
 {
     v8::Local<v8::Object> array = constructorChangeArray->NewInstance();
-    array->SetExternalResource(new QQmlDataGroupInsertArray(engine, changes));
+    array->SetExternalResource(new QQmlDelegateModelGroupInsertArray(engine, changes));
     return array;
 }
 
index 0fccf57..5702c59 100644 (file)
@@ -60,7 +60,7 @@ class QQmlChangeSet;
 class QQmlComponent;
 class QQuickPackage;
 class QQmlV8Function;
-class QQmlDataGroup;
+class QQmlDelegateModelGroup;
 class QQmlDelegateModelAttached;
 class QQmlDelegateModelPrivate;
 
@@ -73,9 +73,9 @@ class Q_QML_PRIVATE_EXPORT QQmlDelegateModel : public QQmlInstanceModel, public
     Q_PROPERTY(QVariant model READ model WRITE setModel)
     Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate)
     Q_PROPERTY(QString filterOnGroup READ filterGroup WRITE setFilterGroup NOTIFY filterGroupChanged RESET resetFilterGroup)
-    Q_PROPERTY(QQmlDataGroup *items READ items CONSTANT) //TODO : worth renaming?
-    Q_PROPERTY(QQmlDataGroup *persistedItems READ persistedItems CONSTANT)
-    Q_PROPERTY(QQmlListProperty<QQmlDataGroup> groups READ groups CONSTANT)
+    Q_PROPERTY(QQmlDelegateModelGroup *items READ items CONSTANT) //TODO : worth renaming?
+    Q_PROPERTY(QQmlDelegateModelGroup *persistedItems READ persistedItems CONSTANT)
+    Q_PROPERTY(QQmlListProperty<QQmlDelegateModelGroup> groups READ groups CONSTANT)
     Q_PROPERTY(QObject *parts READ parts CONSTANT)
     Q_PROPERTY(QVariant rootIndex READ rootIndex WRITE setRootIndex NOTIFY rootIndexChanged)
     Q_CLASSINFO("DefaultProperty", "delegate")
@@ -114,9 +114,9 @@ public:
     void setFilterGroup(const QString &group);
     void resetFilterGroup();
 
-    QQmlDataGroup *items();
-    QQmlDataGroup *persistedItems();
-    QQmlListProperty<QQmlDataGroup> groups();
+    QQmlDelegateModelGroup *items();
+    QQmlDelegateModelGroup *persistedItems();
+    QQmlListProperty<QQmlDelegateModelGroup> groups();
     QObject *parts();
 
     bool event(QEvent *);
@@ -145,17 +145,17 @@ private:
     Q_DISABLE_COPY(QQmlDelegateModel)
 };
 
-class QQmlDataGroupPrivate;
-class Q_QML_PRIVATE_EXPORT QQmlDataGroup : public QObject
+class QQmlDelegateModelGroupPrivate;
+class Q_QML_PRIVATE_EXPORT QQmlDelegateModelGroup : public QObject
 {
     Q_OBJECT
     Q_PROPERTY(int count READ count NOTIFY countChanged)
     Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
     Q_PROPERTY(bool includeByDefault READ defaultInclude WRITE setDefaultInclude NOTIFY defaultIncludeChanged)
 public:
-    QQmlDataGroup(QObject *parent = 0);
-    QQmlDataGroup(const QString &name, QQmlDelegateModel *model, int compositorType, QObject *parent = 0);
-    ~QQmlDataGroup();
+    QQmlDelegateModelGroup(QObject *parent = 0);
+    QQmlDelegateModelGroup(const QString &name, QQmlDelegateModel *model, int compositorType, QObject *parent = 0);
+    ~QQmlDelegateModelGroup();
 
     QString name() const;
     void setName(const QString &name);
@@ -183,7 +183,7 @@ Q_SIGNALS:
     void defaultIncludeChanged();
     void changed(const QQmlV8Handle &removed, const QQmlV8Handle &inserted);
 private:
-    Q_DECLARE_PRIVATE(QQmlDataGroup)
+    Q_DECLARE_PRIVATE(QQmlDelegateModelGroup)
 };
 
 class QQmlDelegateModelItem;
@@ -229,6 +229,6 @@ QT_END_NAMESPACE
 
 QML_DECLARE_TYPE(QQmlDelegateModel)
 QML_DECLARE_TYPEINFO(QQmlDelegateModel, QML_HAS_ATTACHED_PROPERTIES)
-QML_DECLARE_TYPE(QQmlDataGroup)
+QML_DECLARE_TYPE(QQmlDelegateModelGroup)
 
 #endif // QQMLDATAMODEL_P_H
index 0ac7285..68242f4 100644 (file)
@@ -183,10 +183,10 @@ public:
 };
 
 
-class QQmlDataGroupEmitter
+class QQmlDelegateModelGroupEmitter
 {
 public:
-    virtual ~QQmlDataGroupEmitter() {}
+    virtual ~QQmlDelegateModelGroupEmitter() {}
     virtual void emitModelUpdated(const QQmlChangeSet &changeSet, bool reset) = 0;
     virtual void createdPackage(int, QQuickPackage *) {}
     virtual void initPackage(int, QQuickPackage *) {}
@@ -195,17 +195,17 @@ public:
     QIntrusiveListNode emitterNode;
 };
 
-typedef QIntrusiveList<QQmlDataGroupEmitter, &QQmlDataGroupEmitter::emitterNode> QQmlDataGroupEmitterList;
+typedef QIntrusiveList<QQmlDelegateModelGroupEmitter, &QQmlDelegateModelGroupEmitter::emitterNode> QQmlDelegateModelGroupEmitterList;
 
-class QQmlDataGroupPrivate : public QObjectPrivate
+class QQmlDelegateModelGroupPrivate : public QObjectPrivate
 {
 public:
-    Q_DECLARE_PUBLIC(QQmlDataGroup)
+    Q_DECLARE_PUBLIC(QQmlDelegateModelGroup)
 
-    QQmlDataGroupPrivate() : group(Compositor::Cache), defaultInclude(false) {}
+    QQmlDelegateModelGroupPrivate() : group(Compositor::Cache), defaultInclude(false) {}
 
-    static QQmlDataGroupPrivate *get(QQmlDataGroup *group) {
-        return static_cast<QQmlDataGroupPrivate *>(QObjectPrivate::get(group)); }
+    static QQmlDelegateModelGroupPrivate *get(QQmlDelegateModelGroup *group) {
+        return static_cast<QQmlDelegateModelGroupPrivate *>(QObjectPrivate::get(group)); }
 
     void setModel(QQmlDelegateModel *model, Compositor::Group group);
     bool isChangedConnected();
@@ -222,7 +222,7 @@ public:
 
     Compositor::Group group;
     QQmlGuard<QQmlDelegateModel> model;
-    QQmlDataGroupEmitterList emitters;
+    QQmlDelegateModelGroupEmitterList emitters;
     QQmlChangeSet changeSet;
     QString name;
     bool defaultInclude;
@@ -230,7 +230,7 @@ public:
 
 class QQmlDelegateModelParts;
 
-class QQmlDelegateModelPrivate : public QObjectPrivate, public QQmlDataGroupEmitter
+class QQmlDelegateModelPrivate : public QObjectPrivate, public QQmlDelegateModelGroupEmitter
 {
     Q_DECLARE_PUBLIC(QQmlDelegateModel)
 public:
@@ -282,9 +282,9 @@ public:
 
     bool insert(Compositor::insert_iterator &before, const v8::Local<v8::Object> &object, int groups);
 
-    static void group_append(QQmlListProperty<QQmlDataGroup> *property, QQmlDataGroup *group);
-    static int group_count(QQmlListProperty<QQmlDataGroup> *property);
-    static QQmlDataGroup *group_at(QQmlListProperty<QQmlDataGroup> *property, int index);
+    static void group_append(QQmlListProperty<QQmlDelegateModelGroup> *property, QQmlDelegateModelGroup *group);
+    static int group_count(QQmlListProperty<QQmlDelegateModelGroup> *property);
+    static QQmlDelegateModelGroup *group_at(QQmlListProperty<QQmlDelegateModelGroup> *property, int index);
 
     void releaseIncubator(QQDMIncubationTask *incubationTask);
     void incubatorStatusChanged(QQDMIncubationTask *incubationTask, QQmlIncubator::Status status);
@@ -296,7 +296,7 @@ public:
     QQmlDelegateModelItemMetaType *m_cacheMetaType;
     QQmlContext *m_context;
     QQmlDelegateModelParts *m_parts;
-    QQmlDataGroupEmitterList m_pendingParts;
+    QQmlDelegateModelGroupEmitterList m_pendingParts;
 
     QList<QQmlDelegateModelItem *> m_cache;
     QList<QQDMIncubationTask *> m_finishedIncubating;
@@ -316,15 +316,15 @@ public:
 
     union {
         struct {
-            QQmlDataGroup *m_cacheItems;
-            QQmlDataGroup *m_items;
-            QQmlDataGroup *m_persistedItems;
+            QQmlDelegateModelGroup *m_cacheItems;
+            QQmlDelegateModelGroup *m_items;
+            QQmlDelegateModelGroup *m_persistedItems;
         };
-        QQmlDataGroup *m_groups[Compositor::MaximumGroupCount];
+        QQmlDelegateModelGroup *m_groups[Compositor::MaximumGroupCount];
     };
 };
 
-class QQmlPartsModel : public QQmlInstanceModel, public QQmlDataGroupEmitter
+class QQmlPartsModel : public QQmlInstanceModel, public QQmlDelegateModelGroupEmitter
 {
     Q_OBJECT
     Q_PROPERTY(QString filterOnGroup READ filterGroup WRITE setFilterGroup NOTIFY filterGroupChanged RESET resetFilterGroup)
diff --git a/src/qml/items/qqmlmodelsmodule.cpp b/src/qml/items/qqmlmodelsmodule.cpp
new file mode 100644 (file)
index 0000000..4f6b0a5
--- /dev/null
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Research In Motion.
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.  For licensing terms and
+** conditions see http://qt.digia.com/licensing.  For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights.  These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmlmodelsmodule_p.h"
+#include <private/qqmllistmodel_p.h>
+#include <private/qqmldelegatemodel_p.h>
+#include <private/qqmlobjectmodel_p.h>
+
+QT_BEGIN_NAMESPACE
+
+void QQmlModelsModule::defineModule()
+{
+    const char uri[] = "QtQml.Models";
+
+    qmlRegisterType<QQmlListElement>(uri, 2, 1, "ListElement");
+    qmlRegisterCustomType<QQmlListModel>(uri, 2, 1, "ListModel", new QQmlListModelParser);
+    qmlRegisterType<QQmlDelegateModel>(uri, 2, 1, "DelegateModel");
+    qmlRegisterType<QQmlDelegateModelGroup>(uri, 2, 1, "DelegateModelGroup");
+    qmlRegisterType<QQmlObjectModel>(uri, 2, 1, "ObjectModel");
+}
+
+QT_END_NAMESPACE
diff --git a/src/qml/items/qqmlmodelsmodule_p.h b/src/qml/items/qqmlmodelsmodule_p.h
new file mode 100644 (file)
index 0000000..6e72dad
--- /dev/null
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Research In Motion.
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.  For licensing terms and
+** conditions see http://qt.digia.com/licensing.  For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights.  These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQMLMODELSMODULE_H
+#define QQMLMODELSMODULE_H
+
+#include <private/qtqmlglobal_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QML_PRIVATE_EXPORT QQmlModelsModule
+{
+public:
+    static void defineModule();
+};
+
+QT_END_NAMESPACE
+
+#endif
index 913fa79..7f7bf92 100644 (file)
@@ -129,26 +129,26 @@ public:
 
 
 /*!
-    \qmltype VisualItemModel
+    \qmltype ObjectModel
     \instantiates QQmlObjectModel
-    \inqmlmodule QtQuick 2
+    \inqmlmodule QtQml.Models 2
     \ingroup qtquick-models
-    \brief Defines items to be used added to a view
+    \brief Defines a set of items to be used as a model
 
-    A VisualItemModel contains the visual items to be used in a view.
-    When a VisualItemModel is used in a view, the view does not require
-    a delegate since the VisualItemModel already contains the visual
+    A ObjectModel contains the visual items to be used in a view.
+    When a ObjectModel is used in a view, the view does not require
+    a delegate since the ObjectModel already contains the visual
     delegate (items).
 
     An item can determine its index within the
-    model via the \l{VisualItemModel::index}{index} attached property.
+    model via the \l{ObjectModel::index}{index} attached property.
 
     The example below places three colored rectangles in a ListView.
     \code
     import QtQuick 2.0
 
     Rectangle {
-        VisualItemModel {
+        ObjectModel {
             id: itemModel
             Rectangle { height: 30; width: 80; color: "red" }
             Rectangle { height: 30; width: 80; color: "green" }
@@ -164,15 +164,33 @@ public:
 
     \image visualitemmodel.png
 
-    \sa {quick/modelviews/visualitemmodel}{VisualItemModel example}
+    \sa {quick/views/objectmodel}{ObjectModel example}
+*/
+/*!
+    \qmltype VisualItemModel
+    \instantiates QQmlObjectModel
+    \inqmlmodule QtQuick 2
+    \brief Defines a set of objects to be used as a model
+
+    The VisualItemModel type encapsulates contains the objects to be used
+    as a model.
+
+    This element is now primarily available as ObjectModel in the QtQml.Models module.
+    VisualItemModel continues to be provided, with the same implementation, in QtQuick for
+    compatibility reasons.
+
+    For full details about the type, see the \l ObjectModel documentation.
+
+    \sa {QtQml.Models2::ObjectModel}
 */
+
 QQmlObjectModel::QQmlObjectModel(QObject *parent)
     : QQmlInstanceModel(*(new QQmlObjectModelPrivate), parent)
 {
 }
 
 /*!
-    \qmlattachedproperty int QtQuick2::VisualItemModel::index
+    \qmlattachedproperty int QtQml.Models2::ObjectModel::index
     This attached property holds the index of this delegate's item within the model.
 
     It is attached to each instance of the delegate.
@@ -190,7 +208,7 @@ QQmlListProperty<QObject> QQmlObjectModel::children()
 }
 
 /*!
-    \qmlproperty int QtQuick2::VisualItemModel::count
+    \qmlproperty int QtQml.Models2::ObjectModel::count
 
     The number of items in the model.  This property is readonly.
 */
index ddc6f0e..5bb9ac7 100644 (file)
@@ -55,7 +55,6 @@
 #include "qqmlxmlhttprequest_p.h"
 #include "qqmlscriptstring.h"
 #include "qqmlglobal_p.h"
-#include "qqmllistmodel_p.h"
 #include "qquickworkerscript_p.h"
 #include "qqmlcomponent_p.h"
 #include "qqmlnetworkaccessmanagerfactory.h"
 
 #include <private/qqmllocale_p.h>
 
-#include "qqmlbind_p.h"
-#include "qqmlconnections_p.h"
-#include "qqmltimer_p.h"
-#include "qqmlplatform_p.h"
+#include <private/qqmlbind_p.h>
+#include <private/qqmlconnections_p.h>
+#include <private/qqmltimer_p.h>
+#include <private/qqmllistmodel_p.h>
+#include <private/qqmlplatform_p.h>
 #include <private/qquickpackage_p.h>
 #include <private/qqmldelegatemodel_p.h>
 #include <private/qqmlobjectmodel_p.h>
@@ -184,20 +184,20 @@ void QQmlEnginePrivate::registerBaseTypes(const char *uri, int versionMajor, int
     qmlRegisterType<QQmlConnections>(uri, versionMajor, versionMinor,"Connections");
     qmlRegisterType<QQmlTimer>(uri, versionMajor, versionMinor,"Timer");
     qmlRegisterCustomType<QQmlConnections>(uri, versionMajor, versionMinor,"Connections", new QQmlConnectionsParser);
-    qmlRegisterType<QQmlListElement>(uri, versionMajor, versionMinor, "ListElement");
-    qmlRegisterCustomType<QQmlListModel>(uri, versionMajor, versionMinor, "ListModel", new QQmlListModelParser);
+    qmlRegisterType<QQmlInstanceModel>();
 }
 
 
 // These QtQuick types' implementation resides in the QtQml module
 void QQmlEnginePrivate::registerQtQuick2Types(const char *uri, int versionMajor, int versionMinor)
 {
+    qmlRegisterType<QQmlListElement>(uri, versionMajor, versionMinor, "ListElement"); // Now in QtQml.Models, here for compatibility
+    qmlRegisterCustomType<QQmlListModel>(uri, versionMajor, versionMinor, "ListModel", new QQmlListModelParser); // Now in QtQml.Models, here for compatibility
     qmlRegisterType<QQuickWorkerScript>(uri, versionMajor, versionMinor, "WorkerScript");
     qmlRegisterType<QQuickPackage>(uri, versionMajor, versionMinor, "Package");
     qmlRegisterType<QQmlDelegateModel>(uri, versionMajor, versionMinor, "VisualDataModel");
-    qmlRegisterType<QQmlDataGroup>(uri, versionMajor, versionMinor, "VisualDataGroup");
+    qmlRegisterType<QQmlDelegateModelGroup>(uri, versionMajor, versionMinor, "VisualDataGroup");
     qmlRegisterType<QQmlObjectModel>(uri, versionMajor, versionMinor, "VisualItemModel");
-    qmlRegisterType<QQmlInstanceModel>();
 }
 
 void QQmlEnginePrivate::defineQtQuick2Module()
index 5d64d37..254eb58 100644 (file)
@@ -1425,6 +1425,17 @@ QQmlListModelParser::ListInstruction *QQmlListModelParser::ListModelData::instru
 /*!
     \qmltype ListModel
     \instantiates QQmlListModel
+    \inqmlmodule QtQml.Models 2
+    \brief Defines a free-form list data source
+
+    The ListModel is a simple container of ListElement definitions, each containing data roles.
+    The contents can be defined dynamically, or explicitly in QML.
+
+    This type is also available in the QtQuick 2 import. For full documentation, see \l QtQuick2::ListModel
+*/
+/*!
+    \qmltype ListModel
+    \instantiates QQmlListModel
     \inqmlmodule QtQuick 2
     \brief Defines a free-form list data source
     \ingroup qtquick-models
@@ -2524,6 +2535,16 @@ bool QQmlListModelParser::definesEmptyList(const QString &s)
 /*!
     \qmltype ListElement
     \instantiates QQmlListElement
+    \inqmlmodule QtQml.Models 2
+    \brief Defines a data item in a ListModel
+
+    List elements are defined inside ListModel definitions, and represent items in a list.
+
+    This type is also available in the QtQuick 2 import. For full documentation, see \l QtQuick2::ListElement
+*/
+/*!
+    \qmltype ListElement
+    \instantiates QQmlListElement
     \inqmlmodule QtQuick 2
     \brief Defines a data item in a ListModel
     \ingroup qtquick-models
index da705ce..e278d29 100644 (file)
@@ -24,6 +24,7 @@ PUBLICTESTS += \
     qqmltranslation \
     qqmlxmlhttprequest \
     qqmlparser \
+    qtqmlmodules \
     qquickfolderlistmodel
 
 PRIVATETESTS += \
diff --git a/tests/auto/qml/qtqmlmodules/data/base.qml b/tests/auto/qml/qtqmlmodules/data/base.qml
new file mode 100644 (file)
index 0000000..942b270
--- /dev/null
@@ -0,0 +1,14 @@
+import QtQml 2.0
+
+QtObject {
+    property bool success: {
+        prop1 != undefined &&
+        prop2 != undefined &&
+        prop3 != undefined &&
+        prop4 != undefined
+    }
+    property Component prop1: Component { QtObject {}}
+    property Timer prop2: Timer {}
+    property Connections prop3: Connections{}
+    property Binding prop4: Binding{}
+}
diff --git a/tests/auto/qml/qtqmlmodules/data/models.qml b/tests/auto/qml/qtqmlmodules/data/models.qml
new file mode 100644 (file)
index 0000000..d253565
--- /dev/null
@@ -0,0 +1,15 @@
+import QtQml 2.0
+import QtQml.Models 2.1
+
+QtObject {
+    property bool success: {
+        prop1 != undefined &&
+        prop2 != undefined &&
+        prop3 != undefined &&
+        prop4 != undefined
+    }
+    property DelegateModelGroup prop1: DelegateModelGroup{}
+    property DelegateModel prop2: DelegateModel{}
+    property ObjectModel prop3: ObjectModel{}
+    property ListModel prop4: ListModel{ListElement{dummy: true}}
+}
diff --git a/tests/auto/qml/qtqmlmodules/data/unavailable.qml b/tests/auto/qml/qtqmlmodules/data/unavailable.qml
new file mode 100644 (file)
index 0000000..5841e3f
--- /dev/null
@@ -0,0 +1,35 @@
+import QtQml 2.0
+
+QtObject {
+    id: root
+    property bool success: false;
+    Component.onCompleted: {
+        var strings = [
+            "QtObject{}",
+            "Binding{}",
+            "Connections{}",
+            "Timer{}",
+            "Component{QtObject{}}",
+            "ListModel{ListElement{}}",
+            "ObjectModel{QtObject{}}",
+            "import QtQml 2.0 Item{}",
+            "import QtQml 2.0 ListModel{}",
+            "import QtQml 2.0 ObjectModel{}"
+        ];
+        var idx;
+        for (idx in strings) {
+            var errored = false;
+            var item;
+            try {
+                item = Qt.createQmlObject(strings[idx], root);
+            } catch (err) {
+                errored = true;
+            }
+            if (!errored) {
+                console.log("It worked? ", item);
+                return;
+            }
+        }
+        root.success = true;
+    }
+}
diff --git a/tests/auto/qml/qtqmlmodules/qtqmlmodules.pro b/tests/auto/qml/qtqmlmodules/qtqmlmodules.pro
new file mode 100644 (file)
index 0000000..36ece8d
--- /dev/null
@@ -0,0 +1,12 @@
+CONFIG += testcase
+TARGET = tst_qtqmlmodules
+SOURCES += tst_qtqmlmodules.cpp
+
+include (../../shared/util.pri)
+
+macx:CONFIG -= app_bundle
+
+TESTDATA = data/*
+
+QT += core-private v8-private qml-private testlib gui gui-private
+DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/qml/qtqmlmodules/tst_qtqmlmodules.cpp b/tests/auto/qml/qtqmlmodules/tst_qtqmlmodules.cpp
new file mode 100644 (file)
index 0000000..1e98c53
--- /dev/null
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Research in Motion.
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.  For licensing terms and
+** conditions see http://qt.digia.com/licensing.  For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights.  These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qtest.h>
+#include <QDebug>
+#include <QQmlEngine>
+#include <QQmlComponent>
+#include "../../shared/util.h"
+
+class tst_qtqmlmodules : public QQmlDataTest
+{
+    Q_OBJECT
+public:
+    tst_qtqmlmodules() {}
+
+private slots:
+    void baseTypes();
+    void modelsTypes();
+    void unavailableTypes();
+};
+
+void tst_qtqmlmodules::baseTypes()
+{
+    QQmlEngine engine;
+    QQmlComponent component(&engine, testFileUrl("base.qml"));
+    QObject *object = component.create();
+    QVERIFY(object != 0);
+    QVERIFY(object->property("success").toBool());
+
+    delete object;
+}
+
+void tst_qtqmlmodules::modelsTypes()
+{
+    QQmlEngine engine;
+    QQmlComponent component(&engine, testFileUrl("models.qml"));
+    QObject *object = component.create();
+    QVERIFY(object != 0);
+    QVERIFY(object->property("success").toBool());
+
+    delete object;
+}
+
+void tst_qtqmlmodules::unavailableTypes()
+{
+    QQmlEngine engine;
+    QQmlComponent component(&engine, testFileUrl("unavailable.qml"));
+    QObject *object = component.create();
+    QVERIFY(object != 0);
+    QVERIFY(object->property("success").toBool());
+
+    delete object;
+}
+
+QTEST_MAIN(tst_qtqmlmodules)
+
+#include "tst_qtqmlmodules.moc"
index f97b0f3..d16bf81 100644 (file)
@@ -453,8 +453,8 @@ private:
     template <int N> void get_verify(
             const SingleRoleModel &model,
             QQmlDelegateModel *visualModel,
-            QQmlDataGroup *visibleItems,
-            QQmlDataGroup *selectedItems,
+            QQmlDelegateModelGroup *visibleItems,
+            QQmlDelegateModelGroup *selectedItems,
             const int (&mIndex)[N],
             const int (&iIndex)[N],
             const int (&vIndex)[N],
@@ -1713,10 +1713,10 @@ void tst_qquickvisualdatamodel::groups()
     QQmlDelegateModel *visualModel = listview->findChild<QQmlDelegateModel *>("visualModel");
     QVERIFY(visualModel);
 
-    QQmlDataGroup *visibleItems = listview->findChild<QQmlDataGroup *>("visibleItems");
+    QQmlDelegateModelGroup *visibleItems = listview->findChild<QQmlDelegateModelGroup *>("visibleItems");
     QVERIFY(visibleItems);
 
-    QQmlDataGroup *selectedItems = listview->findChild<QQmlDataGroup *>("selectedItems");
+    QQmlDelegateModelGroup *selectedItems = listview->findChild<QQmlDelegateModelGroup *>("selectedItems");
     QVERIFY(selectedItems);
 
     const bool f = false;
@@ -1940,8 +1940,8 @@ void tst_qquickvisualdatamodel::groups()
 template <int N> void tst_qquickvisualdatamodel::get_verify(
         const SingleRoleModel &model,
         QQmlDelegateModel *visualModel,
-        QQmlDataGroup *visibleItems,
-        QQmlDataGroup *selectedItems,
+        QQmlDelegateModelGroup *visibleItems,
+        QQmlDelegateModelGroup *selectedItems,
         const int (&mIndex)[N],
         const int (&iIndex)[N],
         const int (&vIndex)[N],
@@ -2033,10 +2033,10 @@ void tst_qquickvisualdatamodel::get()
     QQmlDelegateModel *visualModel = qobject_cast<QQmlDelegateModel *>(qvariant_cast<QObject *>(listview->model()));
     QVERIFY(visualModel);
 
-    QQmlDataGroup *visibleItems = visualModel->findChild<QQmlDataGroup *>("visibleItems");
+    QQmlDelegateModelGroup *visibleItems = visualModel->findChild<QQmlDelegateModelGroup *>("visibleItems");
     QVERIFY(visibleItems);
 
-    QQmlDataGroup *selectedItems = visualModel->findChild<QQmlDataGroup *>("selectedItems");
+    QQmlDelegateModelGroup *selectedItems = visualModel->findChild<QQmlDelegateModelGroup *>("selectedItems");
     QVERIFY(selectedItems);
 
     QV8Engine *v8Engine = QQmlEnginePrivate::getV8Engine(ctxt->engine());
@@ -2154,7 +2154,7 @@ void tst_qquickvisualdatamodel::get()
 void tst_qquickvisualdatamodel::invalidGroups()
 {
     QUrl source = testFileUrl("groups-invalid.qml");
-    QTest::ignoreMessage(QtWarningMsg, (source.toString() + ":12:9: QML VisualDataGroup: " + QQmlDataGroup::tr("Group names must start with a lower case letter")).toUtf8());
+    QTest::ignoreMessage(QtWarningMsg, (source.toString() + ":12:9: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("Group names must start with a lower case letter")).toUtf8());
 
     QQmlComponent component(&engine, source);
     QScopedPointer<QObject> object(component.create());
@@ -3665,67 +3665,67 @@ void tst_qquickvisualdatamodel::warnings_data()
     QTest::newRow("insert < 0")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.insert(-2, {\"number\": \"eight\"})")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("insert: index out of range"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("insert: index out of range"))
             << 4;
 
     QTest::newRow("insert > length")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.insert(8, {\"number\": \"eight\"})")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("insert: index out of range"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("insert: index out of range"))
             << 4;
 
     QTest::newRow("create < 0")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.create(-2, {\"number\": \"eight\"})")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("create: index out of range"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("create: index out of range"))
             << 4;
 
     QTest::newRow("create > length")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.create(8, {\"number\": \"eight\"})")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("create: index out of range"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("create: index out of range"))
             << 4;
 
     QTest::newRow("resolve from < 0")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.resolve(-2, 3)")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("resolve: from index out of range"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("resolve: from index out of range"))
             << 4;
 
     QTest::newRow("resolve from > length")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.resolve(8, 3)")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("resolve: from index out of range"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("resolve: from index out of range"))
             << 4;
 
     QTest::newRow("resolve to < 0")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.resolve(3, -2)")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("resolve: to index out of range"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("resolve: to index out of range"))
             << 4;
 
     QTest::newRow("resolve to > length")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.resolve(3, 8)")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("resolve: to index out of range"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("resolve: to index out of range"))
             << 4;
 
     QTest::newRow("resolve from invalid index")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.resolve(\"two\", 3)")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("resolve: from index invalid"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("resolve: from index invalid"))
             << 4;
 
     QTest::newRow("resolve to invalid index")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.resolve(3, \"two\")")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("resolve: to index invalid"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("resolve: to index invalid"))
             << 4;
 
     QTest::newRow("resolve already resolved item")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.resolve(3, 2)")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("resolve: from is not an unresolved item"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("resolve: from is not an unresolved item"))
             << 4;
 
     QTest::newRow("resolve already resolved item")
@@ -3733,193 +3733,193 @@ void tst_qquickvisualdatamodel::warnings_data()
             << QString("{ items.insert(0, {\"number\": \"eight\"});"
                        "items.insert(1, {\"number\": \"seven\"});"
                        "items.resolve(0, 1)}")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("resolve: to is not a model item"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("resolve: to is not a model item"))
             << 6;
 
     QTest::newRow("remove index < 0")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.remove(-2, 1)")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("remove: index out of range"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("remove: index out of range"))
             << 4;
 
     QTest::newRow("remove index == length")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.remove(4, 1)")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("remove: index out of range"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("remove: index out of range"))
             << 4;
 
     QTest::newRow("remove index > length")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.remove(9, 1)")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("remove: index out of range"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("remove: index out of range"))
             << 4;
 
     QTest::newRow("remove invalid index")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.remove(\"nine\", 1)")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("remove: invalid index"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("remove: invalid index"))
             << 4;
 
     QTest::newRow("remove count < 0")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.remove(1, -2)")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("remove: invalid count"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("remove: invalid count"))
             << 4;
 
     QTest::newRow("remove index + count > length")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.remove(2, 4, \"selected\")")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("remove: invalid count"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("remove: invalid count"))
             << 4;
 
     QTest::newRow("addGroups index < 0")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.addGroups(-2, 1, \"selected\")")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("addGroups: index out of range"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("addGroups: index out of range"))
             << 4;
 
     QTest::newRow("addGroups index == length")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.addGroups(4, 1, \"selected\")")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("addGroups: index out of range"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("addGroups: index out of range"))
             << 4;
 
     QTest::newRow("addGroups index > length")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.addGroups(9, 1, \"selected\")")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("addGroups: index out of range"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("addGroups: index out of range"))
             << 4;
 
     QTest::newRow("addGroups count < 0")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.addGroups(1, -2, \"selected\")")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("addGroups: invalid count"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("addGroups: invalid count"))
             << 4;
 
     QTest::newRow("addGroups index + count > length")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.addGroups(2, 4, \"selected\")")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("addGroups: invalid count"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("addGroups: invalid count"))
             << 4;
 
     QTest::newRow("removeGroups index < 0")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.removeGroups(-2, 1, \"selected\")")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("removeGroups: index out of range"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("removeGroups: index out of range"))
             << 4;
 
     QTest::newRow("removeGroups index == length")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.removeGroups(4, 1, \"selected\")")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("removeGroups: index out of range"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("removeGroups: index out of range"))
             << 4;
 
     QTest::newRow("removeGroups index > length")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.removeGroups(9, 1, \"selected\")")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("removeGroups: index out of range"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("removeGroups: index out of range"))
             << 4;
 
     QTest::newRow("removeGroups count < 0")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.removeGroups(1, -2, \"selected\")")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("removeGroups: invalid count"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("removeGroups: invalid count"))
             << 4;
 
     QTest::newRow("removeGroups index + count > length")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.removeGroups(2, 4, \"selected\")")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("removeGroups: invalid count"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("removeGroups: invalid count"))
             << 4;
 
     QTest::newRow("setGroups index < 0")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.setGroups(-2, 1, \"selected\")")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("setGroups: index out of range"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("setGroups: index out of range"))
             << 4;
 
     QTest::newRow("setGroups index == length")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.setGroups(4, 1, \"selected\")")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("setGroups: index out of range"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("setGroups: index out of range"))
             << 4;
 
     QTest::newRow("setGroups index > length")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.setGroups(9, 1, \"selected\")")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("setGroups: index out of range"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("setGroups: index out of range"))
             << 4;
 
     QTest::newRow("setGroups count < 0")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.setGroups(1, -2, \"selected\")")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("setGroups: invalid count"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("setGroups: invalid count"))
             << 4;
 
     QTest::newRow("setGroups index + count > length")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.setGroups(2, 4, \"selected\")")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("setGroups: invalid count"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("setGroups: invalid count"))
             << 4;
 
     QTest::newRow("move from < 0")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.move(-2, 1, 1)")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("move: from index out of range"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("move: from index out of range"))
             << 4;
 
     QTest::newRow("move from == length")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.move(4, 1, 1)")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("move: from index out of range"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("move: from index out of range"))
             << 4;
 
     QTest::newRow("move from > length")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.move(9, 1, 1)")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("move: from index out of range"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("move: from index out of range"))
             << 4;
 
     QTest::newRow("move invalid from")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.move(\"nine\", 1, 1)")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("move: invalid from index"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("move: invalid from index"))
             << 4;
 
     QTest::newRow("move to < 0")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.move(1, -2, 1)")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("move: to index out of range"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("move: to index out of range"))
             << 4;
 
     QTest::newRow("move to == length")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.move(1, 4, 1)")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("move: to index out of range"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("move: to index out of range"))
             << 4;
 
     QTest::newRow("move to > length")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.move(1, 9, 1)")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("move: to index out of range"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("move: to index out of range"))
             << 4;
 
     QTest::newRow("move invalid to")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.move(1, \"nine\", 1)")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("move: invalid to index"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("move: invalid to index"))
             << 4;
 
     QTest::newRow("move count < 0")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.move(1, 1, -2)")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("move: invalid count"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("move: invalid count"))
             << 4;
 
     QTest::newRow("move from + count > length")
             << testFileUrl("listmodelproperties.qml")
             << QString("items.move(2, 1, 4)")
-            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("move: from index out of range"))
+            << ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("move: from index out of range"))
             << 4;
 }