17#include <QtWidgets/private/qtwidgetsglobal_p.h>
18#include <QtCore/qabstractitemmodel.h>
19#include <private/qabstractitemmodel_p.h>
20#include <QtCore/qpair.h>
21#include <QtCore/qbasictimer.h>
22#include <QtWidgets/qtreewidget.h>
23#include <private/qtreeview_p.h>
24#include <QtWidgets/qheaderview.h>
122 mutable bool skipPendingSort =
false;
123 bool inline executePendingSort()
const;
125 bool isChanging()
const;
142#include "private/qabstractitemmodel_p.h"
170inline bool QTreeModel::executePendingSort()
const
172 if (!skipPendingSort && sortPendingTimer.
isActive() && !isChanging()) {
173 sortPendingTimer.
stop();
Q_INVOKABLE int const QModelIndex & parent
Returns the parent of the model item with the given index.
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.
QAbstractItemModel * model
void stop()
Stops the timer.
bool isActive() const noexcept
Returns true if the timer is running and has not been stopped; otherwise returns false.
QObject * parent() const
Returns a pointer to the parent object.
void executePendingOperations() const override
see QTBUG-94546
bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role) override
void ensureSorted(int column, Qt::SortOrder order, int start, int end, const QModelIndex &parent)
int rowCount(const QModelIndex &parent) const override
bool setData(const QModelIndex &index, const QVariant &value, int role) override
bool insertColumns(int column, int count, const QModelIndex &) override
QTreeWidget * view() const
void emitDataChanged(QTreeWidgetItem *item, int column, const QList< int > &roles)
bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex()) override
void itemChanged(QTreeWidgetItem *item)
void setColumnCount(int columns)
bool insertRows(int row, int count, const QModelIndex &) override
void sortItems(QList< QTreeWidgetItem * > *items, int column, Qt::SortOrder order)
QMimeData * internalMimeData() const
QTreeWidgetItem * item(const QModelIndex &index) const
Qt::DropActions supportedDropActions() const override
int columnCount(const QModelIndex &parent=QModelIndex()) const override
void sort(int column, Qt::SortOrder order) override
static bool itemLessThan(const QPair< QTreeWidgetItem *, int > &left, const QPair< QTreeWidgetItem *, int > &right)
QModelIndex createIndexFromItem(int row, int col, QTreeWidgetItem *item) const
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
bool clearItemData(const QModelIndex &index) override
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
Handles the data supplied by a drag and drop operation that ended with the given action.
static QList< QTreeWidgetItem * >::iterator sortedInsertionIterator(const QList< QTreeWidgetItem * >::iterator &begin, const QList< QTreeWidgetItem * >::iterator &end, Qt::SortOrder order, QTreeWidgetItem *item)
QStringList mimeTypes() const override
Returns the list of allowed MIME types.
QMap< int, QVariant > itemData(const QModelIndex &index) const override
Returns a map with values for all predefined roles in the model for the item at the given index.
QModelIndex index(const QTreeWidgetItem *item, int column) const
bool hasChildren(const QModelIndex &parent) const override
Returns {true} if parent has any children; otherwise returns {false}.
void timerEvent(QTimerEvent *) override
This event handler can be reimplemented in a subclass to receive timer events for the object.
friend class QTreeWidgetItemIteratorPrivate
void beginRemoveItems(QTreeWidgetItem *parent, int row, int count)
void beginInsertItems(QTreeWidgetItem *parent, int row, int count)
static bool itemGreaterThan(const QPair< QTreeWidgetItem *, int > &left, const QPair< QTreeWidgetItem *, int > &right)
QHeaderView * header() const
Returns the header for the tree view.
Combined button and popup list for selecting options.
std::pair< T1, T2 > QPair
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLenum GLsizei void GLsizei void * column
GLdouble GLdouble GLdouble GLdouble q
GLenum GLenum GLsizei void * row
GLfixed GLfixed GLint GLint order
const QQuickItem * rootItem(const I &item)
QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator begin(const QRegularExpressionMatchIterator &iterator)
#define QT_BEGIN_INCLUDE_NAMESPACE
#define QT_END_INCLUDE_NAMESPACE
#define QT_REQUIRE_CONFIG(feature)
SkipSorting(const QTreeModel *m)
const QTreeModel *const model