Replace obsolete VisualDataModel, *Group and VisualItemModel in tests
VisualDataModel, VisualDataGroup, and VisualItemModel
are replaced with DelegateModel, DelegateModelGroup, and ObjectModel
respectively (since 7cad0e52c5
).
git grep -l 'VisualDataModel' | xargs sed -i 's/VisualDataModel/DelegateModel/g'
git grep -l 'VisualDataGroup' | xargs sed -i 's/VisualDataGroup/DelegateModelGroup/g'
git grep -l 'VisualItemModel' | xargs sed -i 's/VisualItemModel/ObjectModel/g'
Change-Id: Ie91b37b204f08a5d1f1f38594fb22ed70a6e2080
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This commit is contained in:
parent
2dda8dcb2f
commit
b22cb209e7
|
@ -2,29 +2,30 @@
|
||||||
// changes in right-to-left layout direction
|
// changes in right-to-left layout direction
|
||||||
|
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
color: "lightgray"
|
color: "lightgray"
|
||||||
width: 340
|
width: 340
|
||||||
height: 370
|
height: 370
|
||||||
|
|
||||||
VisualItemModel {
|
ObjectModel {
|
||||||
id: itemModel
|
id: itemModel
|
||||||
objectName: "itemModel"
|
objectName: "itemModel"
|
||||||
Rectangle {
|
Rectangle {
|
||||||
objectName: "item1"
|
objectName: "item1"
|
||||||
height: 110; width: 120; color: "#FFFEF0"
|
height: 110; width: 120; color: "#FFFEF0"
|
||||||
Text { objectName: "text1"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
|
Text { objectName: "text1"; text: "index: " + parent.ObjectModel.index; font.bold: true; anchors.centerIn: parent }
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
objectName: "item2"
|
objectName: "item2"
|
||||||
height: 130; width: 150; color: "#F0FFF7"
|
height: 130; width: 150; color: "#F0FFF7"
|
||||||
Text { objectName: "text2"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
|
Text { objectName: "text2"; text: "index: " + parent.ObjectModel.index; font.bold: true; anchors.centerIn: parent }
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
objectName: "item3"
|
objectName: "item3"
|
||||||
height: 170; width: 190; color: "#F4F0FF"
|
height: 170; width: 190; color: "#F4F0FF"
|
||||||
Text { objectName: "text3"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
|
Text { objectName: "text3"; text: "index: " + parent.ObjectModel.index; font.bold: true; anchors.centerIn: parent }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
width: 240
|
width: 240
|
||||||
|
@ -38,7 +39,7 @@ Item {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VisualDataModel {
|
DelegateModel {
|
||||||
id: visualModel
|
id: visualModel
|
||||||
|
|
||||||
delegate: myDelegate
|
delegate: myDelegate
|
||||||
|
|
|
@ -1,33 +1,34 @@
|
||||||
// This example demonstrates placing items in a view using
|
// This example demonstrates placing items in a view using
|
||||||
// a VisualItemModel
|
// an ObjectModel
|
||||||
|
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
color: "lightgray"
|
color: "lightgray"
|
||||||
width: 240
|
width: 240
|
||||||
height: 320
|
height: 320
|
||||||
|
|
||||||
VisualItemModel {
|
ObjectModel {
|
||||||
id: itemModel
|
id: itemModel
|
||||||
objectName: "itemModel"
|
objectName: "itemModel"
|
||||||
Rectangle {
|
Rectangle {
|
||||||
objectName: "item1"
|
objectName: "item1"
|
||||||
height: view.height / 3
|
height: view.height / 3
|
||||||
width: view.width; color: "#FFFEF0"
|
width: view.width; color: "#FFFEF0"
|
||||||
Text { objectName: "text1"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
|
Text { objectName: "text1"; text: "index: " + parent.ObjectModel.index; font.bold: true; anchors.centerIn: parent }
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
objectName: "item2"
|
objectName: "item2"
|
||||||
height: view.height / 3
|
height: view.height / 3
|
||||||
width: view.width; color: "#F0FFF7"
|
width: view.width; color: "#F0FFF7"
|
||||||
Text { objectName: "text2"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
|
Text { objectName: "text2"; text: "index: " + parent.ObjectModel.index; font.bold: true; anchors.centerIn: parent }
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
objectName: "item3"
|
objectName: "item3"
|
||||||
height: view.height / 3
|
height: view.height / 3
|
||||||
width: view.width; color: "#F4F0FF"
|
width: view.width; color: "#F4F0FF"
|
||||||
Text { objectName: "text3"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
|
Text { objectName: "text3"; text: "index: " + parent.ObjectModel.index; font.bold: true; anchors.centerIn: parent }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,33 +1,34 @@
|
||||||
// This example demonstrates placing items in a view using
|
// This example demonstrates placing items in a view using
|
||||||
// a VisualItemModel
|
// an ObjectModel
|
||||||
|
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
color: "lightgray"
|
color: "lightgray"
|
||||||
width: 240
|
width: 240
|
||||||
height: 320
|
height: 320
|
||||||
|
|
||||||
VisualItemModel {
|
ObjectModel {
|
||||||
id: itemModel
|
id: itemModel
|
||||||
objectName: "itemModel"
|
objectName: "itemModel"
|
||||||
Rectangle {
|
Rectangle {
|
||||||
objectName: "item1"
|
objectName: "item1"
|
||||||
height: ListView.view ? ListView.view.height : 0
|
height: ListView.view ? ListView.view.height : 0
|
||||||
width: view.width; color: "#FFFEF0"
|
width: view.width; color: "#FFFEF0"
|
||||||
Text { objectName: "text1"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
|
Text { objectName: "text1"; text: "index: " + parent.ObjectModel.index; font.bold: true; anchors.centerIn: parent }
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
objectName: "item2"
|
objectName: "item2"
|
||||||
height: ListView.view ? ListView.view.height : 0
|
height: ListView.view ? ListView.view.height : 0
|
||||||
width: view.width; color: "#F0FFF7"
|
width: view.width; color: "#F0FFF7"
|
||||||
Text { objectName: "text2"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
|
Text { objectName: "text2"; text: "index: " + parent.ObjectModel.index; font.bold: true; anchors.centerIn: parent }
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
objectName: "item3"
|
objectName: "item3"
|
||||||
height: ListView.view ? ListView.view.height : 0
|
height: ListView.view ? ListView.view.height : 0
|
||||||
width: view.width; color: "#F4F0FF"
|
width: view.width; color: "#F4F0FF"
|
||||||
Text { objectName: "text3"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
|
Text { objectName: "text3"; text: "index: " + parent.ObjectModel.index; font.bold: true; anchors.centerIn: parent }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
width: 240
|
width: 240
|
||||||
|
@ -54,7 +55,7 @@ Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
VisualDataModel {
|
DelegateModel {
|
||||||
id: visualModel
|
id: visualModel
|
||||||
model: testModel
|
model: testModel
|
||||||
delegate: myDelegate
|
delegate: myDelegate
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: root
|
id: root
|
||||||
|
@ -120,7 +121,7 @@ Rectangle {
|
||||||
id: headerFooter
|
id: headerFooter
|
||||||
Rectangle { height: 30; width: 240; color: "blue" }
|
Rectangle { height: 30; width: 240; color: "blue" }
|
||||||
},
|
},
|
||||||
VisualDataModel {
|
DelegateModel {
|
||||||
id: visualModel
|
id: visualModel
|
||||||
|
|
||||||
model: testModel
|
model: testModel
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
id: root
|
id: root
|
||||||
|
@ -9,7 +10,7 @@ ListView {
|
||||||
layoutDirection: (testRightToLeft == true) ? Qt.RightToLeft : Qt.LeftToRight
|
layoutDirection: (testRightToLeft == true) ? Qt.RightToLeft : Qt.LeftToRight
|
||||||
verticalLayoutDirection: (testBottomToTop == true) ? ListView.BottomToTop : ListView.TopToBottom
|
verticalLayoutDirection: (testBottomToTop == true) ? ListView.BottomToTop : ListView.TopToBottom
|
||||||
|
|
||||||
model: VisualItemModel {
|
model: ObjectModel {
|
||||||
Rectangle {
|
Rectangle {
|
||||||
objectName: "red"
|
objectName: "red"
|
||||||
width: 200; height: 200; color: "red"
|
width: 200; height: 200; color: "red"
|
||||||
|
|
|
@ -2,29 +2,30 @@
|
||||||
// changes in right-to-left layout direction
|
// changes in right-to-left layout direction
|
||||||
|
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
color: "lightgray"
|
color: "lightgray"
|
||||||
width: 640
|
width: 640
|
||||||
height: 320
|
height: 320
|
||||||
|
|
||||||
VisualItemModel {
|
ObjectModel {
|
||||||
id: itemModel
|
id: itemModel
|
||||||
objectName: "itemModel"
|
objectName: "itemModel"
|
||||||
Rectangle {
|
Rectangle {
|
||||||
objectName: "item1"
|
objectName: "item1"
|
||||||
height: view.height; width: 100; color: "#FFFEF0"
|
height: view.height; width: 100; color: "#FFFEF0"
|
||||||
Text { objectName: "text1"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
|
Text { objectName: "text1"; text: "index: " + parent.ObjectModel.index; font.bold: true; anchors.centerIn: parent }
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
objectName: "item2"
|
objectName: "item2"
|
||||||
height: view.height; width: 200; color: "#F0FFF7"
|
height: view.height; width: 200; color: "#F0FFF7"
|
||||||
Text { objectName: "text2"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
|
Text { objectName: "text2"; text: "index: " + parent.ObjectModel.index; font.bold: true; anchors.centerIn: parent }
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
objectName: "item3"
|
objectName: "item3"
|
||||||
height: view.height; width: 240; color: "#F4F0FF"
|
height: view.height; width: 240; color: "#F4F0FF"
|
||||||
Text { objectName: "text3"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
|
Text { objectName: "text3"; text: "index: " + parent.ObjectModel.index; font.bold: true; anchors.centerIn: parent }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
width: 240
|
width: 240
|
||||||
|
@ -34,7 +35,7 @@ Item {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VisualDataModel {
|
DelegateModel {
|
||||||
id: visualModel
|
id: visualModel
|
||||||
|
|
||||||
delegate: myDelegate
|
delegate: myDelegate
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
** Copyright (C) 2018 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of the test suite of the Qt Toolkit.
|
** This file is part of the test suite of the Qt Toolkit.
|
||||||
|
@ -465,7 +465,7 @@ void tst_QQuickListView::items(const QUrl &source)
|
||||||
T model2;
|
T model2;
|
||||||
ctxt->setContextProperty("testModel", &model2);
|
ctxt->setContextProperty("testModel", &model2);
|
||||||
|
|
||||||
// Force a layout, necessary if ListView is completed before VisualDataModel.
|
// Force a layout, necessary if ListView is completed before DelegateModel.
|
||||||
listview->forceLayout();
|
listview->forceLayout();
|
||||||
|
|
||||||
int itemCount = findItems<QQuickItem>(contentItem, "wrapper").count();
|
int itemCount = findItems<QQuickItem>(contentItem, "wrapper").count();
|
||||||
|
@ -504,7 +504,7 @@ void tst_QQuickListView::changed(const QUrl &source)
|
||||||
QQuickItem *contentItem = listview->contentItem();
|
QQuickItem *contentItem = listview->contentItem();
|
||||||
QTRY_VERIFY(contentItem != nullptr);
|
QTRY_VERIFY(contentItem != nullptr);
|
||||||
|
|
||||||
// Force a layout, necessary if ListView is completed before VisualDataModel.
|
// Force a layout, necessary if ListView is completed before DelegateModel.
|
||||||
listview->forceLayout();
|
listview->forceLayout();
|
||||||
|
|
||||||
model.modifyItem(1, "Will", "9876");
|
model.modifyItem(1, "Will", "9876");
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
@ -6,7 +7,7 @@ Item {
|
||||||
property bool enforceRange: false
|
property bool enforceRange: false
|
||||||
width: 320; height: 480
|
width: 320; height: 480
|
||||||
|
|
||||||
VisualItemModel {
|
ObjectModel {
|
||||||
id: itemModel
|
id: itemModel
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
width: 800; height: 600
|
width: 800; height: 600
|
||||||
|
@ -37,7 +38,7 @@ Item {
|
||||||
ListElement { lColor: "brown" }
|
ListElement { lColor: "brown" }
|
||||||
ListElement { lColor: "thistle" }
|
ListElement { lColor: "thistle" }
|
||||||
}
|
}
|
||||||
VisualDataModel { id: visualModel; model: rssModel; delegate: photoDelegate }
|
DelegateModel { id: visualModel; model: rssModel; delegate: photoDelegate }
|
||||||
|
|
||||||
PathView {
|
PathView {
|
||||||
id: photoPathView
|
id: photoPathView
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
|
|
||||||
PathView {
|
PathView {
|
||||||
width: 320
|
width: 320
|
||||||
|
@ -6,7 +7,7 @@ PathView {
|
||||||
function setRoot(index) {
|
function setRoot(index) {
|
||||||
vdm.rootIndex = vdm.modelIndex(index);
|
vdm.rootIndex = vdm.modelIndex(index);
|
||||||
}
|
}
|
||||||
model: VisualDataModel {
|
model: DelegateModel {
|
||||||
id: vdm
|
id: vdm
|
||||||
model: myModel
|
model: myModel
|
||||||
delegate: Text { objectName: "wrapper"; text: display }
|
delegate: Text { objectName: "wrapper"; text: display }
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
|
|
||||||
PathView {
|
PathView {
|
||||||
id: pathView
|
id: pathView
|
||||||
|
@ -20,7 +21,7 @@ PathView {
|
||||||
ListElement { value: "three" }
|
ListElement { value: "three" }
|
||||||
}
|
}
|
||||||
|
|
||||||
model: VisualDataModel {
|
model: DelegateModel {
|
||||||
delegate: Text { text: model.value }
|
delegate: Text { text: model.value }
|
||||||
model : mo
|
model : mo
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
// This example demonstrates placing items in a view using
|
// This example demonstrates placing items in a view using
|
||||||
// a VisualItemModel
|
// an ObjectModel
|
||||||
|
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: root
|
id: root
|
||||||
|
@ -22,38 +23,38 @@ Rectangle {
|
||||||
root.itemModel = itemModel2
|
root.itemModel = itemModel2
|
||||||
}
|
}
|
||||||
|
|
||||||
VisualItemModel {
|
ObjectModel {
|
||||||
id: itemModel1
|
id: itemModel1
|
||||||
objectName: "itemModel1"
|
objectName: "itemModel1"
|
||||||
Rectangle {
|
Rectangle {
|
||||||
objectName: "item1"
|
objectName: "item1"
|
||||||
height: 50; width: 100; color: "#FFFEF0"
|
height: 50; width: 100; color: "#FFFEF0"
|
||||||
Text { objectName: "text1"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
|
Text { objectName: "text1"; text: "index: " + parent.ObjectModel.index; font.bold: true; anchors.centerIn: parent }
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
objectName: "item2"
|
objectName: "item2"
|
||||||
height: 50; width: 100; color: "#F0FFF7"
|
height: 50; width: 100; color: "#F0FFF7"
|
||||||
Text { objectName: "text2"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
|
Text { objectName: "text2"; text: "index: " + parent.ObjectModel.index; font.bold: true; anchors.centerIn: parent }
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
objectName: "item3"
|
objectName: "item3"
|
||||||
height: 50; width: 100; color: "#F4F0FF"
|
height: 50; width: 100; color: "#F4F0FF"
|
||||||
Text { objectName: "text3"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
|
Text { objectName: "text3"; text: "index: " + parent.ObjectModel.index; font.bold: true; anchors.centerIn: parent }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VisualItemModel {
|
ObjectModel {
|
||||||
id: itemModel2
|
id: itemModel2
|
||||||
objectName: "itemModel2"
|
objectName: "itemModel2"
|
||||||
Rectangle {
|
Rectangle {
|
||||||
objectName: "item4"
|
objectName: "item4"
|
||||||
height: 50; width: 100; color: "#FFFEF0"
|
height: 50; width: 100; color: "#FFFEF0"
|
||||||
Text { objectName: "text4"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
|
Text { objectName: "text4"; text: "index: " + parent.ObjectModel.index; font.bold: true; anchors.centerIn: parent }
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
objectName: "item5"
|
objectName: "item5"
|
||||||
height: 50; width: 100; color: "#F0FFF7"
|
height: 50; width: 100; color: "#F0FFF7"
|
||||||
Text { objectName: "text5"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
|
Text { objectName: "text5"; text: "index: " + parent.ObjectModel.index; font.bold: true; anchors.centerIn: parent }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
width: 360
|
width: 360
|
||||||
height: 360
|
height: 360
|
||||||
|
|
||||||
VisualItemModel {
|
ObjectModel {
|
||||||
id: visItemModel
|
id: visItemModel
|
||||||
Rectangle {
|
Rectangle {
|
||||||
width: 20
|
width: 20
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
width: 200
|
width: 200
|
||||||
|
@ -6,7 +7,7 @@ ListView {
|
||||||
|
|
||||||
property var persistentHandle
|
property var persistentHandle
|
||||||
|
|
||||||
model: VisualDataModel {
|
model: DelegateModel {
|
||||||
id: visualModel
|
id: visualModel
|
||||||
|
|
||||||
persistedItems.includeByDefault: true
|
persistedItems.includeByDefault: true
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
width: 100
|
width: 100
|
||||||
height: 100
|
height: 100
|
||||||
model: visualModel.parts.package
|
model: visualModel.parts.package
|
||||||
VisualDataModel {
|
DelegateModel {
|
||||||
id: visualModel
|
id: visualModel
|
||||||
objectName: "visualModel"
|
objectName: "visualModel"
|
||||||
model: myModel
|
model: myModel
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
width: 100
|
width: 100
|
||||||
height: 100
|
height: 100
|
||||||
model: VisualDataModel {
|
model: DelegateModel {
|
||||||
id: visualModel
|
id: visualModel
|
||||||
objectName: "visualModel"
|
objectName: "visualModel"
|
||||||
model: myModel
|
model: myModel
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
|
|
||||||
VisualDataModel {
|
DelegateModel {
|
||||||
id: visualModel
|
id: visualModel
|
||||||
|
|
||||||
objectName: "visualModel"
|
objectName: "visualModel"
|
||||||
|
|
||||||
groups: [
|
groups: [
|
||||||
VisualDataGroup { id: visibleItems; objectName: "visibleItems"; name: "visible"; includeByDefault: true },
|
DelegateModelGroup { id: visibleItems; objectName: "visibleItems"; name: "visible"; includeByDefault: true },
|
||||||
VisualDataGroup { id: selectedItems; objectName: "selectedItems"; name: "selected" },
|
DelegateModelGroup { id: selectedItems; objectName: "selectedItems"; name: "selected" },
|
||||||
VisualDataGroup { id: unnamed; objectName: "unnamed" },
|
DelegateModelGroup { id: unnamed; objectName: "unnamed" },
|
||||||
VisualDataGroup { id: capitalised; objectName: "capitalised"; name: "Capitalised" }
|
DelegateModelGroup { id: capitalised; objectName: "capitalised"; name: "Capitalised" }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
width: 100
|
width: 100
|
||||||
|
@ -12,14 +13,14 @@ ListView {
|
||||||
}
|
}
|
||||||
model: visualModel.parts.package
|
model: visualModel.parts.package
|
||||||
|
|
||||||
VisualDataModel {
|
DelegateModel {
|
||||||
id: visualModel
|
id: visualModel
|
||||||
|
|
||||||
objectName: "visualModel"
|
objectName: "visualModel"
|
||||||
|
|
||||||
groups: [
|
groups: [
|
||||||
VisualDataGroup { id: visibleItems; objectName: "visibleItems"; name: "visible"; includeByDefault: true },
|
DelegateModelGroup { id: visibleItems; objectName: "visibleItems"; name: "visible"; includeByDefault: true },
|
||||||
VisualDataGroup { id: selectedItems; objectName: "selectedItems"; name: "selected" }
|
DelegateModelGroup { id: selectedItems; objectName: "selectedItems"; name: "selected" }
|
||||||
]
|
]
|
||||||
|
|
||||||
model: myModel
|
model: myModel
|
||||||
|
@ -28,16 +29,16 @@ ListView {
|
||||||
|
|
||||||
property variant test1: name
|
property variant test1: name
|
||||||
property variant test2: index
|
property variant test2: index
|
||||||
property variant test3: VisualDataModel.itemsIndex
|
property variant test3: DelegateModel.itemsIndex
|
||||||
property variant test4: VisualDataModel.inItems
|
property variant test4: DelegateModel.inItems
|
||||||
property variant test5: VisualDataModel.visibleIndex
|
property variant test5: DelegateModel.visibleIndex
|
||||||
property variant test6: VisualDataModel.inVisible
|
property variant test6: DelegateModel.inVisible
|
||||||
property variant test7: VisualDataModel.selectedIndex
|
property variant test7: DelegateModel.selectedIndex
|
||||||
property variant test8: VisualDataModel.inSelected
|
property variant test8: DelegateModel.inSelected
|
||||||
property variant test9: VisualDataModel.groups
|
property variant test9: DelegateModel.groups
|
||||||
|
|
||||||
function hide() { VisualDataModel.inVisible = false }
|
function hide() { DelegateModel.inVisible = false }
|
||||||
function select() { VisualDataModel.inSelected = true }
|
function select() { DelegateModel.inSelected = true }
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
Package.name: "package"
|
Package.name: "package"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
width: 100
|
width: 100
|
||||||
|
@ -12,14 +13,14 @@ ListView {
|
||||||
}
|
}
|
||||||
|
|
||||||
model: visualModel
|
model: visualModel
|
||||||
VisualDataModel {
|
DelegateModel {
|
||||||
id: visualModel
|
id: visualModel
|
||||||
|
|
||||||
objectName: "visualModel"
|
objectName: "visualModel"
|
||||||
|
|
||||||
groups: [
|
groups: [
|
||||||
VisualDataGroup { id: visibleItems; objectName: "visibleItems"; name: "visible"; includeByDefault: true },
|
DelegateModelGroup { id: visibleItems; objectName: "visibleItems"; name: "visible"; includeByDefault: true },
|
||||||
VisualDataGroup { id: selectedItems; objectName: "selectedItems"; name: "selected" }
|
DelegateModelGroup { id: selectedItems; objectName: "selectedItems"; name: "selected" }
|
||||||
]
|
]
|
||||||
|
|
||||||
model: myModel
|
model: myModel
|
||||||
|
@ -31,16 +32,16 @@ ListView {
|
||||||
height: 2
|
height: 2
|
||||||
property variant test1: name
|
property variant test1: name
|
||||||
property variant test2: index
|
property variant test2: index
|
||||||
property variant test3: VisualDataModel.itemsIndex
|
property variant test3: DelegateModel.itemsIndex
|
||||||
property variant test4: VisualDataModel.inItems
|
property variant test4: DelegateModel.inItems
|
||||||
property variant test5: VisualDataModel.visibleIndex
|
property variant test5: DelegateModel.visibleIndex
|
||||||
property variant test6: VisualDataModel.inVisible
|
property variant test6: DelegateModel.inVisible
|
||||||
property variant test7: VisualDataModel.selectedIndex
|
property variant test7: DelegateModel.selectedIndex
|
||||||
property variant test8: VisualDataModel.inSelected
|
property variant test8: DelegateModel.inSelected
|
||||||
property variant test9: VisualDataModel.groups
|
property variant test9: DelegateModel.groups
|
||||||
|
|
||||||
function hide() { VisualDataModel.inVisible = false }
|
function hide() { DelegateModel.inVisible = false }
|
||||||
function select() { VisualDataModel.inSelected = true }
|
function select() { DelegateModel.inSelected = true }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
property VisualDataModel invalidVdm: VisualDataModel.model
|
property DelegateModel invalidVdm: DelegateModel.model
|
||||||
Repeater {
|
Repeater {
|
||||||
model: 1
|
model: 1
|
||||||
delegate: Item {
|
delegate: Item {
|
||||||
id: outer
|
id: outer
|
||||||
objectName: "delegate"
|
objectName: "delegate"
|
||||||
|
|
||||||
property VisualDataModel validVdm: outer.VisualDataModel.model
|
property DelegateModel validVdm: outer.DelegateModel.model
|
||||||
property VisualDataModel invalidVdm: inner.VisualDataModel.model
|
property DelegateModel invalidVdm: inner.DelegateModel.model
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: inner
|
id: inner
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
width: 100
|
width: 100
|
||||||
|
@ -9,7 +10,7 @@ Item {
|
||||||
|
|
||||||
model: visualModel.parts.list
|
model: visualModel.parts.list
|
||||||
}
|
}
|
||||||
VisualDataModel {
|
DelegateModel {
|
||||||
id: visualModel
|
id: visualModel
|
||||||
|
|
||||||
model: myModel
|
model: myModel
|
||||||
|
|
|
@ -1,17 +1,18 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
width: 100
|
width: 100
|
||||||
height: 100
|
height: 100
|
||||||
model: visualModel.parts.package
|
model: visualModel.parts.package
|
||||||
|
|
||||||
VisualDataModel {
|
DelegateModel {
|
||||||
id: visualModel
|
id: visualModel
|
||||||
objectName: "visualModel"
|
objectName: "visualModel"
|
||||||
|
|
||||||
groups: [
|
groups: [
|
||||||
VisualDataGroup { id: visibleItems; objectName: "visibleItems"; name: "visible"; includeByDefault: true },
|
DelegateModelGroup { id: visibleItems; objectName: "visibleItems"; name: "visible"; includeByDefault: true },
|
||||||
VisualDataGroup { id: selectedItems; objectName: "selectedItems"; name: "selected" }
|
DelegateModelGroup { id: selectedItems; objectName: "selectedItems"; name: "selected" }
|
||||||
]
|
]
|
||||||
|
|
||||||
model: ListModel {
|
model: ListModel {
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
width: 100
|
width: 100
|
||||||
height: 100
|
height: 100
|
||||||
model: VisualDataModel {
|
model: DelegateModel {
|
||||||
id: visualModel
|
id: visualModel
|
||||||
objectName: "visualModel"
|
objectName: "visualModel"
|
||||||
|
|
||||||
groups: [
|
groups: [
|
||||||
VisualDataGroup { id: visibleItems; objectName: "visibleItems"; name: "visible"; includeByDefault: true },
|
DelegateModelGroup { id: visibleItems; objectName: "visibleItems"; name: "visible"; includeByDefault: true },
|
||||||
VisualDataGroup { id: selectedItems; objectName: "selectedItems"; name: "selected" }
|
DelegateModelGroup { id: selectedItems; objectName: "selectedItems"; name: "selected" }
|
||||||
]
|
]
|
||||||
|
|
||||||
model: ListModel {
|
model: ListModel {
|
||||||
|
|
|
@ -1,17 +1,18 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
import tst_qquickvisualdatamodel 1.0
|
import tst_qquickvisualdatamodel 1.0
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
width: 100
|
width: 100
|
||||||
height: 100
|
height: 100
|
||||||
model: visualModel.parts.package
|
model: visualModel.parts.package
|
||||||
VisualDataModel {
|
DelegateModel {
|
||||||
id: visualModel
|
id: visualModel
|
||||||
objectName: "visualModel"
|
objectName: "visualModel"
|
||||||
|
|
||||||
groups: [
|
groups: [
|
||||||
VisualDataGroup { id: visibleItems; objectName: "visibleItems"; name: "visible"; includeByDefault: true },
|
DelegateModelGroup { id: visibleItems; objectName: "visibleItems"; name: "visible"; includeByDefault: true },
|
||||||
VisualDataGroup { id: selectedItems; objectName: "selectedItems"; name: "selected" }
|
DelegateModelGroup { id: selectedItems; objectName: "selectedItems"; name: "selected" }
|
||||||
]
|
]
|
||||||
|
|
||||||
model: StandardItemModel {
|
model: StandardItemModel {
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
import tst_qquickvisualdatamodel 1.0
|
import tst_qquickvisualdatamodel 1.0
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
width: 100
|
width: 100
|
||||||
height: 100
|
height: 100
|
||||||
model: VisualDataModel {
|
model: DelegateModel {
|
||||||
id: visualModel
|
id: visualModel
|
||||||
objectName: "visualModel"
|
objectName: "visualModel"
|
||||||
|
|
||||||
groups: [
|
groups: [
|
||||||
VisualDataGroup { id: visibleItems; objectName: "visibleItems"; name: "visible"; includeByDefault: true },
|
DelegateModelGroup { id: visibleItems; objectName: "visibleItems"; name: "visible"; includeByDefault: true },
|
||||||
VisualDataGroup { id: selectedItems; objectName: "selectedItems"; name: "selected" }
|
DelegateModelGroup { id: selectedItems; objectName: "selectedItems"; name: "selected" }
|
||||||
]
|
]
|
||||||
|
|
||||||
model: StandardItemModel {
|
model: StandardItemModel {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
import tst_qquickvisualdatamodel 1.0
|
import tst_qquickvisualdatamodel 1.0
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
|
@ -6,7 +7,7 @@ ListView {
|
||||||
height: 100
|
height: 100
|
||||||
model: visualModel.parts.package
|
model: visualModel.parts.package
|
||||||
|
|
||||||
VisualDataModel {
|
DelegateModel {
|
||||||
id: visualModel
|
id: visualModel
|
||||||
objectName: "visualModel"
|
objectName: "visualModel"
|
||||||
|
|
||||||
|
@ -18,8 +19,8 @@ ListView {
|
||||||
]
|
]
|
||||||
|
|
||||||
groups: [
|
groups: [
|
||||||
VisualDataGroup { id: visibleItems; objectName: "visibleItems"; name: "visible"; includeByDefault: true },
|
DelegateModelGroup { id: visibleItems; objectName: "visibleItems"; name: "visible"; includeByDefault: true },
|
||||||
VisualDataGroup { id: selectedItems; objectName: "selectedItems"; name: "selected" }
|
DelegateModelGroup { id: selectedItems; objectName: "selectedItems"; name: "selected" }
|
||||||
]
|
]
|
||||||
|
|
||||||
model: objects
|
model: objects
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
import tst_qquickvisualdatamodel 1.0
|
import tst_qquickvisualdatamodel 1.0
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
width: 100
|
width: 100
|
||||||
height: 100
|
height: 100
|
||||||
model: VisualDataModel {
|
model: DelegateModel {
|
||||||
id: visualModel
|
id: visualModel
|
||||||
objectName: "visualModel"
|
objectName: "visualModel"
|
||||||
|
|
||||||
|
@ -16,8 +17,8 @@ ListView {
|
||||||
]
|
]
|
||||||
|
|
||||||
groups: [
|
groups: [
|
||||||
VisualDataGroup { id: visibleItems; objectName: "visibleItems"; name: "visible"; includeByDefault: true },
|
DelegateModelGroup { id: visibleItems; objectName: "visibleItems"; name: "visible"; includeByDefault: true },
|
||||||
VisualDataGroup { id: selectedItems; objectName: "selectedItems"; name: "selected" }
|
DelegateModelGroup { id: selectedItems; objectName: "selectedItems"; name: "selected" }
|
||||||
]
|
]
|
||||||
|
|
||||||
model: objects
|
model: objects
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
|
|
||||||
VisualDataModel {
|
DelegateModel {
|
||||||
id: vm
|
id: vm
|
||||||
|
|
||||||
property var inserted
|
property var inserted
|
||||||
|
@ -42,7 +43,7 @@ VisualDataModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
groups: [
|
groups: [
|
||||||
VisualDataGroup {
|
DelegateModelGroup {
|
||||||
id: vi;
|
id: vi;
|
||||||
|
|
||||||
property var inserted
|
property var inserted
|
||||||
|
@ -56,7 +57,7 @@ VisualDataModel {
|
||||||
vi.removed = removed
|
vi.removed = removed
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
VisualDataGroup {
|
DelegateModelGroup {
|
||||||
id: si;
|
id: si;
|
||||||
|
|
||||||
property var inserted
|
property var inserted
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
width: 240
|
width: 240
|
||||||
|
@ -34,7 +35,7 @@ Item {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VisualDataModel {
|
DelegateModel {
|
||||||
id: visualModel
|
id: visualModel
|
||||||
|
|
||||||
delegate: myDelegate
|
delegate: myDelegate
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
import tst_qquickvisualdatamodel 1.0
|
import tst_qquickvisualdatamodel 1.0
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
|
@ -6,13 +7,13 @@ ListView {
|
||||||
height: 100
|
height: 100
|
||||||
model: visualModel.parts.package
|
model: visualModel.parts.package
|
||||||
|
|
||||||
VisualDataModel {
|
DelegateModel {
|
||||||
id: visualModel
|
id: visualModel
|
||||||
objectName: "visualModel"
|
objectName: "visualModel"
|
||||||
|
|
||||||
groups: [
|
groups: [
|
||||||
VisualDataGroup { id: visibleItems; objectName: "visibleItems"; name: "visible"; includeByDefault: true },
|
DelegateModelGroup { id: visibleItems; objectName: "visibleItems"; name: "visible"; includeByDefault: true },
|
||||||
VisualDataGroup { id: selectedItems; objectName: "selectedItems"; name: "selected" }
|
DelegateModelGroup { id: selectedItems; objectName: "selectedItems"; name: "selected" }
|
||||||
]
|
]
|
||||||
|
|
||||||
model: SingleRoleModel {
|
model: SingleRoleModel {
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
import tst_qquickvisualdatamodel 1.0
|
import tst_qquickvisualdatamodel 1.0
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
width: 100
|
width: 100
|
||||||
height: 100
|
height: 100
|
||||||
model: VisualDataModel {
|
model: DelegateModel {
|
||||||
id: visualModel
|
id: visualModel
|
||||||
objectName: "visualModel"
|
objectName: "visualModel"
|
||||||
|
|
||||||
groups: [
|
groups: [
|
||||||
VisualDataGroup { id: visibleItems; objectName: "visibleItems"; name: "visible"; includeByDefault: true },
|
DelegateModelGroup { id: visibleItems; objectName: "visibleItems"; name: "visible"; includeByDefault: true },
|
||||||
VisualDataGroup { id: selectedItems; objectName: "selectedItems"; name: "selected" }
|
DelegateModelGroup { id: selectedItems; objectName: "selectedItems"; name: "selected" }
|
||||||
]
|
]
|
||||||
|
|
||||||
model: SingleRoleModel {
|
model: SingleRoleModel {
|
||||||
|
|
|
@ -1,17 +1,18 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
import tst_qquickvisualdatamodel 1.0
|
import tst_qquickvisualdatamodel 1.0
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
width: 100
|
width: 100
|
||||||
height: 100
|
height: 100
|
||||||
model: visualModel.parts.package
|
model: visualModel.parts.package
|
||||||
VisualDataModel {
|
DelegateModel {
|
||||||
id: visualModel
|
id: visualModel
|
||||||
objectName: "visualModel"
|
objectName: "visualModel"
|
||||||
|
|
||||||
groups: [
|
groups: [
|
||||||
VisualDataGroup { id: visibleItems; objectName: "visibleItems"; name: "visible"; includeByDefault: true },
|
DelegateModelGroup { id: visibleItems; objectName: "visibleItems"; name: "visible"; includeByDefault: true },
|
||||||
VisualDataGroup { id: selectedItems; objectName: "selectedItems"; name: "selected" }
|
DelegateModelGroup { id: selectedItems; objectName: "selectedItems"; name: "selected" }
|
||||||
]
|
]
|
||||||
|
|
||||||
model: [
|
model: [
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
import tst_qquickvisualdatamodel 1.0
|
import tst_qquickvisualdatamodel 1.0
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
width: 100
|
width: 100
|
||||||
height: 100
|
height: 100
|
||||||
model: VisualDataModel {
|
model: DelegateModel {
|
||||||
id: visualModel
|
id: visualModel
|
||||||
objectName: "visualModel"
|
objectName: "visualModel"
|
||||||
|
|
||||||
groups: [
|
groups: [
|
||||||
VisualDataGroup { id: visibleItems; objectName: "visibleItems"; name: "visible"; includeByDefault: true },
|
DelegateModelGroup { id: visibleItems; objectName: "visibleItems"; name: "visible"; includeByDefault: true },
|
||||||
VisualDataGroup { id: selectedItems; objectName: "selectedItems"; name: "selected" }
|
DelegateModelGroup { id: selectedItems; objectName: "selectedItems"; name: "selected" }
|
||||||
]
|
]
|
||||||
|
|
||||||
model: [
|
model: [
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
|
|
||||||
VisualDataModel {
|
DelegateModel {
|
||||||
function setRoot() {
|
function setRoot() {
|
||||||
rootIndex = modelIndex(0);
|
rootIndex = modelIndex(0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
** Copyright (C) 2018 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of the test suite of the Qt Toolkit.
|
** This file is part of the test suite of the Qt Toolkit.
|
||||||
|
@ -1213,7 +1213,7 @@ void tst_qquickvisualdatamodel::watchedRoles()
|
||||||
QQmlDelegateModel *vdm = qobject_cast<QQmlDelegateModel*>(object.data());
|
QQmlDelegateModel *vdm = qobject_cast<QQmlDelegateModel*>(object.data());
|
||||||
QVERIFY(vdm);
|
QVERIFY(vdm);
|
||||||
|
|
||||||
// VisualDataModel doesn't initialize model data until the first item is requested.
|
// DelegateModel doesn't initialize model data until the first item is requested.
|
||||||
QQuickItem *item = qobject_cast<QQuickItem*>(vdm->object(0));
|
QQuickItem *item = qobject_cast<QQuickItem*>(vdm->object(0));
|
||||||
QVERIFY(item);
|
QVERIFY(item);
|
||||||
vdm->release(item);
|
vdm->release(item);
|
||||||
|
@ -1456,22 +1456,22 @@ void tst_qquickvisualdatamodel::remove()
|
||||||
QCOMPARE(delegate->property("test3").toInt(), iIndex[i]);
|
QCOMPARE(delegate->property("test3").toInt(), iIndex[i]);
|
||||||
}
|
}
|
||||||
} {
|
} {
|
||||||
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML VisualDataGroup: remove: index out of range");
|
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML DelegateModelGroup: remove: index out of range");
|
||||||
evaluate<void>(visualModel, "items.remove(-8, 4)");
|
evaluate<void>(visualModel, "items.remove(-8, 4)");
|
||||||
QCOMPARE(listview->count(), 7);
|
QCOMPARE(listview->count(), 7);
|
||||||
QCOMPARE(visualModel->items()->count(), 7);
|
QCOMPARE(visualModel->items()->count(), 7);
|
||||||
} {
|
} {
|
||||||
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML VisualDataGroup: remove: index out of range");
|
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML DelegateModelGroup: remove: index out of range");
|
||||||
evaluate<void>(visualModel, "items.remove(12, 2)");
|
evaluate<void>(visualModel, "items.remove(12, 2)");
|
||||||
QCOMPARE(listview->count(), 7);
|
QCOMPARE(listview->count(), 7);
|
||||||
QCOMPARE(visualModel->items()->count(), 7);
|
QCOMPARE(visualModel->items()->count(), 7);
|
||||||
} {
|
} {
|
||||||
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML VisualDataGroup: remove: invalid count");
|
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML DelegateModelGroup: remove: invalid count");
|
||||||
evaluate<void>(visualModel, "items.remove(5, 3)");
|
evaluate<void>(visualModel, "items.remove(5, 3)");
|
||||||
QCOMPARE(listview->count(), 7);
|
QCOMPARE(listview->count(), 7);
|
||||||
QCOMPARE(visualModel->items()->count(), 7);
|
QCOMPARE(visualModel->items()->count(), 7);
|
||||||
} {
|
} {
|
||||||
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML VisualDataGroup: remove: invalid count");
|
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML DelegateModelGroup: remove: invalid count");
|
||||||
evaluate<void>(visualModel, "items.remove(5, -2)");
|
evaluate<void>(visualModel, "items.remove(5, -2)");
|
||||||
QCOMPARE(listview->count(), 7);
|
QCOMPARE(listview->count(), 7);
|
||||||
QCOMPARE(visualModel->items()->count(), 7);
|
QCOMPARE(visualModel->items()->count(), 7);
|
||||||
|
@ -1593,37 +1593,37 @@ void tst_qquickvisualdatamodel::move()
|
||||||
QCOMPARE(delegate->property("test3").toInt(), iIndex[i]);
|
QCOMPARE(delegate->property("test3").toInt(), iIndex[i]);
|
||||||
}
|
}
|
||||||
} {
|
} {
|
||||||
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML VisualDataGroup: move: invalid count");
|
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML DelegateModelGroup: move: invalid count");
|
||||||
evaluate<void>(visualModel, "items.move(5, 2, -2)");
|
evaluate<void>(visualModel, "items.move(5, 2, -2)");
|
||||||
QCOMPARE(listview->count(), 12);
|
QCOMPARE(listview->count(), 12);
|
||||||
QCOMPARE(visualModel->items()->count(), 12);
|
QCOMPARE(visualModel->items()->count(), 12);
|
||||||
} {
|
} {
|
||||||
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML VisualDataGroup: move: from index out of range");
|
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML DelegateModelGroup: move: from index out of range");
|
||||||
evaluate<void>(visualModel, "items.move(-6, 2, 1)");
|
evaluate<void>(visualModel, "items.move(-6, 2, 1)");
|
||||||
QCOMPARE(listview->count(), 12);
|
QCOMPARE(listview->count(), 12);
|
||||||
QCOMPARE(visualModel->items()->count(), 12);
|
QCOMPARE(visualModel->items()->count(), 12);
|
||||||
} {
|
} {
|
||||||
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML VisualDataGroup: move: from index out of range");
|
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML DelegateModelGroup: move: from index out of range");
|
||||||
evaluate<void>(visualModel, "items.move(15, 2, 1)");
|
evaluate<void>(visualModel, "items.move(15, 2, 1)");
|
||||||
QCOMPARE(listview->count(), 12);
|
QCOMPARE(listview->count(), 12);
|
||||||
QCOMPARE(visualModel->items()->count(), 12);
|
QCOMPARE(visualModel->items()->count(), 12);
|
||||||
} {
|
} {
|
||||||
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML VisualDataGroup: move: from index out of range");
|
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML DelegateModelGroup: move: from index out of range");
|
||||||
evaluate<void>(visualModel, "items.move(11, 1, 3)");
|
evaluate<void>(visualModel, "items.move(11, 1, 3)");
|
||||||
QCOMPARE(listview->count(), 12);
|
QCOMPARE(listview->count(), 12);
|
||||||
QCOMPARE(visualModel->items()->count(), 12);
|
QCOMPARE(visualModel->items()->count(), 12);
|
||||||
} {
|
} {
|
||||||
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML VisualDataGroup: move: to index out of range");
|
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML DelegateModelGroup: move: to index out of range");
|
||||||
evaluate<void>(visualModel, "items.move(2, -5, 1)");
|
evaluate<void>(visualModel, "items.move(2, -5, 1)");
|
||||||
QCOMPARE(listview->count(), 12);
|
QCOMPARE(listview->count(), 12);
|
||||||
QCOMPARE(visualModel->items()->count(), 12);
|
QCOMPARE(visualModel->items()->count(), 12);
|
||||||
} {
|
} {
|
||||||
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML VisualDataGroup: move: to index out of range");
|
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML DelegateModelGroup: move: to index out of range");
|
||||||
evaluate<void>(visualModel, "items.move(2, 14, 1)");
|
evaluate<void>(visualModel, "items.move(2, 14, 1)");
|
||||||
QCOMPARE(listview->count(), 12);
|
QCOMPARE(listview->count(), 12);
|
||||||
QCOMPARE(visualModel->items()->count(), 12);
|
QCOMPARE(visualModel->items()->count(), 12);
|
||||||
} {
|
} {
|
||||||
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML VisualDataGroup: move: to index out of range");
|
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML DelegateModelGroup: move: to index out of range");
|
||||||
evaluate<void>(visualModel, "items.move(2, 11, 4)");
|
evaluate<void>(visualModel, "items.move(2, 11, 4)");
|
||||||
QCOMPARE(listview->count(), 12);
|
QCOMPARE(listview->count(), 12);
|
||||||
QCOMPARE(visualModel->items()->count(), 12);
|
QCOMPARE(visualModel->items()->count(), 12);
|
||||||
|
@ -1786,82 +1786,82 @@ void tst_qquickvisualdatamodel::groups()
|
||||||
static const bool sMember[] = { f, f, f, f, f, f, f, f, t, t, f, f };
|
static const bool sMember[] = { f, f, f, f, f, f, f, f, t, t, f, f };
|
||||||
VERIFY_GROUPS;
|
VERIFY_GROUPS;
|
||||||
} {
|
} {
|
||||||
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML VisualDataGroup: addGroups: invalid count");
|
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML DelegateModelGroup: addGroups: invalid count");
|
||||||
evaluate<void>(visualModel, "items.addGroups(11, -4, \"items\")");
|
evaluate<void>(visualModel, "items.addGroups(11, -4, \"items\")");
|
||||||
QCOMPARE(listview->count(), 12);
|
QCOMPARE(listview->count(), 12);
|
||||||
QCOMPARE(visualModel->items()->count(), 12);
|
QCOMPARE(visualModel->items()->count(), 12);
|
||||||
QCOMPARE(visibleItems->count(), 9);
|
QCOMPARE(visibleItems->count(), 9);
|
||||||
QCOMPARE(selectedItems->count(), 2);
|
QCOMPARE(selectedItems->count(), 2);
|
||||||
} {
|
} {
|
||||||
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML VisualDataGroup: addGroups: index out of range");
|
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML DelegateModelGroup: addGroups: index out of range");
|
||||||
evaluate<void>(visualModel, "items.addGroups(-1, 3, \"items\")");
|
evaluate<void>(visualModel, "items.addGroups(-1, 3, \"items\")");
|
||||||
QCOMPARE(listview->count(), 12);
|
QCOMPARE(listview->count(), 12);
|
||||||
QCOMPARE(visualModel->items()->count(), 12);
|
QCOMPARE(visualModel->items()->count(), 12);
|
||||||
QCOMPARE(visibleItems->count(), 9);
|
QCOMPARE(visibleItems->count(), 9);
|
||||||
QCOMPARE(selectedItems->count(), 2);
|
QCOMPARE(selectedItems->count(), 2);
|
||||||
} {
|
} {
|
||||||
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML VisualDataGroup: addGroups: index out of range");
|
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML DelegateModelGroup: addGroups: index out of range");
|
||||||
evaluate<void>(visualModel, "items.addGroups(14, 3, \"items\")");
|
evaluate<void>(visualModel, "items.addGroups(14, 3, \"items\")");
|
||||||
QCOMPARE(listview->count(), 12);
|
QCOMPARE(listview->count(), 12);
|
||||||
QCOMPARE(visualModel->items()->count(), 12);
|
QCOMPARE(visualModel->items()->count(), 12);
|
||||||
QCOMPARE(visibleItems->count(), 9);
|
QCOMPARE(visibleItems->count(), 9);
|
||||||
QCOMPARE(selectedItems->count(), 2);
|
QCOMPARE(selectedItems->count(), 2);
|
||||||
} {
|
} {
|
||||||
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML VisualDataGroup: addGroups: invalid count");
|
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML DelegateModelGroup: addGroups: invalid count");
|
||||||
evaluate<void>(visualModel, "items.addGroups(11, 5, \"items\")");
|
evaluate<void>(visualModel, "items.addGroups(11, 5, \"items\")");
|
||||||
QCOMPARE(listview->count(), 12);
|
QCOMPARE(listview->count(), 12);
|
||||||
QCOMPARE(visualModel->items()->count(), 12);
|
QCOMPARE(visualModel->items()->count(), 12);
|
||||||
QCOMPARE(visibleItems->count(), 9);
|
QCOMPARE(visibleItems->count(), 9);
|
||||||
QCOMPARE(selectedItems->count(), 2);
|
QCOMPARE(selectedItems->count(), 2);
|
||||||
} {
|
} {
|
||||||
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML VisualDataGroup: setGroups: invalid count");
|
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML DelegateModelGroup: setGroups: invalid count");
|
||||||
evaluate<void>(visualModel, "items.setGroups(11, -4, \"items\")");
|
evaluate<void>(visualModel, "items.setGroups(11, -4, \"items\")");
|
||||||
QCOMPARE(listview->count(), 12);
|
QCOMPARE(listview->count(), 12);
|
||||||
QCOMPARE(visualModel->items()->count(), 12);
|
QCOMPARE(visualModel->items()->count(), 12);
|
||||||
QCOMPARE(visibleItems->count(), 9);
|
QCOMPARE(visibleItems->count(), 9);
|
||||||
QCOMPARE(selectedItems->count(), 2);
|
QCOMPARE(selectedItems->count(), 2);
|
||||||
} {
|
} {
|
||||||
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML VisualDataGroup: setGroups: index out of range");
|
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML DelegateModelGroup: setGroups: index out of range");
|
||||||
evaluate<void>(visualModel, "items.setGroups(-1, 3, \"items\")");
|
evaluate<void>(visualModel, "items.setGroups(-1, 3, \"items\")");
|
||||||
QCOMPARE(listview->count(), 12);
|
QCOMPARE(listview->count(), 12);
|
||||||
QCOMPARE(visualModel->items()->count(), 12);
|
QCOMPARE(visualModel->items()->count(), 12);
|
||||||
QCOMPARE(visibleItems->count(), 9);
|
QCOMPARE(visibleItems->count(), 9);
|
||||||
QCOMPARE(selectedItems->count(), 2);
|
QCOMPARE(selectedItems->count(), 2);
|
||||||
} {
|
} {
|
||||||
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML VisualDataGroup: setGroups: index out of range");
|
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML DelegateModelGroup: setGroups: index out of range");
|
||||||
evaluate<void>(visualModel, "items.setGroups(14, 3, \"items\")");
|
evaluate<void>(visualModel, "items.setGroups(14, 3, \"items\")");
|
||||||
QCOMPARE(listview->count(), 12);
|
QCOMPARE(listview->count(), 12);
|
||||||
QCOMPARE(visualModel->items()->count(), 12);
|
QCOMPARE(visualModel->items()->count(), 12);
|
||||||
QCOMPARE(visibleItems->count(), 9);
|
QCOMPARE(visibleItems->count(), 9);
|
||||||
QCOMPARE(selectedItems->count(), 2);
|
QCOMPARE(selectedItems->count(), 2);
|
||||||
} {
|
} {
|
||||||
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML VisualDataGroup: setGroups: invalid count");
|
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML DelegateModelGroup: setGroups: invalid count");
|
||||||
evaluate<void>(visualModel, "items.setGroups(11, 5, \"items\")");
|
evaluate<void>(visualModel, "items.setGroups(11, 5, \"items\")");
|
||||||
QCOMPARE(listview->count(), 12);
|
QCOMPARE(listview->count(), 12);
|
||||||
QCOMPARE(visualModel->items()->count(), 12);
|
QCOMPARE(visualModel->items()->count(), 12);
|
||||||
QCOMPARE(visibleItems->count(), 9);
|
QCOMPARE(visibleItems->count(), 9);
|
||||||
QCOMPARE(selectedItems->count(), 2);
|
QCOMPARE(selectedItems->count(), 2);
|
||||||
} {
|
} {
|
||||||
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML VisualDataGroup: removeGroups: invalid count");
|
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML DelegateModelGroup: removeGroups: invalid count");
|
||||||
evaluate<void>(visualModel, "items.removeGroups(11, -4, \"items\")");
|
evaluate<void>(visualModel, "items.removeGroups(11, -4, \"items\")");
|
||||||
QCOMPARE(listview->count(), 12);
|
QCOMPARE(listview->count(), 12);
|
||||||
QCOMPARE(visualModel->items()->count(), 12);
|
QCOMPARE(visualModel->items()->count(), 12);
|
||||||
} {
|
} {
|
||||||
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML VisualDataGroup: removeGroups: index out of range");
|
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML DelegateModelGroup: removeGroups: index out of range");
|
||||||
evaluate<void>(visualModel, "items.removeGroups(-1, 3, \"items\")");
|
evaluate<void>(visualModel, "items.removeGroups(-1, 3, \"items\")");
|
||||||
QCOMPARE(listview->count(), 12);
|
QCOMPARE(listview->count(), 12);
|
||||||
QCOMPARE(visualModel->items()->count(), 12);
|
QCOMPARE(visualModel->items()->count(), 12);
|
||||||
QCOMPARE(visibleItems->count(), 9);
|
QCOMPARE(visibleItems->count(), 9);
|
||||||
QCOMPARE(selectedItems->count(), 2);
|
QCOMPARE(selectedItems->count(), 2);
|
||||||
} {
|
} {
|
||||||
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML VisualDataGroup: removeGroups: index out of range");
|
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML DelegateModelGroup: removeGroups: index out of range");
|
||||||
evaluate<void>(visualModel, "items.removeGroups(14, 3, \"items\")");
|
evaluate<void>(visualModel, "items.removeGroups(14, 3, \"items\")");
|
||||||
QCOMPARE(listview->count(), 12);
|
QCOMPARE(listview->count(), 12);
|
||||||
QCOMPARE(visualModel->items()->count(), 12);
|
QCOMPARE(visualModel->items()->count(), 12);
|
||||||
QCOMPARE(visibleItems->count(), 9);
|
QCOMPARE(visibleItems->count(), 9);
|
||||||
QCOMPARE(selectedItems->count(), 2);
|
QCOMPARE(selectedItems->count(), 2);
|
||||||
} {
|
} {
|
||||||
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML VisualDataGroup: removeGroups: invalid count");
|
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML DelegateModelGroup: removeGroups: invalid count");
|
||||||
evaluate<void>(visualModel, "items.removeGroups(11, 5, \"items\")");
|
evaluate<void>(visualModel, "items.removeGroups(11, 5, \"items\")");
|
||||||
QCOMPARE(listview->count(), 12);
|
QCOMPARE(listview->count(), 12);
|
||||||
QCOMPARE(visualModel->items()->count(), 12);
|
QCOMPARE(visualModel->items()->count(), 12);
|
||||||
|
@ -2150,7 +2150,7 @@ void tst_qquickvisualdatamodel::get()
|
||||||
void tst_qquickvisualdatamodel::invalidGroups()
|
void tst_qquickvisualdatamodel::invalidGroups()
|
||||||
{
|
{
|
||||||
QUrl source = testFileUrl("groups-invalid.qml");
|
QUrl source = testFileUrl("groups-invalid.qml");
|
||||||
QTest::ignoreMessage(QtWarningMsg, (source.toString() + ":12:9: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("Group names must start with a lower case letter")).toUtf8());
|
QTest::ignoreMessage(QtWarningMsg, (source.toString() + ":13:9: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("Group names must start with a lower case letter")).toUtf8());
|
||||||
|
|
||||||
QQmlComponent component(&engine, source);
|
QQmlComponent component(&engine, source);
|
||||||
QScopedPointer<QObject> object(component.create());
|
QScopedPointer<QObject> object(component.create());
|
||||||
|
@ -2331,35 +2331,35 @@ void tst_qquickvisualdatamodel::create()
|
||||||
|
|
||||||
// persistedItems.includeByDefault is true, so all items belong to persistedItems initially.
|
// persistedItems.includeByDefault is true, so all items belong to persistedItems initially.
|
||||||
QVERIFY(delegate = findItem<QQuickItem>(contentItem, "delegate", 1));
|
QVERIFY(delegate = findItem<QQuickItem>(contentItem, "delegate", 1));
|
||||||
QCOMPARE(evaluate<bool>(delegate, "VisualDataModel.inPersistedItems"), true);
|
QCOMPARE(evaluate<bool>(delegate, "DelegateModel.inPersistedItems"), true);
|
||||||
|
|
||||||
// changing include by default doesn't remove persistance.
|
// changing include by default doesn't remove persistance.
|
||||||
evaluate<void>(visualModel, "persistedItems.includeByDefault = false");
|
evaluate<void>(visualModel, "persistedItems.includeByDefault = false");
|
||||||
QCOMPARE(evaluate<bool>(delegate, "VisualDataModel.inPersistedItems"), true);
|
QCOMPARE(evaluate<bool>(delegate, "DelegateModel.inPersistedItems"), true);
|
||||||
|
|
||||||
// removing from persistedItems does.
|
// removing from persistedItems does.
|
||||||
evaluate<void>(visualModel, "persistedItems.remove(0, 20)");
|
evaluate<void>(visualModel, "persistedItems.remove(0, 20)");
|
||||||
QCOMPARE(listview->count(), 20);
|
QCOMPARE(listview->count(), 20);
|
||||||
QCOMPARE(evaluate<bool>(delegate, "VisualDataModel.inPersistedItems"), false);
|
QCOMPARE(evaluate<bool>(delegate, "DelegateModel.inPersistedItems"), false);
|
||||||
|
|
||||||
// Request an item instantiated by the view.
|
// Request an item instantiated by the view.
|
||||||
QVERIFY(delegate = qobject_cast<QQuickItem *>(evaluate<QObject *>(visualModel, "items.create(1)")));
|
QVERIFY(delegate = qobject_cast<QQuickItem *>(evaluate<QObject *>(visualModel, "items.create(1)")));
|
||||||
QCOMPARE(delegate.data(), findItem<QQuickItem>(contentItem, "delegate", 1));
|
QCOMPARE(delegate.data(), findItem<QQuickItem>(contentItem, "delegate", 1));
|
||||||
QCOMPARE(evaluate<bool>(delegate, "VisualDataModel.inPersistedItems"), true);
|
QCOMPARE(evaluate<bool>(delegate, "DelegateModel.inPersistedItems"), true);
|
||||||
QCOMPARE(evaluate<int>(visualModel, "persistedItems.count"), 1);
|
QCOMPARE(evaluate<int>(visualModel, "persistedItems.count"), 1);
|
||||||
|
|
||||||
evaluate<void>(delegate, "VisualDataModel.inPersistedItems = false");
|
evaluate<void>(delegate, "DelegateModel.inPersistedItems = false");
|
||||||
QCOMPARE(listview->count(), 20);
|
QCOMPARE(listview->count(), 20);
|
||||||
QCoreApplication::sendPostedEvents(delegate, QEvent::DeferredDelete);
|
QCoreApplication::sendPostedEvents(delegate, QEvent::DeferredDelete);
|
||||||
QVERIFY(delegate);
|
QVERIFY(delegate);
|
||||||
QCOMPARE(evaluate<bool>(delegate, "VisualDataModel.inPersistedItems"), false);
|
QCOMPARE(evaluate<bool>(delegate, "DelegateModel.inPersistedItems"), false);
|
||||||
QCOMPARE(evaluate<int>(visualModel, "persistedItems.count"), 0);
|
QCOMPARE(evaluate<int>(visualModel, "persistedItems.count"), 0);
|
||||||
|
|
||||||
// Request an item not instantiated by the view.
|
// Request an item not instantiated by the view.
|
||||||
QVERIFY(!findItem<QQuickItem>(contentItem, "delegate", 15));
|
QVERIFY(!findItem<QQuickItem>(contentItem, "delegate", 15));
|
||||||
QVERIFY(delegate = qobject_cast<QQuickItem *>(evaluate<QObject *>(visualModel, "items.create(15)")));
|
QVERIFY(delegate = qobject_cast<QQuickItem *>(evaluate<QObject *>(visualModel, "items.create(15)")));
|
||||||
QCOMPARE(delegate.data(), findItem<QQuickItem>(contentItem, "delegate", 15));
|
QCOMPARE(delegate.data(), findItem<QQuickItem>(contentItem, "delegate", 15));
|
||||||
QCOMPARE(evaluate<bool>(delegate, "VisualDataModel.inPersistedItems"), true);
|
QCOMPARE(evaluate<bool>(delegate, "DelegateModel.inPersistedItems"), true);
|
||||||
QCOMPARE(evaluate<int>(visualModel, "persistedItems.count"), 1);
|
QCOMPARE(evaluate<int>(visualModel, "persistedItems.count"), 1);
|
||||||
|
|
||||||
evaluate<void>(visualModel, "persistedItems.remove(0)");
|
evaluate<void>(visualModel, "persistedItems.remove(0)");
|
||||||
|
@ -2371,28 +2371,28 @@ void tst_qquickvisualdatamodel::create()
|
||||||
QVERIFY(!findItem<QQuickItem>(contentItem, "delegate", 16));
|
QVERIFY(!findItem<QQuickItem>(contentItem, "delegate", 16));
|
||||||
QVERIFY(delegate = qobject_cast<QQuickItem *>(evaluate<QObject *>(visualModel, "items.create(16)")));
|
QVERIFY(delegate = qobject_cast<QQuickItem *>(evaluate<QObject *>(visualModel, "items.create(16)")));
|
||||||
QCOMPARE(delegate.data(), findItem<QQuickItem>(contentItem, "delegate", 16));
|
QCOMPARE(delegate.data(), findItem<QQuickItem>(contentItem, "delegate", 16));
|
||||||
QCOMPARE(evaluate<bool>(delegate, "VisualDataModel.inPersistedItems"), true);
|
QCOMPARE(evaluate<bool>(delegate, "DelegateModel.inPersistedItems"), true);
|
||||||
QCOMPARE(evaluate<int>(visualModel, "persistedItems.count"), 1);
|
QCOMPARE(evaluate<int>(visualModel, "persistedItems.count"), 1);
|
||||||
|
|
||||||
evaluate<void>(listview, "positionViewAtIndex(19, ListView.End)");
|
evaluate<void>(listview, "positionViewAtIndex(19, ListView.End)");
|
||||||
QCOMPARE(listview->count(), 20);
|
QCOMPARE(listview->count(), 20);
|
||||||
evaluate<void>(delegate, "VisualDataModel.groups = [\"items\"]");
|
evaluate<void>(delegate, "DelegateModel.groups = [\"items\"]");
|
||||||
QCoreApplication::sendPostedEvents(delegate, QEvent::DeferredDelete);
|
QCoreApplication::sendPostedEvents(delegate, QEvent::DeferredDelete);
|
||||||
QVERIFY(delegate);
|
QVERIFY(delegate);
|
||||||
QCOMPARE(evaluate<bool>(delegate, "VisualDataModel.inPersistedItems"), false);
|
QCOMPARE(evaluate<bool>(delegate, "DelegateModel.inPersistedItems"), false);
|
||||||
QCOMPARE(evaluate<int>(visualModel, "persistedItems.count"), 0);
|
QCOMPARE(evaluate<int>(visualModel, "persistedItems.count"), 0);
|
||||||
|
|
||||||
// Request and release an item instantiated by the view, then scroll the view so it releases it.
|
// Request and release an item instantiated by the view, then scroll the view so it releases it.
|
||||||
QVERIFY(findItem<QQuickItem>(contentItem, "delegate", 17));
|
QVERIFY(findItem<QQuickItem>(contentItem, "delegate", 17));
|
||||||
QVERIFY(delegate = qobject_cast<QQuickItem *>(evaluate<QObject *>(visualModel, "items.create(17)")));
|
QVERIFY(delegate = qobject_cast<QQuickItem *>(evaluate<QObject *>(visualModel, "items.create(17)")));
|
||||||
QCOMPARE(delegate.data(), findItem<QQuickItem>(contentItem, "delegate", 17));
|
QCOMPARE(delegate.data(), findItem<QQuickItem>(contentItem, "delegate", 17));
|
||||||
QCOMPARE(evaluate<bool>(delegate, "VisualDataModel.inPersistedItems"), true);
|
QCOMPARE(evaluate<bool>(delegate, "DelegateModel.inPersistedItems"), true);
|
||||||
QCOMPARE(evaluate<int>(visualModel, "persistedItems.count"), 1);
|
QCOMPARE(evaluate<int>(visualModel, "persistedItems.count"), 1);
|
||||||
|
|
||||||
evaluate<void>(visualModel, "items.removeGroups(17, \"persistedItems\")");
|
evaluate<void>(visualModel, "items.removeGroups(17, \"persistedItems\")");
|
||||||
QCoreApplication::sendPostedEvents(delegate, QEvent::DeferredDelete);
|
QCoreApplication::sendPostedEvents(delegate, QEvent::DeferredDelete);
|
||||||
QVERIFY(delegate);
|
QVERIFY(delegate);
|
||||||
QCOMPARE(evaluate<bool>(delegate, "VisualDataModel.inPersistedItems"), false);
|
QCOMPARE(evaluate<bool>(delegate, "DelegateModel.inPersistedItems"), false);
|
||||||
QCOMPARE(evaluate<int>(visualModel, "persistedItems.count"), 0);
|
QCOMPARE(evaluate<int>(visualModel, "persistedItems.count"), 0);
|
||||||
evaluate<void>(listview, "positionViewAtIndex(1, ListView.Beginning)");
|
evaluate<void>(listview, "positionViewAtIndex(1, ListView.Beginning)");
|
||||||
QCOMPARE(listview->count(), 20);
|
QCOMPARE(listview->count(), 20);
|
||||||
|
@ -2407,7 +2407,7 @@ void tst_qquickvisualdatamodel::create()
|
||||||
evaluate<void>(listview, "positionViewAtIndex(19, ListView.End)");
|
evaluate<void>(listview, "positionViewAtIndex(19, ListView.End)");
|
||||||
QCOMPARE(listview->count(), 20);
|
QCOMPARE(listview->count(), 20);
|
||||||
QVERIFY(delegate = findItem<QQuickItem>(contentItem, "delegate", 18));
|
QVERIFY(delegate = findItem<QQuickItem>(contentItem, "delegate", 18));
|
||||||
QCOMPARE(evaluate<bool>(delegate, "VisualDataModel.inPersistedItems"), true);
|
QCOMPARE(evaluate<bool>(delegate, "DelegateModel.inPersistedItems"), true);
|
||||||
QCoreApplication::sendPostedEvents(delegate, QEvent::DeferredDelete);
|
QCoreApplication::sendPostedEvents(delegate, QEvent::DeferredDelete);
|
||||||
QVERIFY(delegate);
|
QVERIFY(delegate);
|
||||||
evaluate<void>(listview, "positionViewAtIndex(1, ListView.Beginning)");
|
evaluate<void>(listview, "positionViewAtIndex(1, ListView.Beginning)");
|
||||||
|
@ -2428,11 +2428,11 @@ void tst_qquickvisualdatamodel::create()
|
||||||
|
|
||||||
void tst_qquickvisualdatamodel::incompleteModel()
|
void tst_qquickvisualdatamodel::incompleteModel()
|
||||||
{
|
{
|
||||||
// VisualDataModel is first populated in componentComplete. Verify various functions are
|
// DelegateModel is first populated in componentComplete. Verify various functions are
|
||||||
// harmlessly ignored until then.
|
// harmlessly ignored until then.
|
||||||
|
|
||||||
QQmlComponent component(&engine);
|
QQmlComponent component(&engine);
|
||||||
component.setData("import QtQuick 2.0\n VisualDataModel {}", testFileUrl(""));
|
component.setData("import QtQuick 2.0\nimport QtQml.Models 2.2\nDelegateModel {}", testFileUrl(""));
|
||||||
|
|
||||||
QScopedPointer<QObject> object(component.beginCreate(engine.rootContext()));
|
QScopedPointer<QObject> object(component.beginCreate(engine.rootContext()));
|
||||||
|
|
||||||
|
@ -2462,7 +2462,7 @@ void tst_qquickvisualdatamodel::incompleteModel()
|
||||||
QCOMPARE(itemsSpy.count(), 0);
|
QCOMPARE(itemsSpy.count(), 0);
|
||||||
QCOMPARE(persistedItemsSpy.count(), 0);
|
QCOMPARE(persistedItemsSpy.count(), 0);
|
||||||
|
|
||||||
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML VisualDataGroup: get: index out of range");
|
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML DelegateModelGroup: get: index out of range");
|
||||||
QVERIFY(evaluate<bool>(model, "items.get(0) === undefined"));
|
QVERIFY(evaluate<bool>(model, "items.get(0) === undefined"));
|
||||||
|
|
||||||
component.completeCreate();
|
component.completeCreate();
|
||||||
|
@ -3113,16 +3113,16 @@ void tst_qquickvisualdatamodel::insert()
|
||||||
QCOMPARE(evaluate<QString>(item, "test6"), propertyData.at(i));
|
QCOMPARE(evaluate<QString>(item, "test6"), propertyData.at(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
QCOMPARE(evaluate<bool>(item, "delegate.VisualDataModel.inItems"), true);
|
QCOMPARE(evaluate<bool>(item, "delegate.DelegateModel.inItems"), true);
|
||||||
QCOMPARE(evaluate<bool>(item, "delegate.VisualDataModel.inPersistedItems"), false);
|
QCOMPARE(evaluate<bool>(item, "delegate.DelegateModel.inPersistedItems"), false);
|
||||||
QCOMPARE(evaluate<bool>(item, "delegate.VisualDataModel.inVisible"), true);
|
QCOMPARE(evaluate<bool>(item, "delegate.DelegateModel.inVisible"), true);
|
||||||
QCOMPARE(evaluate<bool>(item, "delegate.VisualDataModel.inSelected"), false);
|
QCOMPARE(evaluate<bool>(item, "delegate.DelegateModel.inSelected"), false);
|
||||||
QCOMPARE(evaluate<bool>(item, "delegate.VisualDataModel.isUnresolved"), false);
|
QCOMPARE(evaluate<bool>(item, "delegate.DelegateModel.isUnresolved"), false);
|
||||||
|
|
||||||
QCOMPARE(evaluate<int>(item, "delegate.VisualDataModel.itemsIndex"), itemsIndex);
|
QCOMPARE(evaluate<int>(item, "delegate.DelegateModel.itemsIndex"), itemsIndex);
|
||||||
QCOMPARE(evaluate<int>(item, "delegate.VisualDataModel.persistedItemsIndex"), persisted && i > index ? 1 : 0);
|
QCOMPARE(evaluate<int>(item, "delegate.DelegateModel.persistedItemsIndex"), persisted && i > index ? 1 : 0);
|
||||||
QCOMPARE(evaluate<int>(item, "delegate.VisualDataModel.visibleIndex"), visible || i <= index ? i : i - 1);
|
QCOMPARE(evaluate<int>(item, "delegate.DelegateModel.visibleIndex"), visible || i <= index ? i : i - 1);
|
||||||
QCOMPARE(evaluate<int>(item, "delegate.VisualDataModel.selectedIndex"), selected && i > index ? 1 : 0);
|
QCOMPARE(evaluate<int>(item, "delegate.DelegateModel.selectedIndex"), selected && i > index ? 1 : 0);
|
||||||
} else if (inItems) {
|
} else if (inItems) {
|
||||||
get = QString("items.get(%1)").arg(index);
|
get = QString("items.get(%1)").arg(index);
|
||||||
} else if (persisted) {
|
} else if (persisted) {
|
||||||
|
@ -3176,16 +3176,16 @@ void tst_qquickvisualdatamodel::insert()
|
||||||
QCOMPARE(evaluate<QString>(item, "test6"), propertyData.at(index));
|
QCOMPARE(evaluate<QString>(item, "test6"), propertyData.at(index));
|
||||||
}
|
}
|
||||||
|
|
||||||
QCOMPARE(evaluate<bool>(item, "delegate.VisualDataModel.inItems"), inItems);
|
QCOMPARE(evaluate<bool>(item, "delegate.DelegateModel.inItems"), inItems);
|
||||||
QCOMPARE(evaluate<bool>(item, "delegate.VisualDataModel.inPersistedItems"), true);
|
QCOMPARE(evaluate<bool>(item, "delegate.DelegateModel.inPersistedItems"), true);
|
||||||
QCOMPARE(evaluate<bool>(item, "delegate.VisualDataModel.inVisible"), visible);
|
QCOMPARE(evaluate<bool>(item, "delegate.DelegateModel.inVisible"), visible);
|
||||||
QCOMPARE(evaluate<bool>(item, "delegate.VisualDataModel.inSelected"), selected);
|
QCOMPARE(evaluate<bool>(item, "delegate.DelegateModel.inSelected"), selected);
|
||||||
QCOMPARE(evaluate<bool>(item, "delegate.VisualDataModel.isUnresolved"), true);
|
QCOMPARE(evaluate<bool>(item, "delegate.DelegateModel.isUnresolved"), true);
|
||||||
|
|
||||||
QCOMPARE(evaluate<int>(item, "delegate.VisualDataModel.itemsIndex"), index);
|
QCOMPARE(evaluate<int>(item, "delegate.DelegateModel.itemsIndex"), index);
|
||||||
QCOMPARE(evaluate<int>(item, "delegate.VisualDataModel.persistedItemsIndex"), 0);
|
QCOMPARE(evaluate<int>(item, "delegate.DelegateModel.persistedItemsIndex"), 0);
|
||||||
QCOMPARE(evaluate<int>(item, "delegate.VisualDataModel.visibleIndex"), index);
|
QCOMPARE(evaluate<int>(item, "delegate.DelegateModel.visibleIndex"), index);
|
||||||
QCOMPARE(evaluate<int>(item, "delegate.VisualDataModel.selectedIndex"), 0);
|
QCOMPARE(evaluate<int>(item, "delegate.DelegateModel.selectedIndex"), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_qquickvisualdatamodel::resolve_data()
|
void tst_qquickvisualdatamodel::resolve_data()
|
||||||
|
@ -3577,16 +3577,16 @@ void tst_qquickvisualdatamodel::resolve()
|
||||||
QCOMPARE(evaluate<QString>(item, "test6"), propertyData.at(i));
|
QCOMPARE(evaluate<QString>(item, "test6"), propertyData.at(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
QCOMPARE(evaluate<bool>(item, "delegate.VisualDataModel.inItems"), true);
|
QCOMPARE(evaluate<bool>(item, "delegate.DelegateModel.inItems"), true);
|
||||||
QCOMPARE(evaluate<bool>(item, "delegate.VisualDataModel.inPersistedItems"), false);
|
QCOMPARE(evaluate<bool>(item, "delegate.DelegateModel.inPersistedItems"), false);
|
||||||
QCOMPARE(evaluate<bool>(item, "delegate.VisualDataModel.inVisible"), true);
|
QCOMPARE(evaluate<bool>(item, "delegate.DelegateModel.inVisible"), true);
|
||||||
QCOMPARE(evaluate<bool>(item, "delegate.VisualDataModel.inSelected"), false);
|
QCOMPARE(evaluate<bool>(item, "delegate.DelegateModel.inSelected"), false);
|
||||||
QCOMPARE(evaluate<bool>(item, "delegate.VisualDataModel.isUnresolved"), false);
|
QCOMPARE(evaluate<bool>(item, "delegate.DelegateModel.isUnresolved"), false);
|
||||||
|
|
||||||
QCOMPARE(evaluate<int>(item, "delegate.VisualDataModel.itemsIndex"), itemsIndex);
|
QCOMPARE(evaluate<int>(item, "delegate.DelegateModel.itemsIndex"), itemsIndex);
|
||||||
QCOMPARE(evaluate<int>(item, "delegate.VisualDataModel.persistedItemsIndex"), persisted && i > index ? 1 : 0);
|
QCOMPARE(evaluate<int>(item, "delegate.DelegateModel.persistedItemsIndex"), persisted && i > index ? 1 : 0);
|
||||||
QCOMPARE(evaluate<int>(item, "delegate.VisualDataModel.visibleIndex"), visible || i <= index ? i : i - 1);
|
QCOMPARE(evaluate<int>(item, "delegate.DelegateModel.visibleIndex"), visible || i <= index ? i : i - 1);
|
||||||
QCOMPARE(evaluate<int>(item, "delegate.VisualDataModel.selectedIndex"), selected && i > index ? 1 : 0);
|
QCOMPARE(evaluate<int>(item, "delegate.DelegateModel.selectedIndex"), selected && i > index ? 1 : 0);
|
||||||
} else if (inItems) {
|
} else if (inItems) {
|
||||||
get = QString("items.get(%1)").arg(index);
|
get = QString("items.get(%1)").arg(index);
|
||||||
} else if (persisted) {
|
} else if (persisted) {
|
||||||
|
@ -3640,16 +3640,16 @@ void tst_qquickvisualdatamodel::resolve()
|
||||||
QCOMPARE(evaluate<QString>(item, "test6"), propertyData.at(index));
|
QCOMPARE(evaluate<QString>(item, "test6"), propertyData.at(index));
|
||||||
}
|
}
|
||||||
|
|
||||||
QCOMPARE(evaluate<bool>(item, "delegate.VisualDataModel.inItems"), inItems);
|
QCOMPARE(evaluate<bool>(item, "delegate.DelegateModel.inItems"), inItems);
|
||||||
QCOMPARE(evaluate<bool>(item, "delegate.VisualDataModel.inPersistedItems"), true);
|
QCOMPARE(evaluate<bool>(item, "delegate.DelegateModel.inPersistedItems"), true);
|
||||||
QCOMPARE(evaluate<bool>(item, "delegate.VisualDataModel.inVisible"), visible);
|
QCOMPARE(evaluate<bool>(item, "delegate.DelegateModel.inVisible"), visible);
|
||||||
QCOMPARE(evaluate<bool>(item, "delegate.VisualDataModel.inSelected"), selected);
|
QCOMPARE(evaluate<bool>(item, "delegate.DelegateModel.inSelected"), selected);
|
||||||
QCOMPARE(evaluate<bool>(item, "delegate.VisualDataModel.isUnresolved"), false);
|
QCOMPARE(evaluate<bool>(item, "delegate.DelegateModel.isUnresolved"), false);
|
||||||
|
|
||||||
QCOMPARE(evaluate<int>(item, "delegate.VisualDataModel.itemsIndex"), index);
|
QCOMPARE(evaluate<int>(item, "delegate.DelegateModel.itemsIndex"), index);
|
||||||
QCOMPARE(evaluate<int>(item, "delegate.VisualDataModel.persistedItemsIndex"), 0);
|
QCOMPARE(evaluate<int>(item, "delegate.DelegateModel.persistedItemsIndex"), 0);
|
||||||
QCOMPARE(evaluate<int>(item, "delegate.VisualDataModel.visibleIndex"), index);
|
QCOMPARE(evaluate<int>(item, "delegate.DelegateModel.visibleIndex"), index);
|
||||||
QCOMPARE(evaluate<int>(item, "delegate.VisualDataModel.selectedIndex"), 0);
|
QCOMPARE(evaluate<int>(item, "delegate.DelegateModel.selectedIndex"), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_qquickvisualdatamodel::warnings_data()
|
void tst_qquickvisualdatamodel::warnings_data()
|
||||||
|
@ -3662,67 +3662,67 @@ void tst_qquickvisualdatamodel::warnings_data()
|
||||||
QTest::newRow("insert < 0")
|
QTest::newRow("insert < 0")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.insert(-2, {\"number\": \"eight\"})")
|
<< QString("items.insert(-2, {\"number\": \"eight\"})")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("insert: index out of range"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("insert: index out of range"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("insert > length")
|
QTest::newRow("insert > length")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.insert(8, {\"number\": \"eight\"})")
|
<< QString("items.insert(8, {\"number\": \"eight\"})")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("insert: index out of range"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("insert: index out of range"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("create < 0")
|
QTest::newRow("create < 0")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.create(-2, {\"number\": \"eight\"})")
|
<< QString("items.create(-2, {\"number\": \"eight\"})")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("create: index out of range"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("create: index out of range"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("create > length")
|
QTest::newRow("create > length")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.create(8, {\"number\": \"eight\"})")
|
<< QString("items.create(8, {\"number\": \"eight\"})")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("create: index out of range"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("create: index out of range"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("resolve from < 0")
|
QTest::newRow("resolve from < 0")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.resolve(-2, 3)")
|
<< QString("items.resolve(-2, 3)")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("resolve: from index out of range"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("resolve: from index out of range"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("resolve from > length")
|
QTest::newRow("resolve from > length")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.resolve(8, 3)")
|
<< QString("items.resolve(8, 3)")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("resolve: from index out of range"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("resolve: from index out of range"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("resolve to < 0")
|
QTest::newRow("resolve to < 0")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.resolve(3, -2)")
|
<< QString("items.resolve(3, -2)")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("resolve: to index out of range"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("resolve: to index out of range"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("resolve to > length")
|
QTest::newRow("resolve to > length")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.resolve(3, 8)")
|
<< QString("items.resolve(3, 8)")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("resolve: to index out of range"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("resolve: to index out of range"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("resolve from invalid index")
|
QTest::newRow("resolve from invalid index")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.resolve(\"two\", 3)")
|
<< QString("items.resolve(\"two\", 3)")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("resolve: from index invalid"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("resolve: from index invalid"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("resolve to invalid index")
|
QTest::newRow("resolve to invalid index")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.resolve(3, \"two\")")
|
<< QString("items.resolve(3, \"two\")")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("resolve: to index invalid"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("resolve: to index invalid"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("resolve already resolved item")
|
QTest::newRow("resolve already resolved item")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.resolve(3, 2)")
|
<< QString("items.resolve(3, 2)")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("resolve: from is not an unresolved item"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("resolve: from is not an unresolved item"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("resolve already resolved item")
|
QTest::newRow("resolve already resolved item")
|
||||||
|
@ -3730,193 +3730,193 @@ void tst_qquickvisualdatamodel::warnings_data()
|
||||||
<< QString("{ items.insert(0, {\"number\": \"eight\"});"
|
<< QString("{ items.insert(0, {\"number\": \"eight\"});"
|
||||||
"items.insert(1, {\"number\": \"seven\"});"
|
"items.insert(1, {\"number\": \"seven\"});"
|
||||||
"items.resolve(0, 1)}")
|
"items.resolve(0, 1)}")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("resolve: to is not a model item"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("resolve: to is not a model item"))
|
||||||
<< 6;
|
<< 6;
|
||||||
|
|
||||||
QTest::newRow("remove index < 0")
|
QTest::newRow("remove index < 0")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.remove(-2, 1)")
|
<< QString("items.remove(-2, 1)")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("remove: index out of range"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("remove: index out of range"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("remove index == length")
|
QTest::newRow("remove index == length")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.remove(4, 1)")
|
<< QString("items.remove(4, 1)")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("remove: index out of range"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("remove: index out of range"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("remove index > length")
|
QTest::newRow("remove index > length")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.remove(9, 1)")
|
<< QString("items.remove(9, 1)")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("remove: index out of range"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("remove: index out of range"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("remove invalid index")
|
QTest::newRow("remove invalid index")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.remove(\"nine\", 1)")
|
<< QString("items.remove(\"nine\", 1)")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("remove: invalid index"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("remove: invalid index"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("remove count < 0")
|
QTest::newRow("remove count < 0")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.remove(1, -2)")
|
<< QString("items.remove(1, -2)")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("remove: invalid count"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("remove: invalid count"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("remove index + count > length")
|
QTest::newRow("remove index + count > length")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.remove(2, 4, \"selected\")")
|
<< QString("items.remove(2, 4, \"selected\")")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("remove: invalid count"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("remove: invalid count"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("addGroups index < 0")
|
QTest::newRow("addGroups index < 0")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.addGroups(-2, 1, \"selected\")")
|
<< QString("items.addGroups(-2, 1, \"selected\")")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("addGroups: index out of range"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("addGroups: index out of range"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("addGroups index == length")
|
QTest::newRow("addGroups index == length")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.addGroups(4, 1, \"selected\")")
|
<< QString("items.addGroups(4, 1, \"selected\")")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("addGroups: index out of range"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("addGroups: index out of range"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("addGroups index > length")
|
QTest::newRow("addGroups index > length")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.addGroups(9, 1, \"selected\")")
|
<< QString("items.addGroups(9, 1, \"selected\")")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("addGroups: index out of range"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("addGroups: index out of range"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("addGroups count < 0")
|
QTest::newRow("addGroups count < 0")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.addGroups(1, -2, \"selected\")")
|
<< QString("items.addGroups(1, -2, \"selected\")")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("addGroups: invalid count"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("addGroups: invalid count"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("addGroups index + count > length")
|
QTest::newRow("addGroups index + count > length")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.addGroups(2, 4, \"selected\")")
|
<< QString("items.addGroups(2, 4, \"selected\")")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("addGroups: invalid count"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("addGroups: invalid count"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("removeGroups index < 0")
|
QTest::newRow("removeGroups index < 0")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.removeGroups(-2, 1, \"selected\")")
|
<< QString("items.removeGroups(-2, 1, \"selected\")")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("removeGroups: index out of range"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("removeGroups: index out of range"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("removeGroups index == length")
|
QTest::newRow("removeGroups index == length")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.removeGroups(4, 1, \"selected\")")
|
<< QString("items.removeGroups(4, 1, \"selected\")")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("removeGroups: index out of range"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("removeGroups: index out of range"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("removeGroups index > length")
|
QTest::newRow("removeGroups index > length")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.removeGroups(9, 1, \"selected\")")
|
<< QString("items.removeGroups(9, 1, \"selected\")")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("removeGroups: index out of range"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("removeGroups: index out of range"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("removeGroups count < 0")
|
QTest::newRow("removeGroups count < 0")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.removeGroups(1, -2, \"selected\")")
|
<< QString("items.removeGroups(1, -2, \"selected\")")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("removeGroups: invalid count"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("removeGroups: invalid count"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("removeGroups index + count > length")
|
QTest::newRow("removeGroups index + count > length")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.removeGroups(2, 4, \"selected\")")
|
<< QString("items.removeGroups(2, 4, \"selected\")")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("removeGroups: invalid count"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("removeGroups: invalid count"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("setGroups index < 0")
|
QTest::newRow("setGroups index < 0")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.setGroups(-2, 1, \"selected\")")
|
<< QString("items.setGroups(-2, 1, \"selected\")")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("setGroups: index out of range"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("setGroups: index out of range"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("setGroups index == length")
|
QTest::newRow("setGroups index == length")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.setGroups(4, 1, \"selected\")")
|
<< QString("items.setGroups(4, 1, \"selected\")")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("setGroups: index out of range"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("setGroups: index out of range"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("setGroups index > length")
|
QTest::newRow("setGroups index > length")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.setGroups(9, 1, \"selected\")")
|
<< QString("items.setGroups(9, 1, \"selected\")")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("setGroups: index out of range"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("setGroups: index out of range"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("setGroups count < 0")
|
QTest::newRow("setGroups count < 0")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.setGroups(1, -2, \"selected\")")
|
<< QString("items.setGroups(1, -2, \"selected\")")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("setGroups: invalid count"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("setGroups: invalid count"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("setGroups index + count > length")
|
QTest::newRow("setGroups index + count > length")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.setGroups(2, 4, \"selected\")")
|
<< QString("items.setGroups(2, 4, \"selected\")")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("setGroups: invalid count"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("setGroups: invalid count"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("move from < 0")
|
QTest::newRow("move from < 0")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.move(-2, 1, 1)")
|
<< QString("items.move(-2, 1, 1)")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("move: from index out of range"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("move: from index out of range"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("move from == length")
|
QTest::newRow("move from == length")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.move(4, 1, 1)")
|
<< QString("items.move(4, 1, 1)")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("move: from index out of range"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("move: from index out of range"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("move from > length")
|
QTest::newRow("move from > length")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.move(9, 1, 1)")
|
<< QString("items.move(9, 1, 1)")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("move: from index out of range"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("move: from index out of range"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("move invalid from")
|
QTest::newRow("move invalid from")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.move(\"nine\", 1, 1)")
|
<< QString("items.move(\"nine\", 1, 1)")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("move: invalid from index"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("move: invalid from index"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("move to < 0")
|
QTest::newRow("move to < 0")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.move(1, -2, 1)")
|
<< QString("items.move(1, -2, 1)")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("move: to index out of range"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("move: to index out of range"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("move to == length")
|
QTest::newRow("move to == length")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.move(1, 4, 1)")
|
<< QString("items.move(1, 4, 1)")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("move: to index out of range"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("move: to index out of range"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("move to > length")
|
QTest::newRow("move to > length")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.move(1, 9, 1)")
|
<< QString("items.move(1, 9, 1)")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("move: to index out of range"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("move: to index out of range"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("move invalid to")
|
QTest::newRow("move invalid to")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.move(1, \"nine\", 1)")
|
<< QString("items.move(1, \"nine\", 1)")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("move: invalid to index"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("move: invalid to index"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("move count < 0")
|
QTest::newRow("move count < 0")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.move(1, 1, -2)")
|
<< QString("items.move(1, 1, -2)")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("move: invalid count"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("move: invalid count"))
|
||||||
<< 4;
|
<< 4;
|
||||||
|
|
||||||
QTest::newRow("move from + count > length")
|
QTest::newRow("move from + count > length")
|
||||||
<< testFileUrl("listmodelproperties.qml")
|
<< testFileUrl("listmodelproperties.qml")
|
||||||
<< QString("items.move(2, 1, 4)")
|
<< QString("items.move(2, 1, 4)")
|
||||||
<< ("<Unknown File>: QML VisualDataGroup: " + QQmlDelegateModelGroup::tr("move: from index out of range"))
|
<< ("<Unknown File>: QML DelegateModelGroup: " + QQmlDelegateModelGroup::tr("move: from index out of range"))
|
||||||
<< 4;
|
<< 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
** Copyright (C) 2018 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of the test suite of the Qt Toolkit.
|
** This file is part of the test suite of the Qt Toolkit.
|
||||||
|
@ -27,6 +27,7 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: repeaterelementtest
|
id: repeaterelementtest
|
||||||
|
@ -48,7 +49,7 @@ Item {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VisualItemModel {
|
ObjectModel {
|
||||||
id: repeatermodel
|
id: repeatermodel
|
||||||
Rectangle { color: "blue"; height: 40; width: 150; border.color: "black"; border.width: 3; opacity: .9; radius: 5; clip: true
|
Rectangle { color: "blue"; height: 40; width: 150; border.color: "black"; border.width: 3; opacity: .9; radius: 5; clip: true
|
||||||
Text { text: "I am Thing 1"; anchors.centerIn: parent } }
|
Text { text: "I am Thing 1"; anchors.centerIn: parent } }
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
** Copyright (C) 2018 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of the test suite of the Qt Toolkit.
|
** This file is part of the test suite of the Qt Toolkit.
|
||||||
|
@ -27,6 +27,7 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
height: 360; width: 640
|
height: 360; width: 640
|
||||||
|
@ -105,7 +106,7 @@ Rectangle {
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
Rectangle { anchors.fill: parent; color: "transparent"; border.color: "black" }
|
Rectangle { anchors.fill: parent; color: "transparent"; border.color: "black" }
|
||||||
ListView { id: controls; model: controlsmodel; anchors.fill: parent; clip: true; cacheBuffer: 500 }
|
ListView { id: controls; model: controlsmodel; anchors.fill: parent; clip: true; cacheBuffer: 500 }
|
||||||
VisualItemModel {
|
ObjectModel {
|
||||||
id: controlsmodel
|
id: controlsmodel
|
||||||
ControlView {
|
ControlView {
|
||||||
id: textvalue
|
id: textvalue
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
** Copyright (C) 2018 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of the test suite of the Qt Toolkit.
|
** This file is part of the test suite of the Qt Toolkit.
|
||||||
|
@ -27,6 +27,7 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.1
|
import QtQuick 2.1
|
||||||
|
import QtQml.Models 2.12
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
height: 360; width: 640
|
height: 360; width: 640
|
||||||
|
@ -102,7 +103,7 @@ Rectangle {
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
Rectangle { anchors.fill: parent; color: "transparent"; border.color: "black" }
|
Rectangle { anchors.fill: parent; color: "transparent"; border.color: "black" }
|
||||||
ListView { id: controls; model: controlsmodel; anchors.fill: parent; clip: true; cacheBuffer: 500 }
|
ListView { id: controls; model: controlsmodel; anchors.fill: parent; clip: true; cacheBuffer: 500 }
|
||||||
VisualItemModel {
|
ObjectModel {
|
||||||
id: controlsmodel
|
id: controlsmodel
|
||||||
ControlView {
|
ControlView {
|
||||||
id: textvalue
|
id: textvalue
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
** Copyright (C) 2018 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of the test suite of the Qt Toolkit.
|
** This file is part of the test suite of the Qt Toolkit.
|
||||||
|
@ -27,6 +27,7 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQml.Models 2.12
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
height: 360; width: 640
|
height: 360; width: 640
|
||||||
|
@ -148,7 +149,7 @@ Rectangle {
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
Rectangle { anchors.fill: parent; color: "transparent"; border.color: "black" }
|
Rectangle { anchors.fill: parent; color: "transparent"; border.color: "black" }
|
||||||
ListView { id: controls; model: controlsmodel; anchors.fill: parent; clip: true; cacheBuffer: 500 }
|
ListView { id: controls; model: controlsmodel; anchors.fill: parent; clip: true; cacheBuffer: 500 }
|
||||||
VisualItemModel {
|
ObjectModel {
|
||||||
id: controlsmodel
|
id: controlsmodel
|
||||||
ControlView {
|
ControlView {
|
||||||
id: textvalue
|
id: textvalue
|
||||||
|
|
Loading…
Reference in New Issue