summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@theqtcompany.com>2016-03-17 16:34:58 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2016-03-18 08:12:15 +0000
commit5cf6ad9165cc38b7b2a7e2421d70f0d93256c866 (patch)
tree09f63a49f570bc5f4d3b3a922c4112a1d2ab37d1 /tests
parent463b8d7bb53ae5ea08ec6caafdf1754ca015603a (diff)
downloadqtquickcontrols-5cf6ad9165cc38b7b2a7e2421d70f0d93256c866.tar.gz
Controls: append "1" to all C++ classes
This is consistent with the classes that have already had this done. It prevents clashes with Qt Quick Controls 2. These classes are not available to the user, so it doesn't affect compatibility. Change-Id: Iee73ee6bc530182732ae95993e1f4fc3766eb8e0 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qquicktreemodeladaptor/tst_qquicktreemodeladaptor.cpp66
1 files changed, 33 insertions, 33 deletions
diff --git a/tests/auto/qquicktreemodeladaptor/tst_qquicktreemodeladaptor.cpp b/tests/auto/qquicktreemodeladaptor/tst_qquicktreemodeladaptor.cpp
index dcb9b0c2..03927fc2 100644
--- a/tests/auto/qquicktreemodeladaptor/tst_qquicktreemodeladaptor.cpp
+++ b/tests/auto/qquicktreemodeladaptor/tst_qquicktreemodeladaptor.cpp
@@ -36,10 +36,10 @@ class tst_QQuickTreeModelAdaptor : public QObject
Q_OBJECT
public:
- void compareData(int row, QQuickTreeModelAdaptor &tma, const QModelIndex &idx, TestModel &model, bool expanded = false);
- void compareModels(QQuickTreeModelAdaptor &tma, TestModel &model);
- void expandAndTest(const QModelIndex &idx, QQuickTreeModelAdaptor &tma, bool expandable, int expectedRowCountDifference);
- void collapseAndTest(const QModelIndex &idx, QQuickTreeModelAdaptor &tma, bool expandable, int expectedRowCountDifference);
+ void compareData(int row, QQuickTreeModelAdaptor1 &tma, const QModelIndex &idx, TestModel &model, bool expanded = false);
+ void compareModels(QQuickTreeModelAdaptor1 &tma, TestModel &model);
+ void expandAndTest(const QModelIndex &idx, QQuickTreeModelAdaptor1 &tma, bool expandable, int expectedRowCountDifference);
+ void collapseAndTest(const QModelIndex &idx, QQuickTreeModelAdaptor1 &tma, bool expandable, int expectedRowCountDifference);
private slots:
void initTestCase();
@@ -87,18 +87,18 @@ void tst_QQuickTreeModelAdaptor::cleanup()
{
}
-void tst_QQuickTreeModelAdaptor::compareData(int row, QQuickTreeModelAdaptor &tma, const QModelIndex &modelIdx, TestModel &model, bool expanded)
+void tst_QQuickTreeModelAdaptor::compareData(int row, QQuickTreeModelAdaptor1 &tma, const QModelIndex &modelIdx, TestModel &model, bool expanded)
{
const QModelIndex &tmaIdx = tma.index(row);
const int indexDepth = model.level(modelIdx) - model.level(tma.rootIndex()) - 1;
QCOMPARE(tma.mapToModel(tmaIdx), modelIdx);
QCOMPARE(tma.data(tmaIdx, Qt::DisplayRole).toString(), model.displayData(modelIdx));
- QCOMPARE(tma.data(tmaIdx, QQuickTreeModelAdaptor::DepthRole).toInt(), indexDepth);
- QCOMPARE(tma.data(tmaIdx, QQuickTreeModelAdaptor::ExpandedRole).toBool(), expanded);
- QCOMPARE(tma.data(tmaIdx, QQuickTreeModelAdaptor::HasChildrenRole).toBool(), model.hasChildren(modelIdx));
+ QCOMPARE(tma.data(tmaIdx, QQuickTreeModelAdaptor1::DepthRole).toInt(), indexDepth);
+ QCOMPARE(tma.data(tmaIdx, QQuickTreeModelAdaptor1::ExpandedRole).toBool(), expanded);
+ QCOMPARE(tma.data(tmaIdx, QQuickTreeModelAdaptor1::HasChildrenRole).toBool(), model.hasChildren(modelIdx));
}
-void tst_QQuickTreeModelAdaptor::expandAndTest(const QModelIndex &idx, QQuickTreeModelAdaptor &tma, bool expandable,
+void tst_QQuickTreeModelAdaptor::expandAndTest(const QModelIndex &idx, QQuickTreeModelAdaptor1 &tma, bool expandable,
int expectedRowCountDifference)
{
QSignalSpy rowsAboutToBeInsertedSpy(&tma, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)));
@@ -110,7 +110,7 @@ void tst_QQuickTreeModelAdaptor::expandAndTest(const QModelIndex &idx, QQuickTre
QCOMPARE(tma.isExpanded(idx), expandable);
const QModelIndex &tmaIdx = tma.index(tma.itemIndex(idx));
- QCOMPARE(tma.data(tmaIdx, QQuickTreeModelAdaptor::ExpandedRole).toBool(), expandable);
+ QCOMPARE(tma.data(tmaIdx, QQuickTreeModelAdaptor1::ExpandedRole).toBool(), expandable);
if (expandable && expectedRowCountDifference != 0) {
// Rows were added below the parent
@@ -132,7 +132,7 @@ void tst_QQuickTreeModelAdaptor::expandAndTest(const QModelIndex &idx, QQuickTre
const QVariantList &dataChangedArgs = dataChangedSpy.first();
QCOMPARE(dataChangedArgs.at(0).toModelIndex(), tmaIdx);
QCOMPARE(dataChangedArgs.at(1).toModelIndex(), tmaIdx);
- QCOMPARE(dataChangedArgs.at(2).value<QVector<int> >(), QVector<int>(1, QQuickTreeModelAdaptor::ExpandedRole));
+ QCOMPARE(dataChangedArgs.at(2).value<QVector<int> >(), QVector<int>(1, QQuickTreeModelAdaptor1::ExpandedRole));
} else {
QCOMPARE(tma.rowCount(), oldRowCount);
QCOMPARE(rowsAboutToBeInsertedSpy.count(), 0);
@@ -140,7 +140,7 @@ void tst_QQuickTreeModelAdaptor::expandAndTest(const QModelIndex &idx, QQuickTre
}
}
-void tst_QQuickTreeModelAdaptor::collapseAndTest(const QModelIndex &idx, QQuickTreeModelAdaptor &tma,
+void tst_QQuickTreeModelAdaptor::collapseAndTest(const QModelIndex &idx, QQuickTreeModelAdaptor1 &tma,
bool expandable, int expectedRowCountDifference)
{
QSignalSpy rowsAboutToBeRemovedSpy(&tma, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)));
@@ -153,7 +153,7 @@ void tst_QQuickTreeModelAdaptor::collapseAndTest(const QModelIndex &idx, QQuickT
const QModelIndex &tmaIdx = tma.index(tma.itemIndex(idx));
if (tmaIdx.isValid())
- QCOMPARE(tma.data(tmaIdx, QQuickTreeModelAdaptor::ExpandedRole).toBool(), false);
+ QCOMPARE(tma.data(tmaIdx, QQuickTreeModelAdaptor1::ExpandedRole).toBool(), false);
if (expandable && expectedRowCountDifference != 0) {
// Rows were removed below the parent
@@ -173,7 +173,7 @@ void tst_QQuickTreeModelAdaptor::collapseAndTest(const QModelIndex &idx, QQuickT
const QVariantList &dataChangedArgs = dataChangedSpy.first();
QCOMPARE(dataChangedArgs.at(0).toModelIndex(), tmaIdx);
QCOMPARE(dataChangedArgs.at(1).toModelIndex(), tmaIdx);
- QCOMPARE(dataChangedArgs.at(2).value<QVector<int> >(), QVector<int>(1, QQuickTreeModelAdaptor::ExpandedRole));
+ QCOMPARE(dataChangedArgs.at(2).value<QVector<int> >(), QVector<int>(1, QQuickTreeModelAdaptor1::ExpandedRole));
} else {
QCOMPARE(tma.rowCount(), oldRowCount);
QCOMPARE(rowsAboutToBeRemovedSpy.count(), 0);
@@ -181,7 +181,7 @@ void tst_QQuickTreeModelAdaptor::collapseAndTest(const QModelIndex &idx, QQuickT
}
}
-void tst_QQuickTreeModelAdaptor::compareModels(QQuickTreeModelAdaptor &tma, TestModel &model)
+void tst_QQuickTreeModelAdaptor::compareModels(QQuickTreeModelAdaptor1 &tma, TestModel &model)
{
QModelIndex parent = tma.rootIndex();
QStack<QModelIndex> parents;
@@ -214,7 +214,7 @@ void tst_QQuickTreeModelAdaptor::compareModels(QQuickTreeModelAdaptor &tma, Test
void tst_QQuickTreeModelAdaptor::setModel()
{
TestModel model(5, 1);
- QQuickTreeModelAdaptor tma;
+ QQuickTreeModelAdaptor1 tma;
QSignalSpy modelChangedSpy(&tma, SIGNAL(modelChanged(QAbstractItemModel*)));
tma.setModel(&model);
@@ -234,7 +234,7 @@ void tst_QQuickTreeModelAdaptor::setModel()
void tst_QQuickTreeModelAdaptor::modelDestroyed()
{
TestModel *model = new TestModel(5, 1);
- QQuickTreeModelAdaptor tma;
+ QQuickTreeModelAdaptor1 tma;
QSignalSpy modelChangedSpy(&tma, SIGNAL(modelChanged(QAbstractItemModel*)));
tma.setModel(model);
@@ -252,7 +252,7 @@ void tst_QQuickTreeModelAdaptor::modelDestroyed()
void tst_QQuickTreeModelAdaptor::modelReset()
{
TestModel model(5, 1);
- QQuickTreeModelAdaptor tma;
+ QQuickTreeModelAdaptor1 tma;
tma.setModel(&model);
QSignalSpy modelAboutToBeResetSpy(&tma, SIGNAL(modelAboutToBeReset()));
@@ -282,7 +282,7 @@ void tst_QQuickTreeModelAdaptor::rootIndex()
{
TestModel model(5, 1);
- QQuickTreeModelAdaptor tma;
+ QQuickTreeModelAdaptor1 tma;
tma.setModel(&model);
QVERIFY(!tma.rootIndex().isValid());
@@ -316,7 +316,7 @@ void tst_QQuickTreeModelAdaptor::dataAccess()
{
TestModel model(5, 1);
- QQuickTreeModelAdaptor tma;
+ QQuickTreeModelAdaptor1 tma;
tma.setModel(&model);
QCOMPARE(tma.rowCount(), model.rowCount());
@@ -338,7 +338,7 @@ void tst_QQuickTreeModelAdaptor::dataChange()
{
TestModel model(5, 1);
- QQuickTreeModelAdaptor tma;
+ QQuickTreeModelAdaptor1 tma;
tma.setModel(&model);
QSignalSpy dataChangedSpy(&tma, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector<int>)));
@@ -381,7 +381,7 @@ void tst_QQuickTreeModelAdaptor::groupedDataChange()
const QModelIndex &topLeftIdx = model.index(1, 0);
const QModelIndex &bottomRightIdx = model.index(7, 0);
- QQuickTreeModelAdaptor tma;
+ QQuickTreeModelAdaptor1 tma;
tma.setModel(&model);
QSignalSpy dataChangedSpy(&tma, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector<int>)));
@@ -493,7 +493,7 @@ void tst_QQuickTreeModelAdaptor::expandAndCollapse()
const QModelIndex &parentIdx = model.index(parentRow, 0);
bool expandable = model.hasChildren(parentIdx);
- QQuickTreeModelAdaptor tma;
+ QQuickTreeModelAdaptor1 tma;
tma.setModel(&model);
expandAndTest(parentIdx, tma, expandable, model.rowCount(parentIdx));
@@ -512,7 +512,7 @@ void tst_QQuickTreeModelAdaptor::expandAndCollapse2ndLevel()
const QModelIndex &parentIdx = model.index(expandRows[i], 0);
QVERIFY(model.hasChildren(parentIdx));
- QQuickTreeModelAdaptor tma;
+ QQuickTreeModelAdaptor1 tma;
tma.setModel(&model);
tma.expand(parentIdx);
@@ -568,7 +568,7 @@ void tst_QQuickTreeModelAdaptor::layoutChange()
const QModelIndex &idx = model.index(0, 0);
const QModelIndex &idx2 = model.index(2, 0);
- QQuickTreeModelAdaptor tma;
+ QQuickTreeModelAdaptor1 tma;
tma.setModel(&model);
// Nothing expanded
@@ -687,7 +687,7 @@ void tst_QQuickTreeModelAdaptor::removeRows()
QFETCH(int, expectedRemovedCount);
TestModel model(ModelRowCount, 1);
- QQuickTreeModelAdaptor tma;
+ QQuickTreeModelAdaptor1 tma;
tma.setModel(&model);
const QModelIndex &expandParentIdx = expandParentRow == -1 ? QModelIndex() : model.index(expandParentRow, 0);
@@ -726,7 +726,7 @@ void tst_QQuickTreeModelAdaptor::removeRows()
void tst_QQuickTreeModelAdaptor::removeRowsChildrenAndParent()
{
TestModel model(ModelRowCount, 1);
- QQuickTreeModelAdaptor tma;
+ QQuickTreeModelAdaptor1 tma;
tma.setModel(&model);
// Expand the first node
@@ -768,7 +768,7 @@ void tst_QQuickTreeModelAdaptor::removeRowsChildrenAndParent()
void tst_QQuickTreeModelAdaptor::removeChildrenMoveParent()
{
TestModel model(ModelRowCount, 1);
- QQuickTreeModelAdaptor tma;
+ QQuickTreeModelAdaptor1 tma;
tma.setModel(&model);
// Expand the first node
@@ -811,7 +811,7 @@ void tst_QQuickTreeModelAdaptor::removeChildrenMoveParent()
void tst_QQuickTreeModelAdaptor::removeChildrenRelayoutParent()
{
TestModel model(ModelRowCount, 1);
- QQuickTreeModelAdaptor tma;
+ QQuickTreeModelAdaptor1 tma;
tma.setModel(&model);
// Expand the first node
@@ -879,7 +879,7 @@ void tst_QQuickTreeModelAdaptor::insertRows()
QFETCH(int, expectedInsertedCount);
TestModel model(ModelRowCount, 1);
- QQuickTreeModelAdaptor tma;
+ QQuickTreeModelAdaptor1 tma;
tma.setModel(&model);
const QModelIndex &expandParentIdx = expandParentRow == -1 ? QModelIndex() : model.index(expandParentRow, 0);
@@ -1040,7 +1040,7 @@ void tst_QQuickTreeModelAdaptor::moveRows()
TestModel model(ModelRowCount, 1);
model.alternateChildlessRows = false;
- QQuickTreeModelAdaptor tma;
+ QQuickTreeModelAdaptor1 tma;
tma.setModel(&model);
const QModelIndex &expandParentIdx = expandParentRow == -1 ? QModelIndex() : model.index(expandParentRow, 0);
@@ -1159,7 +1159,7 @@ void tst_QQuickTreeModelAdaptor::selectionForRowRange()
TestModel model(ModelRowCount, 1);
model.alternateChildlessRows = false;
- QQuickTreeModelAdaptor tma;
+ QQuickTreeModelAdaptor1 tma;
tma.setModel(&model);
// NOTE: Some selections may look a bit cryptic. Insert a call to
@@ -1327,7 +1327,7 @@ void tst_QQuickTreeModelAdaptor::hasChildrenEmit()
{
TestModel model(1, 1);
model.alternateChildlessRows = false;
- QQuickTreeModelAdaptor tma;
+ QQuickTreeModelAdaptor1 tma;
tma.setModel(&model);
QModelIndex root = model.index(0,0);