31 #include <QtCore/QCoreApplication>
32 #include <QtCore/QSortFilterProxyModel>
33 #include <QtCore/QStringListModel>
34 #include <QtGui/QStandardItemModel>
39 #include <QVarLengthArray>
68 void dropMimeData_data();
70 void canDropMimeData();
71 void changePersistentIndex();
72 void movePersistentIndex();
83 void complexChangesWithPersistent();
85 void testMoveSameParentUp_data();
86 void testMoveSameParentUp();
88 void testMoveSameParentDown_data();
89 void testMoveSameParentDown();
91 void testMoveToGrandParent_data();
92 void testMoveToGrandParent();
94 void testMoveToSibling_data();
95 void testMoveToSibling();
97 void testMoveToUncle_data();
98 void testMoveToUncle();
100 void testMoveToDescendants();
102 void testMoveWithinOwnRange_data();
103 void testMoveWithinOwnRange();
105 void testMoveThroughProxy();
109 void testDataChanged();
111 void testChildrenLayoutsChanged();
113 void testRoleNames();
114 void testDragActions();
115 void dragActionsFallsBackToDropActions();
117 void testFunctionPointerSignalConnection();
121 void modelRoleDataSpanConstruction();
122 void modelRoleDataSpan();
153 const QModelIndex &destinationParent,
int destinationChild)
override;
155 const QModelIndex &destinationParent,
int destinationChild)
override;
172 for (
int r = 0;
r <
rows; ++
r) {
175 for (
int c = 0;
c < columns; ++
c)
185 cCount = tbl.at(0).count();
202 qWarning(
"got invalid modelIndex %d/%d",
idx.row(),
idx.column());
228 for (
int i = 0;
i < rc; ++
i)
270 destinationParent,
dst))
275 for (
int i = 0;
i < cnt; ++
i) {
281 for (
int i = 0;
i < cnt; ++
i) {
298 destinationParent,
dst))
304 for (
int i = 0;
i < cnt; ++
i) {
310 for (
int i = 0;
i < cnt; ++
i) {
366 qRegisterMetaType<QAbstractItemModel::LayoutChangeHint>();
378 void tst_QAbstractItemModel::index()
385 void tst_QAbstractItemModel::parent()
393 void tst_QAbstractItemModel::hasChildren()
400 void tst_QAbstractItemModel::data()
411 void tst_QAbstractItemModel::headerData()
421 void tst_QAbstractItemModel::itemData()
431 void tst_QAbstractItemModel::itemFlags()
440 void tst_QAbstractItemModel::match()
448 bool areEqual = (
idx ==
res.first());
518 # define STRINGTABLE (StringTable())
520 # define STRINGTABLE StringTable()
523 void tst_QAbstractItemModel::dropMimeData_data()
525 QTest::addColumn<StringTable>(
"src_table");
526 QTest::addColumn<StringTable>(
"dst_table");
527 QTest::addColumn<Selection>(
"selection");
528 QTest::addColumn<Position>(
"dst_position");
529 QTest::addColumn<StringTable>(
"res_table");
534 << (qStringTableRow(
"A",
"B",
"C"))
535 << (qStringTableRow(
"D",
"E",
"F")))
537 << (qStringTableRow(
"0",
"1",
"2"))
538 << (qStringTableRow(
"3",
"4",
"5")))
544 << (qStringTableRow(
"A",
"B",
"" ))
545 << (qStringTableRow(
"D",
"E",
"" ))
546 << (qStringTableRow(
"0",
"1",
"2"))
547 << (qStringTableRow(
"3",
"4",
"5")));
553 << (qStringTableRow(
"A",
"B",
"C"))
554 << (qStringTableRow(
"D",
"E",
"F")))
556 << (qStringTableRow(
"0",
"1",
"2"))
557 << (qStringTableRow(
"3",
"4",
"5")))
563 << (qStringTableRow(
"0",
"1",
"2"))
564 << (qStringTableRow(
"A",
"B",
"" ))
565 << (qStringTableRow(
"D",
"E",
"" ))
566 << (qStringTableRow(
"3",
"4",
"5")));
572 << (qStringTableRow(
"A",
"B",
"C"))
573 << (qStringTableRow(
"D",
"E",
"F")))
575 << (qStringTableRow(
"0",
"1",
"2"))
576 << (qStringTableRow(
"3",
"4",
"5")))
582 << (qStringTableRow(
"0",
"1",
"2"))
583 << (qStringTableRow(
"3",
"4",
"5"))
584 << (qStringTableRow(
"A",
"B",
"" ))
585 << (qStringTableRow(
"D",
"E",
"" )));
591 << (qStringTableRow(
"A",
"B",
"C"))
592 << (qStringTableRow(
"D",
"E",
"F")))
594 << (qStringTableRow(
"0",
"1",
"2"))
595 << (qStringTableRow(
"3",
"4",
"5")))
601 << (qStringTableRow(
"" ,
"A",
"B"))
602 << (qStringTableRow(
"" ,
"D",
"E"))
603 << (qStringTableRow(
"0",
"1",
"2"))
604 << (qStringTableRow(
"3",
"4",
"5")));
610 << (qStringTableRow(
"A",
"B",
"C"))
611 << (qStringTableRow(
"D",
"E",
"F")))
613 << (qStringTableRow(
"0",
"1",
"2"))
614 << (qStringTableRow(
"3",
"4",
"5")))
620 << (qStringTableRow(
"" ,
"" ,
"A"))
621 << (qStringTableRow(
"" ,
"" ,
"D"))
622 << (qStringTableRow(
"" ,
"" ,
"B"))
623 << (qStringTableRow(
"" ,
"" ,
"E"))
624 << (qStringTableRow(
"0",
"1",
"2"))
625 << (qStringTableRow(
"3",
"4",
"5")));
631 << (qStringTableRow(
"A",
"B",
"C"))
632 << (qStringTableRow(
"D",
"E",
"F")))
634 << (qStringTableRow(
"0",
"1",
"2"))
635 << (qStringTableRow(
"3",
"4",
"5")))
641 << (qStringTableRow(
"0",
"1",
"2"))
642 << (qStringTableRow(
"3",
"4",
"5"))
643 << (qStringTableRow(
"" ,
"" ,
"A"))
644 << (qStringTableRow(
"" ,
"" ,
"D"))
645 << (qStringTableRow(
"" ,
"" ,
"B"))
646 << (qStringTableRow(
"" ,
"" ,
"E")));
652 << (qStringTableRow(
"A",
"B",
"C"))
653 << (qStringTableRow(
"D",
"E",
"F")))
655 << (qStringTableRow(
"0",
"1",
"2"))
656 << (qStringTableRow(
"3",
"4",
"5")))
662 << (qStringTableRow(
"A",
"B",
"" ))
663 << (qStringTableRow(
"D",
"" ,
"" ))
664 << (qStringTableRow(
"0",
"1",
"2"))
665 << (qStringTableRow(
"3",
"4",
"5")));
671 << (qStringTableRow(
"A",
"B",
"C"))
672 << (qStringTableRow(
"D",
"E",
"F")))
674 << (qStringTableRow(
"0",
"1",
"2"))
675 << (qStringTableRow(
"3",
"4",
"5")))
681 << (qStringTableRow(
"" ,
"" ,
"A"))
682 << (qStringTableRow(
"" ,
"" ,
"D"))
683 << (qStringTableRow(
"" ,
"" ,
"B"))
684 << (qStringTableRow(
"0",
"1",
"2"))
685 << (qStringTableRow(
"3",
"4",
"5")));
691 << (qStringTableRow(
"A",
"B",
"C"))
692 << (qStringTableRow(
"D",
"E",
"F")))
694 << (qStringTableRow(
"0",
"1",
"2"))
695 << (qStringTableRow(
"3",
"4",
"5")))
701 << (qStringTableRow(
"A",
"B",
"" ))
702 << (qStringTableRow(
"A",
"" ,
"" ))
703 << (qStringTableRow(
"" ,
"B",
"" ))
704 << (qStringTableRow(
"0",
"1",
"2"))
705 << (qStringTableRow(
"3",
"4",
"5")));
711 << (qStringTableRow(
"A",
"B",
"C"))
712 << (qStringTableRow(
"D",
"E",
"F")))
714 << (qStringTableRow(
"0",
"1",
"2"))
715 << (qStringTableRow(
"3",
"4",
"5")))
721 << (qStringTableRow(
"0",
"1",
"2"))
722 << (qStringTableRow(
"3",
"4",
"5"))
723 << (qStringTableRow(
"" ,
"" ,
"A"))
724 << (qStringTableRow(
"" ,
"" ,
"B"))
725 << (qStringTableRow(
"" ,
"" ,
"A"))
726 << (qStringTableRow(
"" ,
"" ,
"B")));
731 << (qStringTableRow(
"A",
"B",
"C"))
732 << (qStringTableRow(
"D",
"E",
"F"))
733 << (qStringTableRow(
"G",
"H",
"I")))
735 << (qStringTableRow(
"0",
"1",
"2"))
736 << (qStringTableRow(
"3",
"4",
"5")))
742 << (qStringTableRow(
"0",
"1",
"2"))
743 << (qStringTableRow(
"3",
"4",
"5"))
744 << (qStringTableRow(
"" ,
"A" ,
"B"))
745 << (qStringTableRow(
"" ,
"G" ,
"H")));
749 QTest::newRow(
"2x 1x2 dropped at [3, 2] (different rows, over the edge)")
751 << (qStringTableRow(
"A",
"B",
"C"))
752 << (qStringTableRow(
"D",
"E",
"F"))
753 << (qStringTableRow(
"G",
"H",
"I")))
755 << (qStringTableRow(
"0",
"1",
"2"))
756 << (qStringTableRow(
"3",
"4",
"5")))
762 << (qStringTableRow(
"0",
"1",
"2"))
763 << (qStringTableRow(
"3",
"4",
"5"))
764 << (qStringTableRow(
"" ,
"" ,
"A"))
765 << (qStringTableRow(
"" ,
"" ,
"G"))
766 << (qStringTableRow(
"" ,
"" ,
"B"))
767 << (qStringTableRow(
"" ,
"" ,
"H")));
771 void tst_QAbstractItemModel::dropMimeData()
806 void tst_QAbstractItemModel::canDropMimeData()
815 void tst_QAbstractItemModel::changePersistentIndex()
826 void tst_QAbstractItemModel::movePersistentIndex()
845 void tst_QAbstractItemModel::removeRows()
852 QVERIFY(rowsAboutToBeRemovedSpy.isValid());
853 QVERIFY(rowsRemovedSpy.isValid());
856 QCOMPARE(rowsAboutToBeRemovedSpy.count(), 1);
857 QCOMPARE(rowsRemovedSpy.count(), 1);
860 void tst_QAbstractItemModel::removeColumns()
867 QVERIFY(columnsAboutToBeRemovedSpy.isValid());
868 QVERIFY(columnsRemovedSpy.isValid());
871 QCOMPARE(columnsAboutToBeRemovedSpy.count(), 1);
872 QCOMPARE(columnsRemovedSpy.count(), 1);
875 void tst_QAbstractItemModel::insertRows()
882 QVERIFY(rowsAboutToBeInsertedSpy.isValid());
883 QVERIFY(rowsInsertedSpy.isValid());
886 QCOMPARE(rowsAboutToBeInsertedSpy.count(), 1);
887 QCOMPARE(rowsInsertedSpy.count(), 1);
890 void tst_QAbstractItemModel::insertColumns()
897 QVERIFY(columnsAboutToBeInsertedSpy.isValid());
898 QVERIFY(columnsInsertedSpy.isValid());
901 QCOMPARE(columnsAboutToBeInsertedSpy.count(), 1);
902 QCOMPARE(columnsInsertedSpy.count(), 1);
905 void tst_QAbstractItemModel::moveRows()
912 QVERIFY(rowsAboutToBeMovedSpy.isValid());
913 QVERIFY(rowsMovedSpy.isValid());
916 QCOMPARE(rowsAboutToBeMovedSpy.count(), 1);
920 void tst_QAbstractItemModel::moveColumns()
927 QVERIFY(columnsAboutToBeMovedSpy.isValid());
928 QVERIFY(columnsMovedSpy.isValid());
931 QCOMPARE(columnsAboutToBeMovedSpy.count(), 1);
932 QCOMPARE(columnsMovedSpy.count(), 1);
935 QCOMPARE(columnsAboutToBeMovedSpy.count(), 2);
936 QCOMPARE(columnsMovedSpy.count(), 2);
939 void tst_QAbstractItemModel::reset()
949 void tst_QAbstractItemModel::complexChangesWithPersistent()
957 for (
int i=0;
i <10 ;
i++) {
965 for (
int i=0;
i <8 ;
i++)
975 for (
int i=0;
i <2 ;
i++)
977 for (
int i=2;
i <6 ;
i++)
979 for (
int i=6;
i <10 ;
i++)
990 for (
int i=0;
i <2 ;
i++)
992 for (
int i=2;
i <6 ;
i++)
994 for (
int i=6;
i <10 ;
i++)
1003 for (
int i=0;
i <2 ;
i++)
1005 for (
int i=2;
i <6 ;
i++)
1007 for (
int i=6;
i <10 ;
i++)
1011 void tst_QAbstractItemModel::testMoveSameParentDown_data()
1013 QTest::addColumn<int>(
"startRow");
1014 QTest::addColumn<int>(
"endRow");
1015 QTest::addColumn<int>(
"destRow");
1017 QTest::addColumn<bool>(
"topLevel");
1034 void tst_QAbstractItemModel::testMoveSameParentDown()
1099 for (
int i = 0;
i < indexList.
size();
i++) {
1102 if (
idx.parent() == moveParent) {
1104 if (
row >= startRow) {
1105 if (
row <= endRow) {
1110 }
else if (
row < destRow) {
1127 void tst_QAbstractItemModel::testMoveSameParentUp_data()
1129 QTest::addColumn<int>(
"startRow");
1130 QTest::addColumn<int>(
"endRow");
1131 QTest::addColumn<int>(
"destRow");
1132 QTest::addColumn<bool>(
"topLevel");
1149 void tst_QAbstractItemModel::testMoveSameParentUp()
1214 for (
int i = 0;
i < indexList.
size();
i++) {
1217 if (
idx.parent() == moveParent) {
1219 if (
row >= destRow) {
1220 if (
row < startRow) {
1225 }
else if (
row <= endRow) {
1242 void tst_QAbstractItemModel::testMoveThroughProxy()
1245 proxy->setSourceModel(m_model);
1261 void tst_QAbstractItemModel::testMoveToGrandParent_data()
1263 QTest::addColumn<int>(
"startRow");
1264 QTest::addColumn<int>(
"endRow");
1265 QTest::addColumn<int>(
"destRow");
1298 void tst_QAbstractItemModel::testMoveToGrandParent()
1313 parentsList <<
idx.parent();
1324 parentsList <<
idx.parent();
1362 for (
int i = 0;
i < indexList.
size();
i++) {
1368 if (
row >= destRow) {
1377 if (
row < startRow) {
1379 }
else if (
row <= endRow) {
1388 if (idxParent.
row() >= destRow) {
1390 adjustedParent = idxParent.
sibling(idxParent.
row() + endRow - startRow + 1, idxParent.
column());
1401 void tst_QAbstractItemModel::testMoveToSibling_data()
1403 QTest::addColumn<int>(
"startRow");
1404 QTest::addColumn<int>(
"endRow");
1405 QTest::addColumn<int>(
"destRow");
1439 void tst_QAbstractItemModel::testMoveToSibling()
1455 parentsList <<
idx.parent();
1461 for (
int i = 0;
i < m_model->
rowCount(destIndex); ++
i) {
1465 parentsList <<
idx.parent();
1502 for (
int i = 0;
i < indexList.
size();
i++) {
1509 if (idxParent == destIndex) {
1510 if (
row >= destRow) {
1513 if (idxParent.
row() > startRow) {
1523 if (
row < startRow) {
1525 }
else if (
row <= endRow) {
1528 if (destIndex.
row() > startRow) {
1545 void tst_QAbstractItemModel::testMoveToUncle_data()
1547 QTest::addColumn<int>(
"startRow");
1548 QTest::addColumn<int>(
"endRow");
1549 QTest::addColumn<int>(
"destRow");
1581 void tst_QAbstractItemModel::testMoveToUncle()
1602 for (
int i = 0;
i < m_model->
rowCount(sourceIndex); ++
i) {
1606 parentsList <<
idx.parent();
1611 for (
int i = 0;
i < m_model->
rowCount(destIndex); ++
i) {
1615 parentsList <<
idx.parent();
1651 for (
int i = 0;
i < indexList.
size();
i++) {
1657 if (idxParent == destIndex) {
1658 if (
row >= destRow) {
1667 if (
row < startRow) {
1669 }
else if (
row <= endRow) {
1684 void tst_QAbstractItemModel::testMoveToDescendants()
1687 const int depth = 6;
1709 for (
int i = 0;
i < m_model->
rowCount(sourceIndex); ++
i) {
1713 parentsList <<
idx.parent();
1718 for (
int i = 0;
i < m_model->
rowCount(destIndex); ++
i) {
1722 parentsList <<
idx.parent();
1751 void tst_QAbstractItemModel::testMoveWithinOwnRange_data()
1753 QTest::addColumn<int>(
"startRow");
1754 QTest::addColumn<int>(
"endRow");
1755 QTest::addColumn<int>(
"destRow");
1784 void tst_QAbstractItemModel::testMoveWithinOwnRange()
1853 while (
idx.isValid()) {
1855 m_nonPersistentIndexes <<
idx;
1866 for (
int i = 0;
i < m_persistentIndexes.
size(); ++
i) {
1875 for (
const auto &
idx : qAsConst(m_persistentIndexes)) {
1880 void tst_QAbstractItemModel::testReset()
1885 QVERIFY(beforeResetSpy.isValid());
1886 QVERIFY(afterResetSpy.isValid());
1904 QCOMPARE(beforeResetSpy.size(), 1);
1922 QCOMPARE(proxyBeforeResetSpy.size(), 1);
1923 QCOMPARE(proxyAfterResetSpy.size(), 1);
1928 QCOMPARE(proxyBeforeResetSpy.size(), 2);
1929 QCOMPARE(proxyAfterResetSpy.size(), 2);
1962 void tst_QAbstractItemModel::testDataChanged()
1970 QVERIFY(withoutRoles.isValid());
1972 model.emitSignals();
1974 QCOMPARE(withRoles.size(), withoutRoles.size());
2029 void tst_QAbstractItemModel::testChildrenLayoutsChanged()
2050 qRegisterMetaType<QList<QPersistentModelIndex> >();
2112 delete insertCommand;
2190 void tst_QAbstractItemModel::testRoleNames()
2198 void tst_QAbstractItemModel::testDragActions()
2220 void tst_QAbstractItemModel::dragActionsFallsBackToDropActions()
2259 void tst_QAbstractItemModel::testFunctionPointerSignalConnection()
2331 void tst_QAbstractItemModel::checkIndex()
2339 model.appendRow(topLevel);
2365 childIndex =
model.
index(1, 0, topLevelIndex);
2384 topLevelIndex = model2.
index(0, 0);
2401 template <
typename T>
2404 void tst_QAbstractItemModel::modelRoleDataSpanConstruction()
2407 static_assert(CanConvertToSpan<QModelRoleData &>);
2414 static_assert(!CanConvertToSpan<QModelRoleData>);
2424 void tst_QAbstractItemModel::modelRoleDataSpan()
2440 for (
int i = 0;
i < 3; ++
i)
2443 data[0].setData(42);
2445 data[2].setData(123.5);
2472 else if (role == 10)
2479 void tst_QAbstractItemModel::multiData()
2494 for (
const auto &roledata :
span)
2495 QVERIFY(roledata.data().isNull());
2501 const auto check = [&]() {
2502 for (
auto &roledata :
span) {
2503 const auto role = roledata.role();
2505 QVERIFY(!roledata.data().isNull());
2506 QVERIFY(roledata.data().userType() == qMetaTypeId<int>());
2507 QCOMPARE(roledata.data().toInt(), role);
2508 }
else if (role == 10) {
2509 QVERIFY(!roledata.data().isNull());
2510 QVERIFY(roledata.data().userType() == qMetaTypeId<QString>());
2513 QVERIFY(roledata.data().isNull());
2524 for (
auto &roledata :
span)
2525 roledata.clearData();
2532 #include "tst_qabstractitemmodel.moc"
small capitals from c petite p scientific i
[1]
CustomRoleModel(QObject *parent=nullptr)
int rowCount(const QModelIndex &index=QModelIndex()) const override
int columnCount(const QModelIndex &index=QModelIndex()) const override
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
ListenerObject(QAbstractProxyModel *parent)
void slotAboutToBeReset()
void fillIndexStores(const QModelIndex &parent)
virtual void doCommand() override
void setSecondAncestorRowNumbers(QList< int > rows)
void setNumCols(int cols)
void setStartRow(int row)
void setAncestorRowNumbers(QList< int > rowNumbers)
virtual void doCommand() override
virtual void doCommand() override
void setDestAncestors(QList< int > rows)
QHash< int, QByteArray > roleNames() const override
QVariant data(const QModelIndex &index, int role) const override
int rowCount(const QModelIndex &) const override
OverrideDropActions(QObject *parent=nullptr)
Qt::DropActions supportedDropActions() const override
OverrideRoleNamesAndDragActions(QObject *parent=nullptr)
Qt::DropActions supportedDragActions() const override
QHash< int, QByteArray > roleNames() const override
The QAbstractItemModel class provides the abstract interface for item model classes.
void rowsMoved(const QModelIndex &parent, int start, int end, const QModelIndex &destination, int row, QPrivateSignal)
virtual Qt::DropActions supportedDropActions() const
void modelAboutToBeReset(QPrivateSignal)
virtual bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const
bool beginMoveRows(const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationRow)
virtual Q_INVOKABLE QModelIndexList match(const QModelIndex &start, int role, const QVariant &value, int hits=1, Qt::MatchFlags flags=Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap)) const
void columnsRemoved(const QModelIndex &parent, int first, int last, QPrivateSignal)
void rowsAboutToBeInserted(const QModelIndex &parent, int first, int last, QPrivateSignal)
void columnsAboutToBeInserted(const QModelIndex &parent, int first, int last, QPrivateSignal)
Q_INVOKABLE bool hasIndex(int row, int column, const QModelIndex &parent=QModelIndex()) const
void modelReset(QPrivateSignal)
void beginRemoveColumns(const QModelIndex &parent, int first, int last)
void changePersistentIndex(const QModelIndex &from, const QModelIndex &to)
void layoutAboutToBeChanged(const QList< QPersistentModelIndex > &parents=QList< QPersistentModelIndex >(), QAbstractItemModel::LayoutChangeHint hint=QAbstractItemModel::NoLayoutChangeHint)
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList< int > &roles=QList< int >())
bool insertRow(int row, const QModelIndex &parent=QModelIndex())
void columnsAboutToBeMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationColumn, QPrivateSignal)
bool moveColumn(const QModelIndex &sourceParent, int sourceColumn, const QModelIndex &destinationParent, int destinationChild)
virtual bool moveColumns(const QModelIndex &sourceParent, int sourceColumn, int count, const QModelIndex &destinationParent, int destinationChild)
virtual bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex())
void columnsAboutToBeRemoved(const QModelIndex &parent, int first, int last, QPrivateSignal)
void layoutChanged(const QList< QPersistentModelIndex > &parents=QList< QPersistentModelIndex >(), QAbstractItemModel::LayoutChangeHint hint=QAbstractItemModel::NoLayoutChangeHint)
bool insertColumn(int column, const QModelIndex &parent=QModelIndex())
bool checkIndex(const QModelIndex &index, CheckIndexOptions options=CheckIndexOption::NoOption) const
void columnsMoved(const QModelIndex &parent, int start, int end, const QModelIndex &destination, int column, QPrivateSignal)
virtual Q_INVOKABLE bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
void rowsAboutToBeRemoved(const QModelIndex &parent, int first, int last, QPrivateSignal)
bool beginMoveColumns(const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationColumn)
virtual QHash< int, QByteArray > roleNames() const
void beginInsertColumns(const QModelIndex &parent, int first, int last)
virtual QMap< int, QVariant > itemData(const QModelIndex &index) const
virtual bool insertRows(int row, int count, const QModelIndex &parent=QModelIndex())
virtual bool moveRows(const QModelIndex &sourceParent, int sourceRow, int count, const QModelIndex &destinationParent, int destinationChild)
virtual Qt::DropActions supportedDragActions() const
void rowsAboutToBeMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow, QPrivateSignal)
void rowsInserted(const QModelIndex &parent, int first, int last, QPrivateSignal)
QModelIndex createIndex(int row, int column, const void *data=nullptr) const
void columnsInserted(const QModelIndex &parent, int first, int last, QPrivateSignal)
virtual void multiData(const QModelIndex &index, QModelRoleDataSpan roleDataSpan) const
void beginRemoveRows(const QModelIndex &parent, int first, int last)
virtual Q_INVOKABLE QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const =0
void beginInsertRows(const QModelIndex &parent, int first, int last)
void rowsRemoved(const QModelIndex &parent, int first, int last, QPrivateSignal)
The QAbstractListModel class provides an abstract model that can be subclassed to create one-dimensio...
QModelIndex index(int row, int column=0, const QModelIndex &parent=QModelIndex()) const override
The QAbstractProxyModel class provides a base class for proxy item models that can do sorting,...
QHash< int, QByteArray > roleNames() const override
virtual Q_INVOKABLE QModelIndex mapToSource(const QModelIndex &proxyIndex) const =0
bool hasChildren(const QModelIndex &parent=QModelIndex()) const override
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
Qt::ItemFlags flags(const QModelIndex &index) const override
The QByteArray class provides an array of bytes.
bool contains(const Key &key) const noexcept
T value(const Key &key) const noexcept
iterator insert(const Key &key, const T &value)
qsizetype size() const noexcept
const_reference at(qsizetype i) const noexcept
qsizetype count() const noexcept
void append(parameter_type t)
T value(const Key &key, const T &defaultValue=T()) const
size_type count(const Key &key) const
The QMimeData class provides a container for data that records information about its MIME type.
The QModelIndex class is used to locate data in a data model.
constexpr int row() const noexcept
QModelIndex parent() const
constexpr const QAbstractItemModel * model() const noexcept
constexpr int column() const noexcept
constexpr bool isValid() const noexcept
QModelIndex sibling(int row, int column) const
The QModelRoleData class holds a role and the data associated to that role.
The QModelRoleDataSpan class provides a span over QModelRoleData objects.
The QObject class is the base class of all Qt objects.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
The QPersistentModelIndex class is used to locate data in a data model.
The QRegularExpression class provides pattern matching using regular expressions.
The QSortFilterProxyModel class provides support for sorting and filtering data passed between anothe...
void setSourceModel(QAbstractItemModel *sourceModel) override
QVariant data(const QModelIndex &item, int role=Qt::DisplayRole) const override
int rowCount(const QModelIndex &parent=QModelIndex()) const override
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role=Qt::EditRole) override
QHash< int, QByteArray > roleNames() const override
bool insertColumns(int column, int count, const QModelIndex &parent=QModelIndex()) override
bool removeColumns(int column, int count, const QModelIndex &parent=QModelIndex()) override
The QStandardItem class provides an item for use with the QStandardItemModel class.
void appendRow(const QList< QStandardItem * > &items)
The QStandardItemModel class provides a generic model for storing custom data.\inmodule QtGui.
void appendRow(const QList< QStandardItem * > &items)
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
The QString class provides a Unicode character string.
static QString number(int, int base=10)
The QStringList class provides a list of strings.
The QStringListModel class provides a model that supplies strings to views.
QStringListModel(QObject *parent=nullptr)
The QVariant class acts like a union for the most common Qt data types.
static auto fromValue(const T &value) -> std::enable_if_t< std::is_copy_constructible_v< T >, QVariant >
int toInt(bool *ok=nullptr) const
bool hasChildren(const QModelIndex &) const override
bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex()) override
bool insertColumns(int column, int count, const QModelIndex &parent=QModelIndex()) override
bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const override
bool moveColumns(const QModelIndex &sourceParent, int sourceColumn, int count, const QModelIndex &destinationParent, int destinationChild) override
bool insertRows(int row, int count, const QModelIndex &parent=QModelIndex()) override
QList< QList< QString > > table
void setPersistent(const QModelIndex &from, const QModelIndex &to)
bool removeColumns(int column, int count, const QModelIndex &parent=QModelIndex()) override
int columnCount(const QModelIndex &parent) const override
QVariant data(const QModelIndex &idx, int) const override
bool setData(const QModelIndex &idx, const QVariant &value, int) override
QtTestModel(int rows, int columns, QObject *parent=nullptr)
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
int rowCount(const QModelIndex &parent) const override
bool moveRows(const QModelIndex &sourceParent, int sourceRow, int count, const QModelIndex &destinationParent, int destinationChild) override
SignalArgumentChecker(const QModelIndex &p1, const QModelIndex &p2, QObject *parent=nullptr)
void testSlotWithParam_3(const QModelIndex &idx, int start, int end)
SignalConnectionTester(QObject *parent=nullptr)
void testSlotWithParam_1(const QModelIndex &idx)
void testSlotWithParam_2(const QModelIndex &idx, int start)
map insert("Paris", "France")
Q_TESTLIB_EXPORT QTestData & newRow(const char *dataTag)
Q_TESTLIB_EXPORT void ignoreMessage(QtMsgType type, const char *message)
#define QByteArrayLiteral(str)
std::pair< T1, T2 > QPair
EGLOutputLayerEXT EGLint EGLAttrib value
#define Q_ARG(type, data)
GLboolean GLboolean GLboolean b
GLint GLenum GLsizei GLsizei GLsizei depth
GLboolean GLboolean GLboolean GLboolean a
[7]
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat s1
GLdouble GLdouble GLdouble GLdouble top
GLenum GLenum GLsizei count
GLenum GLuint GLenum GLsizei const GLchar * buf
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLenum GLsizei void GLsizei void * column
GLenum GLenum GLsizei void * row
GLenum GLenum GLsizei void GLsizei void void * span
GLenum GLenum GLsizei void * table
#define QStringLiteral(str)
#define QTEST_MAIN(TestObject)
#define QFETCH(Type, name)
#define QVERIFY(statement)
QSqlQueryModel * model
[16]
settings remove("monkey")
connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection)
QItemSelection * selection
[0]
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
bool contains(const AT &t) const noexcept
Q_DECLARE_METATYPE(QAbstractItemModel::LayoutChangeHint)
QList< QList< QString > > StringTable
constexpr bool CanConvertToSpan
QList< QString > StringTableRow
QPair< int, int > Position
QList< QPair< int, int > > Selection
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent