31 #include <QStandardItemModel>
34 #include <QAbstractItemModelTester>
36 #include <private/qabstractitemmodel_p.h>
37 #include <private/qtreeview_p.h>
86 void insertRow_data();
89 void insertRowsItems();
90 void insertRowInHierarcy();
91 void insertColumn_data();
97 void persistentIndexes();
98 void removingPersistentIndexes();
99 void updatingPersistentIndexes();
101 void checkChildren();
104 void clearItemData();
107 void sortRole_data();
109 void sortRoleBindings();
111 void getSetHeaderItem();
112 void indexFromItem();
113 void itemFromIndex();
114 void getSetItemPrototype();
115 void getSetItemData();
116 void setHeaderLabels_data();
117 void setHeaderLabels();
118 void itemDataChanged();
119 void takeHeaderItem();
127 void rootItemFlags();
128 #ifdef QT_BUILD_INTERNAL
129 void treeDragAndDrop();
131 void removeRowsAndColumns();
133 void defaultItemRoles();
134 void itemRoleNames();
135 void getMimeDataWithInvalidModelIndex();
136 void supportedDragDropActions();
138 void taskQTBUG_45114_setItemData();
139 void setItemPersistentIndex();
140 void signalsOnTakeItem();
141 void createPersistentOnLayoutAboutToBeChanged();
156 static constexpr
int defaultSize = 3;
163 qRegisterMetaType<QStandardItem*>(
"QStandardItem*");
164 qRegisterMetaType<Qt::Orientation>(
"Qt::Orientation");
165 qRegisterMetaType<QAbstractItemModel::LayoutChangeHint>(
"QAbstractItemModel::LayoutChangeHint");
166 qRegisterMetaType<QList<QPersistentModelIndex>>(
"QList<QPersistentModelIndex>");
202 currentRoles = roles;
216 void tst_QStandardItemModel::insertRow_data()
218 QTest::addColumn<int>(
"insertRow");
219 QTest::addColumn<int>(
"expectedRow");
223 QTest::newRow(
"Insert beyond count") << defaultSize+1 << defaultSize;
224 QTest::newRow(
"Insert at count") << defaultSize << defaultSize;
228 void tst_QStandardItemModel::insertRow()
244 if (insertRow >= 0 && insertRow <= defaultSize) {
265 void tst_QStandardItemModel::insertRows()
271 QString headerLabel =
"custom";
296 void tst_QStandardItemModel::insertRowsItems()
303 for (
int i = 0;
i < 3; ++
i)
316 void tst_QStandardItemModel::insertRowInHierarcy()
333 void tst_QStandardItemModel::insertColumn_data()
335 QTest::addColumn<int>(
"insertColumn");
336 QTest::addColumn<int>(
"expectedColumn");
340 QTest::newRow(
"Insert beyond count") << defaultSize+1 << defaultSize;
341 QTest::newRow(
"Insert at count") << defaultSize << defaultSize;
345 void tst_QStandardItemModel::insertColumn()
347 QFETCH(
int, insertColumn);
348 QFETCH(
int, expectedColumn);
360 if (insertColumn >= 0 && insertColumn <= defaultSize) {
381 void tst_QStandardItemModel::insertColumns()
387 QString headerLabel =
"custom";
411 void tst_QStandardItemModel::removeRows()
417 QString headerLabel =
"custom";
433 void tst_QStandardItemModel::removeColumns()
439 QString headerLabel =
"custom";
456 void tst_QStandardItemModel::setHeaderData()
458 for (
int x = 0;
x < 2; ++
x) {
459 bool vertical = (
x == 0);
476 QCOMPARE(headerDataChangedSpy.count(), 1);
477 QCOMPARE(dataChangedSpy.count(), 0);
479 QCOMPARE(qvariant_cast<Qt::Orientation>(
args.at(0)), orient);
484 QCOMPARE(headerDataChangedSpy.count(), 0);
485 QCOMPARE(dataChangedSpy.count(), 0);
499 void tst_QStandardItemModel::persistentIndexes()
508 QVERIFY(persistentIndex.isValid());
510 QCOMPARE(persistentIndex.column(), 0);
514 QVERIFY(persistentIndex.isValid());
516 QCOMPARE(persistentIndex.column(), 0);
520 QVERIFY(persistentIndex.isValid());
522 QCOMPARE(persistentIndex.column(), 0);
526 QVERIFY(persistentIndex.isValid());
528 QCOMPARE(persistentIndex.column(), 1);
532 QVERIFY(persistentIndex.isValid());
534 QCOMPARE(persistentIndex.column(), 1);
538 QVERIFY(persistentIndex.isValid());
540 QCOMPARE(persistentIndex.column(), 1);
544 QVERIFY(persistentIndex.isValid());
546 QCOMPARE(persistentIndex.column(), 1);
550 QVERIFY(persistentIndex.isValid());
552 QCOMPARE(persistentIndex.column(), 1);
556 QVERIFY(persistentIndex.isValid());
558 QCOMPARE(persistentIndex.column(), 0);
562 QVERIFY(!persistentIndex.isValid());
565 persistentIndex = m_model->
index(0, 0);
566 QVERIFY(persistentIndex.isValid());
568 QVERIFY(!persistentIndex.isValid());
581 void tst_QStandardItemModel::removingPersistentIndexes()
603 persistent = m_model->
index(0, 0, m_model->
index(0, 0));
608 persistent = m_model->
index(0, 0);
619 persistent = m_model->
index(0, 0, m_model->
index(0, 0));
624 persistent = m_model->
index(0, 0);
646 void tst_QStandardItemModel::updatingPersistentIndexes()
651 persistent = m_model->
index(1, 0);
665 rcParent[change] =
parent;
666 rcFirst[change] =
first;
667 rcLast[change] = last;
671 void tst_QStandardItemModel::checkChildren()
724 void tst_QStandardItemModel::data()
726 currentRoles.
clear();
752 void tst_QStandardItemModel::clearItemData()
754 currentRoles.
clear();
762 currentRoles.
clear();
770 currentRoles.
clear();
773 void tst_QStandardItemModel::clear()
790 QCOMPARE(layoutChangedSpy.count(), 0);
791 QCOMPARE(rowsRemovedSpy.count(), 0);
798 void tst_QStandardItemModel::sort_data()
800 QTest::addColumn<Qt::SortOrder>(
"sortOrder");
801 QTest::addColumn<QStringList>(
"initial");
802 QTest::addColumn<QStringList>(
"expected");
805 {
"delta",
"yankee",
"bravo",
"lima",
"charlie",
"juliet",
806 "tango",
"hotel",
"uniform",
"alpha",
"echo",
"golf",
807 "quebec",
"foxtrot",
"india",
"romeo",
"november",
808 "oskar",
"zulu",
"kilo",
"whiskey",
"mike",
"papa",
809 "sierra",
"xray" ,
"viktor"});
821 for (
int i = 1000;
i < 2000; ++
i)
826 void tst_QStandardItemModel::sort()
850 QCOMPARE(layoutAboutToBeChangedSpy.count(), 1);
851 QCOMPARE(layoutChangedSpy.count(), 1);
860 void tst_QStandardItemModel::sortRole_data()
862 QTest::addColumn<QStringList>(
"initialText");
863 QTest::addColumn<QVariantList>(
"initialData");
864 QTest::addColumn<Qt::ItemDataRole>(
"sortRole");
865 QTest::addColumn<Qt::SortOrder>(
"sortOrder");
866 QTest::addColumn<QStringList>(
"expectedText");
867 QTest::addColumn<QVariantList>(
"expectedData");
885 void tst_QStandardItemModel::sortRole()
895 for (
int i = 0;
i < initialText.count(); ++
i) {
897 item->setText(initialText.at(
i));
901 model.setSortRole(sortRole);
903 for (
int i = 0;
i < expectedText.count(); ++
i) {
910 void tst_QStandardItemModel::sortRoleBindings()
926 void tst_QStandardItemModel::findItems()
945 void tst_QStandardItemModel::getSetHeaderItem()
951 model.setHorizontalHeaderItem(0, hheader);
955 model.setHorizontalHeaderItem(0,
nullptr);
960 model.setVerticalHeaderItem(0, vheader);
964 model.setVerticalHeaderItem(0,
nullptr);
968 void tst_QStandardItemModel::indexFromItem()
997 noSuchIndex =
model.indexFromItem(
nullptr);
1001 void tst_QStandardItemModel::itemFromIndex()
1032 void tst_QStandardItemModel::getSetItemPrototype()
1038 model.setItemPrototype(proto);
1041 model.setRowCount(1);
1042 model.setColumnCount(1);
1049 model.setItemPrototype(
nullptr);
1053 void tst_QStandardItemModel::getSetItemData()
1064 QSize sizeHint(64, 48);
1078 QLatin1String accessibleDescription(
"accessibleDescription");
1089 QCOMPARE(modelDataChangedSpy.count(), 1);
1091 QCOMPARE(modelDataChangedSpy.count(), 1);
1095 void tst_QStandardItemModel::setHeaderLabels_data()
1097 QTest::addColumn<int>(
"rows");
1098 QTest::addColumn<int>(
"columns");
1099 QTest::addColumn<Qt::Orientation>(
"orientation");
1100 QTest::addColumn<QStringList>(
"labels");
1101 QTest::addColumn<QStringList>(
"expectedLabels");
1141 void tst_QStandardItemModel::setHeaderLabels()
1152 model.setHorizontalHeaderLabels(labels);
1154 model.setVerticalHeaderLabels(labels);
1155 for (
int i = 0;
i < expectedLabels.count(); ++
i)
1157 QCOMPARE(columnsInsertedSpy.count(),
1158 (orientation ==
Qt::Vertical) ? 0 : labels.count() > columns);
1163 void tst_QStandardItemModel::itemDataChanged()
1171 QCOMPARE(dataChangedSpy.count(), 1);
1172 QCOMPARE(itemChangedSpy.count(), 1);
1175 args = dataChangedSpy.takeFirst();
1178 args = itemChangedSpy.takeFirst();
1182 QCOMPARE(dataChangedSpy.count(), 1);
1183 QCOMPARE(itemChangedSpy.count(), 1);
1184 args = dataChangedSpy.takeFirst();
1187 args = itemChangedSpy.takeFirst();
1191 QCOMPARE(dataChangedSpy.count(), 0);
1192 QCOMPARE(itemChangedSpy.count(), 0);
1195 QCOMPARE(dataChangedSpy.count(), 1);
1196 QCOMPARE(itemChangedSpy.count(), 1);
1197 args = dataChangedSpy.takeFirst();
1200 args = itemChangedSpy.takeFirst();
1204 QCOMPARE(dataChangedSpy.count(), 0);
1205 QCOMPARE(itemChangedSpy.count(), 0);
1208 void tst_QStandardItemModel::takeHeaderItem()
1213 model.setHorizontalHeaderItem(0, hheader.get());
1215 model.setVerticalHeaderItem(0, vheader.get());
1225 void tst_QStandardItemModel::useCase1()
1228 const int columns = 8;
1252 for (
int i = 0;
i < 4; ++
i) {
1255 for (
int j = 0;
j <
parent->columnCount(); ++
j) {
1278 void tst_QStandardItemModel::useCase2()
1281 model.setColumnCount(2);
1282 createChildren(&
model,
model.invisibleRootItem(), 0);
1285 void tst_QStandardItemModel::useCase3()
1289 for (
int i = 0;
i < 100; ++
i) {
1292 item->appendRow(childItem);
1298 model.appendRow(childItem);
1305 parentItem = childItem;
1306 childItem = childItem->
child(0);
1310 childItem =
model.takeItem(0);
1312 parentItem =
nullptr;
1324 void tst_QStandardItemModel::setNullChild()
1327 model.setColumnCount(2);
1328 createChildren(&
model,
model.invisibleRootItem(), 0);
1331 item->setChild(0,
nullptr);
1336 void tst_QStandardItemModel::deleteChild()
1339 model.setColumnCount(2);
1340 createChildren(&
model,
model.invisibleRootItem(), 0);
1343 delete item->child(0);
1348 void tst_QStandardItemModel::rootItemFlags()
1355 model.invisibleRootItem()->setFlags(
f);
1359 #if QT_CONFIG(draganddrop)
1360 model.invisibleRootItem()->setDropEnabled(
false);
1373 if (!item1 && !item2)
1375 if (!item1 || !item2)
1377 if (item1->
text() != item2->
text()) {
1390 for (
int col = 0; col < item1->
columnCount(); col++) {
1401 for (
int i = 0;
i <
parent->columnCount();
i++) {
1402 for (
int j = 0;
j <
parent->rowCount();
j++) {
1424 #ifdef QT_BUILD_INTERNAL
1433 struct FriendlyTreeView :
public QTreeView
1440 #ifdef QT_BUILD_INTERNAL
1446 for (
int i = 0;
i < nRow; ++
i) {
1449 for (
int c = 0 ;
c < nCol;
c ++)
1451 model.appendRow(colItems1);
1453 for (
int j = 0;
j < nRow; ++
j) {
1456 for (
int c = 0 ;
c < nCol;
c ++)
1460 for (
int k = 0; k < nRow; ++k) {
1463 for (
int c = 0 ;
c < nCol;
c ++)
1473 void tst_QStandardItemModel::treeDragAndDrop()
1481 populateDragAndDropModel(
model, nRow, nCol);
1482 populateDragAndDropModel(checkModel, nRow, nCol);
1486 FriendlyTreeView
view;
1490 #if QT_CONFIG(draganddrop)
1491 view.setDragDropMode(QAbstractItemView::InternalMove);
1512 view.d_func()->clearOrRemove();
1537 view.d_func()->clearOrRemove();
1563 view.d_func()->clearOrRemove();
1576 void tst_QStandardItemModel::removeRowsAndColumns()
1578 #define VERIFY_MODEL \
1579 for (int c = 0; c < col_list.count(); c++) \
1580 for (int r = 0; r < row_list.count(); r++) \
1581 QCOMPARE(model.item(r,c)->text() , row_list[r] + QLatin1Char('x') + col_list[c]);
1583 QStringList row_list =
QString(
"1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20").split(
',');
1586 for (
int c = 0;
c < col_list.count();
c++)
1587 for (
int r = 0;
r < row_list.count();
r++)
1599 row_list.remove(2, 5);
1603 col_list.remove(1, 6);
1608 QCOMPARE(row_taken.count(), col_list.count());
1609 for (
int c = 0;
c < col_list.count();
c++)
1615 QCOMPARE(col_taken.count(), row_list.count());
1616 for (
int r = 0;
r < row_list.count();
r++)
1618 col_list.remove(10);
1622 void tst_QStandardItemModel::defaultItemRoles()
1628 void tst_QStandardItemModel::itemRoleNames()
1630 QStringList row_list =
QString(
"1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20").split(
',');
1633 for (
int c = 0;
c < col_list.count();
c++)
1634 for (
int r = 0;
r < row_list.count();
r++)
1641 model.setItemRoleNames(newRoleNames);
1646 void tst_QStandardItemModel::getMimeDataWithInvalidModelIndex()
1654 void tst_QStandardItemModel::supportedDragDropActions()
1661 void tst_QStandardItemModel::taskQTBUG_45114_setItemData()
1721 void tst_QStandardItemModel::setItemPersistentIndex()
1726 persistentIndex =
m.index(0, 0);
1730 persistentIndex =
m.index(0, 0);
1738 m.setItem(0, 0,
nullptr);
1742 void tst_QStandardItemModel::signalsOnTakeItem()
1745 m.insertColumns(0, 2);
1747 for (
int i = 0;
i <
m.rowCount(); ++
i) {
1748 for (
int j = 0;
j <
m.columnCount(); ++
j)
1749 m.setData(
m.index(
i,
j),
i +
j);
1752 m.insertColumns(0, 2, parentIndex);
1753 m.insertRows(0, 2, parentIndex);
1754 for (
int i = 0;
i <
m.rowCount(parentIndex); ++
i) {
1755 for (
int j = 0;
j <
m.columnCount(parentIndex); ++
j)
1756 m.setData(
m.index(
i,
j, parentIndex),
i +
j + 100);
1763 QSignalSpy *
const removeSpies[] = {&columnsRemovedSpy, &columnsAboutToBeRemovedSpy, &rowsRemovedSpy, &rowsAboutToBeRemovedSpy};
1766 for (
auto &&
spy : removeSpies) {
1770 QCOMPARE(spyArgs.at(1).toInt(), 0);
1771 QCOMPARE(spyArgs.at(2).toInt(), 1);
1773 QCOMPARE(dataChangedSpy.count(), 1);
1774 const auto dataChangedSpyArgs = dataChangedSpy.takeFirst();
1780 for (
int i = 0;
i < 2; ++
i) {
1781 for (
int j = 0;
j < 2; ++
j)
1789 void tst_QStandardItemModel::createPersistentOnLayoutAboutToBeChanged()
1820 QCOMPARE(layoutAboutToBeChangedSpy.size(), 1);
1821 QCOMPARE(layoutChangedSpy.size(), 1);
1825 #include "tst_qstandarditemmodel.moc"
small capitals from c petite p scientific i
[1]
CustomItem(qreal x, qreal y, qreal width, qreal height, QGraphicsItem *parent=nullptr)
int type() const override
QStandardItem * clone() const override
virtual Qt::DropActions supportedDropActions() const
void columnsRemoved(const QModelIndex &parent, int first, int last, QPrivateSignal)
void rowsAboutToBeInserted(const QModelIndex &parent, int first, int last, QPrivateSignal)
virtual void sort(int column, Qt::SortOrder order=Qt::AscendingOrder)
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)
bool removeRow(int row, const QModelIndex &parent=QModelIndex())
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 >())
virtual bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex())
void columnsAboutToBeRemoved(const QModelIndex &parent, int first, int last, QPrivateSignal)
virtual QMimeData * mimeData(const QModelIndexList &indexes) const
bool removeColumn(int column, const QModelIndex &parent=QModelIndex())
void layoutChanged(const QList< QPersistentModelIndex > &parents=QList< QPersistentModelIndex >(), QAbstractItemModel::LayoutChangeHint hint=QAbstractItemModel::NoLayoutChangeHint)
bool insertColumn(int column, const QModelIndex &parent=QModelIndex())
virtual Q_INVOKABLE bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
void headerDataChanged(Qt::Orientation orientation, int first, int last)
void rowsAboutToBeRemoved(const QModelIndex &parent, int first, int last, QPrivateSignal)
virtual QMap< int, QVariant > itemData(const QModelIndex &index) const
virtual bool insertRows(int row, int count, const QModelIndex &parent=QModelIndex())
virtual bool setItemData(const QModelIndex &index, const QMap< int, QVariant > &roles)
virtual Qt::DropActions supportedDragActions() const
void rowsInserted(const QModelIndex &parent, int first, int last, QPrivateSignal)
void columnsInserted(const QModelIndex &parent, int first, int last, QPrivateSignal)
void rowsRemoved(const QModelIndex &parent, int first, int last, QPrivateSignal)
static const QHash< int, QByteArray > & defaultRoleNames()
The QAbstractItemModelTester class helps testing QAbstractItemModel subclasses.
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
Qt::ItemFlags flags(const QModelIndex &index) const override
The QColor class provides colors based on RGB, HSV or CMYK values.
The QFont class specifies a query for a font used for drawing text.
void setData(int key, const QVariant &value)
void setFlags(GraphicsItemFlags flags)
QVariant data(int key) const
GraphicsItemFlags flags() const
iterator insert(const Key &key, const T &value)
The QIcon class provides scalable icons in different modes and states.
The QItemSelection class manages information about selected items in a model.
Q_CORE_EXPORT void select(const QModelIndex &topLeft, const QModelIndex &bottomRight)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal.
qsizetype size() const noexcept
QList< T > & fill(parameter_type t, qsizetype size=-1)
bool isEmpty() const noexcept
const_reference at(qsizetype i) const noexcept
qsizetype count() const noexcept
void append(parameter_type t)
iterator insert(const Key &key, const T &value)
T value(const Key &key, const T &defaultValue=T()) const
QList< Key > keys() const
bool contains(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.
QVariant data(int role=Qt::DisplayRole) const
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 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)
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
The QPersistentModelIndex class is used to locate data in a data model.
QVariant data(int role=Qt::DisplayRole) const
QPropertyBinding< T > setBinding(const QPropertyBinding< T > &newBinding)
The QSize class defines the size of a two-dimensional object using integer point precision.
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
QHash< int, QByteArray > roleNames() const override
int columnCount(const QModelIndex &parent=QModelIndex()) 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.
QStandardItem * child(int row, int column=0) const
void appendRows(const QList< QStandardItem * > &items)
void insertColumns(int column, int count)
void insertRows(int row, const QList< QStandardItem * > &items)
virtual QVariant data(int role=Qt::UserRole+1) const
QStandardItem * parent() const
void insertColumn(int column, const QList< QStandardItem * > &items)
QList< QStandardItem * > takeRow(int row)
void appendRow(const QList< QStandardItem * > &items)
QStandardItemModel * model() const
void insertRow(int row, const QList< QStandardItem * > &items)
The QStandardItemModel class provides a generic model for storing custom data.\inmodule QtGui.
bool removeColumns(int column, int count, const QModelIndex &parent=QModelIndex()) override
QList< QStandardItem * > takeRow(int row)
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
bool clearItemData(const QModelIndex &index) override
void insertRow(int row, const QList< QStandardItem * > &items)
int columnCount(const QModelIndex &parent=QModelIndex()) const override
QMap< int, QVariant > itemData(const QModelIndex &index) const override
void itemChanged(QStandardItem *item)
void insertColumn(int column, const QList< QStandardItem * > &items)
bool insertRows(int row, int count, const QModelIndex &parent=QModelIndex()) override
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
bool setItemData(const QModelIndex &index, const QMap< int, QVariant > &roles) override
bool insertColumns(int column, int count, const QModelIndex &parent=QModelIndex()) override
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
int rowCount(const QModelIndex &parent=QModelIndex()) const override
bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex()) override
QStandardItem * invisibleRootItem() const
bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role=Qt::EditRole) override
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
The QString class provides a Unicode character string.
const QChar at(qsizetype i) const
static QString number(int, int base=10)
The QStringList class provides a list of strings.
The QTreeView class provides a default model/view implementation of a tree view.
The QVariant class acts like a union for the most common Qt data types.
int toInt(bool *ok=nullptr) const
void checkAboutToBeRemoved()
@ ColumnsAboutToBeRemoved
@ ColumnsAboutToBeInserted
void columnsRemoved(const QModelIndex &parent, int first, int last)
void rowsAboutToBeInserted(const QModelIndex &parent, int first, int last)
void columnsInserted(const QModelIndex &parent, int first, int last)
void rowsInserted(const QModelIndex &parent, int first, int last)
void columnsAboutToBeRemoved(const QModelIndex &parent, int first, int last)
void updateRowAboutToBeRemoved()
void modelChanged(ModelChanged change, const QModelIndex &parent, int first, int last)
void columnsAboutToBeInserted(const QModelIndex &parent, int first, int last)
void rowsRemoved(const QModelIndex &parent, int first, int last)
void rowsAboutToBeRemoved(const QModelIndex &parent, int first, int last)
QSignalSpy spy(myCustomObject, SIGNAL(mySignal(int, QString, double)))
[0]
union Alignment_ Alignment
QColor backgroundColor(const QPalette &pal, const QWidget *widget)
Q_TESTLIB_EXPORT QTestData & newRow(const char *dataTag)
Q_TESTLIB_EXPORT void ignoreMessage(QtMsgType type, const char *message)
@ AccessibleDescriptionRole
auto makePropertyBinding(Functor &&f, const QPropertyBindingSourceLocation &location=QT_PROPERTY_DEFAULT_BINDING_LOCATION, std::enable_if_t< std::is_invocable_v< Functor >> *=nullptr)
QList< QModelIndex > QModelIndexList
QList< QString > QStringList
QList< QVariant > QVariantList
GLint GLint GLint GLint GLint x
[0]
GLenum GLuint GLint level
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLenum GLsizei void * row
#define QStringLiteral(str)
#define QTEST_MAIN(TestObject)
#define QFETCH(Type, name)
#define QVERIFY(statement)
QSqlQueryModel * model
[16]
QItemSelection * selection
[0]
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
QThreadStorage< int * > dummy[8]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent