5#include <QtCore/qstack.h>
6#include <QtCore/qdebug.h>
13#if defined(QQMLTREEMODELADAPTOR_DEBUG) && !defined(QT_TESTLIB_LIB)
14# define ASSERT_CONSISTENCY() Q_ASSERT_X(testConsistency(true ), Q_FUNC_INFO, "Consistency test failed")
16# define ASSERT_CONSISTENCY qt_noop
29void QQmlTreeModelToTableModel::connectToModel()
33 this, &QQmlTreeModelToTableModel::modelHasBeenDestroyed),
35 this, &QQmlTreeModelToTableModel::modelHasBeenReset),
37 this, &QQmlTreeModelToTableModel::modelDataChanged),
40 this, &QQmlTreeModelToTableModel::modelLayoutAboutToBeChanged),
42 this, &QQmlTreeModelToTableModel::modelLayoutChanged),
45 this, &QQmlTreeModelToTableModel::modelRowsAboutToBeInserted),
47 this, &QQmlTreeModelToTableModel::modelRowsInserted),
49 this, &QQmlTreeModelToTableModel::modelRowsAboutToBeRemoved),
51 this, &QQmlTreeModelToTableModel::modelRowsRemoved),
53 this, &QQmlTreeModelToTableModel::modelRowsAboutToBeMoved),
55 this, &QQmlTreeModelToTableModel::modelRowsMoved),
58 this, &QQmlTreeModelToTableModel::modelColumnsAboutToBeInserted),
60 this, &QQmlTreeModelToTableModel::modelColumnsAboutToBeRemoved),
62 this, &QQmlTreeModelToTableModel::modelColumnsInserted),
64 this, &QQmlTreeModelToTableModel::modelColumnsRemoved)
72 for (
const auto &
c : m_connections)
74 m_connections.fill({});
80 if (m_rootIndex.
isValid() && m_rootIndex.
model() != m_model)
96 m_expandedItems.
clear();
107 if (m_rootIndex == idx)
137 return QHash<int, QByteArray>();
145 return m_items.
size();
173 return m_model->
headerData(section, orientation, role);
183 if (row < 0 || row >= m_items.
size())
185 return m_items.
at(
row).depth;
194 const int totalCount = m_items.
size();
197 int localCount =
qMin(m_lastItemIndex - 1, totalCount - m_lastItemIndex);
199 for (
int i = 0;
i < localCount; ++
i) {
200 const TreeItem &item1 = m_items.
at(m_lastItemIndex +
i);
201 if (item1.index ==
index) {
202 m_lastItemIndex = m_lastItemIndex +
i;
203 return m_lastItemIndex;
205 const TreeItem &item2 = m_items.
at(m_lastItemIndex -
i - 1);
206 if (item2.index ==
index) {
207 m_lastItemIndex = m_lastItemIndex -
i - 1;
208 return m_lastItemIndex;
212 for (
int j =
qMax(0, m_lastItemIndex + localCount);
j < totalCount; ++
j) {
213 const TreeItem &
item = m_items.
at(
j);
220 for (
int j =
qMin(totalCount, m_lastItemIndex - localCount) - 1;
j >= 0; --
j) {
221 const TreeItem &
item = m_items.
at(
j);
245 if (!
index.isValid())
249 if (row < 0 || row > m_items.
size() - 1)
253 return m_model->
index(sourceIndex.row(),
index.column(), sourceIndex.parent());
258 if (!
index.isValid())
262 for (
int i = 0;
i < m_items.
size(); ++
i) {
264 if (proxyIndex.row() ==
index.row() && proxyIndex.parent() ==
index.parent()) {
278 if (row < 0 || row >= m_items.
size())
280 return m_items.
at(
row).index;
297 typedef QPair<QModelIndex, QModelIndex> MIPair;
298 typedef QHash<QModelIndex, MIPair> MI2MIPairHash;
299 MI2MIPairHash ranges;
303 bool selectLastRow =
false;
304 for (
int i = from + 1;
i <= to || (selectLastRow =
true);
i++) {
310 if (!selectLastRow) {
314 if (selectLastRow || previousParent !=
parent) {
315 const MI2MIPairHash::iterator &
it = ranges.find(previousParent);
316 if (
it == ranges.end())
317 ranges.insert(previousParent, MIPair(firstIndex, lastIndex));
319 it->second = lastIndex;
332 for (
const MIPair &pair : std::as_const(ranges))
345 const long topLevelRowCount = m_model->
rowCount(m_rootIndex);
346 if (topLevelRowCount == 0)
355 int rowIdx = parentIndex.
isValid() && parentIndex != m_rootIndex ?
itemIndex(parentIndex) + 1 : 0;
356 Q_ASSERT(rowIdx == 0 || parentItem.expanded);
357 if (parentIndex.
isValid() && parentIndex != m_rootIndex && (rowIdx == 0 || !parentItem.expanded))
360 if (m_model->
rowCount(parentIndex) == 0) {
374 if (nextSiblingIdx.isValid()) {
382 int rowDepth = rowIdx == 0 ? 0 : parentItem.depth + 1;
387 for (
int i = 0;
i < insertCount;
i++) {
390 const TreeItem treeItem(cmi, rowDepth,
expanded);
391 m_items.
insert(startIdx +
i, treeItem);
394 m_itemsToExpand.
append(treeItem);
400 if (doExpandPendingRows)
422 m_expandedItems.
insert(idx);
445 m_expandedItems.
remove(idx);
463 if (row < 0 || row >= m_items.
size())
465 return m_items.
at(
row).expanded;
470 if (row < 0 || row >= m_items.
size())
486 TreeItem &
item = m_items[
n];
489 item.expanded =
true;
503 auto expandHelp = [
this,
depth, startDepth] (
const auto expandHelp,
const QModelIndex &
index) ->
void {
512 for (
int childRow = 0; childRow < childCount; ++childRow) {
515 expandHelp(expandHelp, childIndex);
521 expandHelp(expandHelp,
index);
526 while (!m_itemsToExpand.
isEmpty()) {
531 if (childrenCount == 0) {
546 auto collapseHelp = [
this] (
const auto collapseHelp,
const QModelIndex &
index) ->
void {
549 if (rowToCollapse != -1)
556 for (
int childRow = 0; childRow < childCount; ++childRow) {
559 collapseHelp(collapseHelp, childIndex);
565 collapseHelp(collapseHelp,
index);
573 SignalFreezer aggregator(
this);
575 TreeItem &
item = m_items[
n];
576 item.expanded =
false;
579 queueDataChanged(
index(
n, m_column),
index(
n, m_column), changedRole);
603 if (nextSiblingIndex.isValid())
609 return firstIndex - 1;
614 if (startIndex < 0 || endIndex < 0 || startIndex > endIndex)
619 m_items.
erase(m_items.
begin() + startIndex, m_items.
begin() + endIndex + 1);
624 int lastIndex = m_items.
size() - 1;
625 if (startIndex <= lastIndex) {
629 queueDataChanged(topLeft, bottomRight, changedRole);
634void QQmlTreeModelToTableModel::modelHasBeenDestroyed()
641void QQmlTreeModelToTableModel::modelHasBeenReset()
649void QQmlTreeModelToTableModel::modelDataChanged(
const QModelIndex &topLeft,
const QModelIndex &bottomRight,
const QVector<int> &roles)
661 for (
int i = topLeft.
row();
i <= bottomRight.
row();
i++) {
663 int bottomIndex = topIndex;
664 while (bottomIndex < m_items.
size()) {
670 if (idx.
row() == bottomRight.
row())
676 i += bottomIndex - topIndex;
677 if (
i == bottomRight.
row())
679 topIndex = bottomIndex + 1;
680 while (topIndex < m_items.
size()
681 && m_items.
at(topIndex).index.parent() !=
parent)
700 m_modelLayoutChanged =
false;
702 if (parents.isEmpty() || !parents[0].isValid()) {
705 m_modelLayoutChanged =
true;
720 if (!m_modelLayoutChanged) {
722 m_modelLayoutChanged =
true;
737 if (!m_modelLayoutChanged) {
774void QQmlTreeModelToTableModel::modelRowsAboutToBeInserted(
const QModelIndex & parent,
int start,
int end)
782void QQmlTreeModelToTableModel::modelRowsInserted(
const QModelIndex & parent,
int start,
int end)
786 if (parentRow >= 0) {
789 queueDataChanged(parentIndex, parentIndex, changedRole);
790 item = m_items.
at(parentRow);
791 if (!
item.expanded) {
795 }
else if (
parent == m_rootIndex) {
805void QQmlTreeModelToTableModel::modelRowsAboutToBeRemoved(
const QModelIndex & parent,
int start,
int end)
808 enableSignalAggregation();
829 m_expandedItems.
remove(cmi);
833void QQmlTreeModelToTableModel::modelRowsRemoved(
const QModelIndex & parent,
int start,
int end)
838 if (parentRow >= 0) {
841 queueDataChanged(parentIndex, parentIndex, changedRole);
843 disableSignalAggregation();
847void QQmlTreeModelToTableModel::modelRowsAboutToBeMoved(
const QModelIndex & sourceParent,
int sourceStart,
int sourceEnd,
const QModelIndex & destinationParent,
int destinationRow)
850 enableSignalAggregation();
851 m_visibleRowsMoved =
false;
856 modelRowsAboutToBeRemoved(sourceParent, sourceStart, sourceEnd);
863 queueDataChanged(topLeft, bottomRight, changedRole);
866 int depthDifference = -1;
869 depthDifference = m_items.
at(destParentIndex).depth;
871 if (sourceParent.isValid()) {
872 int sourceParentIndex =
itemIndex(sourceParent);
873 depthDifference -= m_items.
at(sourceParentIndex).depth;
878 int startIndex =
itemIndex(m_model->
index(sourceStart, 0, sourceParent));
897 int totalMovedCount = endIndex - startIndex + 1;
901 m_visibleRowsMoved = startIndex != destIndex &&
904 const QList<TreeItem> &
buffer = m_items.
mid(startIndex, totalMovedCount);
905 int bufferCopyOffset;
906 if (destIndex > endIndex) {
907 for (
int i = endIndex + 1;
i < destIndex;
i++) {
910 bufferCopyOffset = destIndex - totalMovedCount;
913 for (
int i = startIndex - 1;
i >= destIndex;
i--) {
916 bufferCopyOffset = destIndex;
918 for (
int i = 0;
i <
buffer.size();
i++) {
920 item.depth += depthDifference;
934 const int top =
qMin(startIndex, bufferCopyOffset);
935 int bottom =
qMax(endIndex, bufferCopyOffset + totalMovedCount - 1);
947 queueDataChanged(topLeft, bottomRight, changedRole);
949 if (depthDifference != 0) {
952 const QVector<int> changedRole(1,
DepthRole);
953 queueDataChanged(topLeft, bottomRight, changedRole);
958void QQmlTreeModelToTableModel::modelRowsMoved(
const QModelIndex & sourceParent,
int sourceStart,
int sourceEnd,
const QModelIndex & destinationParent,
int destinationRow)
961 modelRowsInserted(
destinationParent, destinationRow, destinationRow + sourceEnd - sourceStart);
963 modelRowsRemoved(sourceParent, sourceStart, sourceEnd);
966 if (m_visibleRowsMoved)
975 queueDataChanged(topLeft, bottomRight, changedRole);
978 disableSignalAggregation();
983void QQmlTreeModelToTableModel::modelColumnsAboutToBeInserted(
const QModelIndex & parent,
int start,
int end)
989void QQmlTreeModelToTableModel::modelColumnsAboutToBeRemoved(
const QModelIndex & parent,
int start,
int end)
995void QQmlTreeModelToTableModel::modelColumnsInserted(
const QModelIndex & parent,
int start,
int end)
1006void QQmlTreeModelToTableModel::modelColumnsRemoved(
const QModelIndex & parent,
int start,
int end)
1024 int countWidth = floor(log10(
double(
count))) + 1;
1025 qInfo() <<
"Dumping" <<
this;
1027 const TreeItem &
item = m_items.
at(
i);
1030 qInfo().noquote().nospace()
1041 qWarning() <<
"Model inconsistency: No model but stored visible items";
1044 if (!m_expandedItems.
isEmpty()) {
1045 qWarning() <<
"Model inconsistency: No model but stored expanded items";
1051 QStack<QModelIndex> ancestors;
1053 for (
int i = 0;
i < m_items.
size();
i++) {
1054 bool isConsistent =
true;
1055 const TreeItem &
item = m_items.
at(
i);
1056 if (
item.index != idx) {
1057 qWarning() <<
"QModelIndex inconsistency" <<
i <<
item.index;
1059 isConsistent =
false;
1063 qWarning() <<
" stored index parent" <<
item.index.parent() <<
"model parent" <<
parent;
1064 isConsistent =
false;
1066 if (
item.depth != ancestors.size()) {
1068 qWarning() <<
" item depth" <<
item.depth <<
"ancestors stack" << ancestors.size();
1069 isConsistent =
false;
1074 isConsistent =
false;
1076 if (!isConsistent) {
1083 firstChildIndex = m_model->
index(0, 0, idx);
1084 if (firstChildIndex.
isValid()) {
1090 if (ancestors.isEmpty())
1093 parent = ancestors.pop();
1102void QQmlTreeModelToTableModel::enableSignalAggregation() {
1103 m_signalAggregatorStack++;
1106void QQmlTreeModelToTableModel::disableSignalAggregation() {
1107 m_signalAggregatorStack--;
1108 Q_ASSERT(m_signalAggregatorStack >= 0);
1109 if (m_signalAggregatorStack == 0) {
1110 emitQueuedSignals();
1114void QQmlTreeModelToTableModel::queueDataChanged(
const QModelIndex &topLeft,
1116 const QVector<int> &roles)
1118 if (isAggregatingSignals()) {
1119 m_queuedDataChanged.append(DataChangedParams { topLeft, bottomRight, roles });
1125void QQmlTreeModelToTableModel::emitQueuedSignals()
1127 QVector<DataChangedParams> combinedUpdates;
1133 for (
const DataChangedParams &dataChange :
std::as_const(m_queuedDataChanged)) {
1134 int startRow = dataChange.topLeft.row();
1135 int endRow = dataChange.bottomRight.row();
1136 bool merged =
false;
1137 for (DataChangedParams &combined : combinedUpdates) {
1138 int combinedStartRow = combined.topLeft.row();
1139 int combinedEndRow = combined.bottomRight.row();
1140 if ((startRow <= combinedStartRow && endRow >= combinedStartRow) ||
1141 (startRow <= combinedEndRow && endRow >= combinedEndRow)) {
1142 if (startRow < combinedStartRow) {
1143 combined.topLeft = dataChange.topLeft;
1145 if (endRow > combinedEndRow) {
1146 combined.bottomRight = dataChange.bottomRight;
1148 for (
int role : dataChange.roles) {
1149 if (!combined.roles.contains(role))
1150 combined.roles.append(role);
1157 combinedUpdates.append(dataChange);
1162 for (
const DataChangedParams &dataChange : combinedUpdates) {
1163 emit dataChanged(dataChange.topLeft, dataChange.bottomRight, dataChange.roles);
1165 m_queuedDataChanged.clear();
1170#include "moc_qqmltreemodeltotablemodel_p_p.cpp"
void rowsMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow, QPrivateSignal)
Q_INVOKABLE int const QModelIndex & parent
Returns the parent of the model item with the given index.
void endResetModel()
Completes a model reset operation.
bool beginMoveRows(const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationRow)
void columnsRemoved(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted after columns have been removed from the model.
LayoutChangeHint
This enum describes the way the model changes layout.
void rowsAboutToBeInserted(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted just before rows are inserted into the model.
virtual Q_INVOKABLE QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Returns the data for the given role and section in the header with the specified orientation.
void columnsAboutToBeInserted(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted just before columns are inserted into the model.
Q_INVOKABLE bool hasIndex(int row, int column, const QModelIndex &parent=QModelIndex()) const
Returns {true} if the model returns a valid QModelIndex for row and column with parent,...
virtual Q_INVOKABLE Qt::ItemFlags flags(const QModelIndex &index) const
Returns the item flags for the given index.
void modelReset(QPrivateSignal)
void endRemoveRows()
Ends a row removal operation.
void endMoveRows()
Ends a row move operation.
void beginRemoveColumns(const QModelIndex &parent, int first, int last)
Begins a column removal operation.
Q_INVOKABLE int int const QModelIndex & destinationParent
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 >())
This signal is emitted whenever the data in an existing item changes.
virtual Q_INVOKABLE bool hasChildren(const QModelIndex &parent=QModelIndex()) const
Returns {true} if parent has any children; otherwise returns {false}.
virtual Q_INVOKABLE int rowCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of rows under the given parent.
virtual Q_INVOKABLE void fetchMore(const QModelIndex &parent)
Fetches any available data for the items with the parent specified by the parent index.
void columnsAboutToBeRemoved(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted just before columns are removed from the model.
void layoutChanged(const QList< QPersistentModelIndex > &parents=QList< QPersistentModelIndex >(), QAbstractItemModel::LayoutChangeHint hint=QAbstractItemModel::NoLayoutChangeHint)
virtual Q_INVOKABLE bool canFetchMore(const QModelIndex &parent) const
Returns {true} if there is more data available for parent; otherwise returns {false}.
virtual Q_INVOKABLE bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
Sets the role data for the item at index to value.
void rowsAboutToBeRemoved(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted just before rows are removed from the model.
virtual QHash< int, QByteArray > roleNames() const
void beginInsertColumns(const QModelIndex &parent, int first, int last)
Begins a column insertion operation.
void endInsertRows()
Ends a row insertion operation.
void beginResetModel()
Begins a model reset operation.
void endRemoveColumns()
Ends a column removal operation.
void rowsAboutToBeMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow, QPrivateSignal)
virtual Q_INVOKABLE int columnCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of columns for the children of the given parent.
void rowsInserted(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted after rows have been inserted into the model.
QModelIndex createIndex(int row, int column, const void *data=nullptr) const
Creates a model index for the given row and column with the internal pointer ptr.
void endInsertColumns()
Ends a column insertion operation.
void columnsInserted(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted after columns have been inserted into the model.
virtual Q_INVOKABLE QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const =0
Returns the data stored under the given role for the item referred to by the index.
void beginRemoveRows(const QModelIndex &parent, int first, int last)
Begins a row removal operation.
virtual Q_INVOKABLE QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const =0
Returns the index of the item in the model specified by the given row, column and parent index.
void beginInsertRows(const QModelIndex &parent, int first, int last)
Begins a row insertion operation.
void rowsRemoved(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted after rows have been removed from the model.
GraphicsItemFlags flags() const
Returns this item's flags.
qsizetype size() const noexcept
bool isEmpty() const noexcept
iterator erase(const_iterator begin, const_iterator end)
iterator insert(qsizetype i, parameter_type t)
void swapItemsAt(qsizetype i, qsizetype j)
const_reference at(qsizetype i) const noexcept
QList< T > mid(qsizetype pos, qsizetype len=-1) const
void reserve(qsizetype size)
void replace(qsizetype i, parameter_type t)
void append(parameter_type t)
QModelIndex siblingAtColumn(int column) const
Returns the sibling at column for the current row.
constexpr int row() const noexcept
Returns the row this model index refers to.
QModelIndex parent() const
Returns the parent of the model index, or QModelIndex() if it has no parent.
constexpr const QAbstractItemModel * model() const noexcept
Returns a pointer to the model containing the item that this index refers to.
constexpr int column() const noexcept
Returns the column this model index refers to.
constexpr bool isValid() const noexcept
Returns {true} if this model index is valid; otherwise returns {false}.
QModelIndex sibling(int row, int column) const
Returns the sibling at row and column.
const QObjectList & children() const
Returns a list of child objects.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
\threadsafe
void destroyed(QObject *=nullptr)
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointe...
const QAbstractItemModel * model() const
Returns the model that the index belongs to.
bool isValid() const
Returns {true} if this persistent model index is valid; otherwise returns {false}.
void modelChanged(QAbstractItemModel *model)
bool hasChildren(int row) const
bool childrenVisible(const QModelIndex &index)
void removeVisibleRows(int startIndex, int endIndex, bool doRemoveRows=true)
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
Returns the data for the given role and section in the header with the specified orientation.
QHash< int, QByteArray > roleNames() const override
void setRootIndex(const QModelIndex &idx)
bool isExpanded(const QModelIndex &) const
QModelIndex mapToModel(const QModelIndex &index) const
Qt::ItemFlags flags(const QModelIndex &index) const override
Returns the item flags for the given index.
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
Returns the index of the item in the model specified by the given row, column and parent index.
void expandPendingRows(bool doInsertRows=true)
bool isVisible(const QModelIndex &index)
void showModelChildItems(const TreeItem &parent, int start, int end, bool doInsertRows=true, bool doExpandPendingRows=true)
Q_INVOKABLE QItemSelection selectionForRowRange(const QModelIndex &fromIndex, const QModelIndex &toIndex) const
bool setData(const QModelIndex &index, const QVariant &value, int role) override
Sets the role data for the item at index to value.
QAbstractItemModel * model
QModelIndex mapFromModel(const QModelIndex &index) const
bool testConsistency(bool dumpOnFail=false) const
QVariant data(const QModelIndex &, int role) const override
Returns the data stored under the given role for the item referred to by the index.
int lastChildIndex(const QModelIndex &index) const
void showModelTopLevelItems(bool doInsertRows=true)
int itemIndex(const QModelIndex &index) const
void collapse(const QModelIndex &)
bool hasSiblings(int row) const
void collapseRecursively(int row)
void expandRecursively(int row, int depth)
void setModel(QAbstractItemModel *model)
void collapsed(const QModelIndex &index)
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of columns for the children of the given parent.
int depthAtRow(int row) const
void expand(const QModelIndex &)
void expanded(const QModelIndex &index)
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of rows under the given parent.
QQmlTreeModelToTableModel(QObject *parent=nullptr)
bool remove(const T &value)
bool contains(const T &value) const
iterator insert(const T &value)
\macro QT_RESTRICTED_CAST_FROM_ASCII
QSet< QString >::iterator it
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
GLint GLenum GLsizei GLsizei GLsizei depth
GLdouble GLdouble GLdouble GLdouble top
GLenum GLenum GLsizei count
GLenum GLenum GLsizei void GLsizei void * column
GLenum GLenum GLsizei void * row
#define ASSERT_CONSISTENCY
QLatin1StringView QLatin1String
#define QStringLiteral(str)
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
QT_BEGIN_NAMESPACE constexpr void qSwap(T &value1, T &value2) noexcept(std::is_nothrow_swappable_v< T >)
static uint toIndex(ExecutionEngine *e, const Value &v)