42 #ifndef QTREEWIDGET_P_H 43 #define QTREEWIDGET_P_H 55 #include <QtCore/qabstractitemmodel.h> 56 #include <private/qabstractitemmodel_p.h> 57 #include <QtCore/qpair.h> 58 #include <QtCore/qbasictimer.h> 59 #include <QtGui/qtreewidget.h> 60 #include <private/qtreeview_p.h> 61 #include <QtGui/qheaderview.h> 63 #ifndef QT_NO_TREEWIDGET 179 #include "private/qabstractitemmodel_p.h" 191 : q(item),
disabled(false), selected(false), rowGuess(-1), policy(
QTreeWidgetItem::DontShowIndicatorWhenChildless) {}
193 void sortChildren(
int column,
Qt::SortOrder order,
bool climb);
210 that->
sort(column, order);
224 {
return treeModel()->index(item, column); }
226 {
return treeModel()->item(index); }
229 void _q_emitItemDoubleClicked(
const QModelIndex &index);
230 void _q_emitItemActivated(
const QModelIndex &index);
233 void _q_emitItemExpanded(
const QModelIndex &index);
234 void _q_emitItemCollapsed(
const QModelIndex &index);
246 #endif // QT_NO_TREEWIDGET 248 #endif // QTREEWIDGET_P_H The QVariant class acts like a union for the most common Qt data types.
bool insertRows(int row, int count, const QModelIndex &)
QModelIndex index(const QTreeWidgetItem *item, int column) const
Returns the model index that refers to the tree view item and column.
bool executePendingSort() const
QTreeModel(int columns=0, QTreeWidget *parent=0)
Constructs a tree model with a parent object and the given number of columns.
#define QT_END_NAMESPACE
This macro expands to.
QVariant headerData(int section, Qt::Orientation orientation, int role) const
Returns the header data corresponding to the given header section, orientation and data role...
QTreeWidgetItem * item(const QModelIndex &index) const
Returns the tree view item corresponding to the index given.
QModelIndex createIndex(int row, int column, void *data=0) const
Creates a model index for the given row and column with the internal pointer ptr. ...
bool isActive() const
Returns true if the timer is running and has not been stopped; otherwise returns false.
#define QT_END_INCLUDE_NAMESPACE
This macro is equivalent to QT_BEGIN_NAMESPACE.
bool hasChildren(const QModelIndex &parent) const
Returns true if parent has any children; otherwise returns false.
QMimeData * mimeData(const QModelIndexList &indexes) const
Returns an object that contains serialized items of data corresponding to the list of indexes specifi...
void itemChanged(QTreeWidgetItem *item)
void clear()
Removes all items in the model.
T * qobject_cast(QObject *object)
QTreeWidgetItem * headerItem
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Returns the data corresponding to the given model index and role.
bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role)
Sets the header data for the item specified by the header section, orientation and data role to the g...
void sort(int column, Qt::SortOrder order)
Sorts the entire tree in the model in the given order, by the values in the given column...
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
void beginInsertItems(QTreeWidgetItem *parent, int row, int count)
QMap< int, QVariant > itemData(const QModelIndex &index) const
Returns a map with values for all predefined roles in the model for the item at the given index...
#define QT_BEGIN_NAMESPACE
This macro expands to.
Qt::DropActions supportedDropActions() const
Returns the drop actions supported by this model.
QList< QTreeWidgetItemIterator * > iterators
static bool itemGreaterThan(const QPair< QTreeWidgetItem *, int > &left, const QPair< QTreeWidgetItem *, int > &right)
Returns true if the value of the left item is greater than the value of the right item...
int rowCount(const QModelIndex &parent) const
Returns the number of rows in the parent model index.
QTreeWidget * view() const
QTreeWidgetItem * rootItem
The QStringList class provides a list of strings.
QMimeData * internalMimeData() const
QModelIndex createIndexFromItem(int row, int col, QTreeWidgetItem *item) const
QStringList mimeTypes() const
Returns a list of MIME types that can be used to describe a list of model indexes.
int columnCount(const QModelIndex &parent=QModelIndex()) const
Returns the number of columns in the item referred to by the given index.
const QTreeModel *const model
The QMimeData class provides a container for data that records information about its MIME type...
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
Handles the data supplied by a drag and drop operation that ended with the given action.
The QAbstractItemModel class provides the abstract interface for item model classes.
void stop()
Stops the timer.
The QList::iterator class provides an STL-style non-const iterator for QList and QQueue.
QModelIndexList cachedIndexes
#define Q_DECLARE_PUBLIC(Class)
The QItemSelection class manages information about selected items in a model.
The QTimerEvent class contains parameters that describe a timer event.
static QList< QTreeWidgetItem * >::iterator sortedInsertionIterator(const QList< QTreeWidgetItem *>::iterator &begin, const QList< QTreeWidgetItem *>::iterator &end, Qt::SortOrder order, QTreeWidgetItem *item)
QObject * parent() const
Returns a pointer to the parent object.
QHeaderView * header() const
Returns the header for the tree view.
The QModelIndex class is used to locate data in a data model.
bool setData(const QModelIndex &index, const QVariant &value, int role)
Sets the data for the item specified by the index and role to that referred to by the value...
void beginRemoveItems(QTreeWidgetItem *parent, int row, int count)
#define QT_BEGIN_INCLUDE_NAMESPACE
This macro is equivalent to QT_END_NAMESPACE.
QBasicTimer sortPendingTimer
The QBasicTimer class provides timer events for objects.
#define Q_DECLARE_PRIVATE(Class)
bool insertColumns(int column, int count, const QModelIndex &)
void setColumnCount(int columns)
Sets the number of columns in the tree model.
void timerEvent(QTimerEvent *)
This event handler can be reimplemented in a subclass to receive timer events for the object...
static const KeyPair *const end
static bool itemLessThan(const QPair< QTreeWidgetItem *, int > &left, const QPair< QTreeWidgetItem *, int > &right)
Returns true if the value of the left item is less than the value of the right item.
Qt::ItemFlags flags(const QModelIndex &index) const
Returns the flags for the item referred to the given index.
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex())
~QTreeModel()
Destroys this tree model.
The QMap class is a template class that provides a skip-list-based dictionary.
SkipSorting(const QTreeModel *m)
void ensureSorted(int column, Qt::SortOrder order, int start, int end, const QModelIndex &parent)
void emitDataChanged(QTreeWidgetItem *item, int column)
Emits the dataChanged() signal for the given item.
void sortItems(QList< QTreeWidgetItem *> *items, int column, Qt::SortOrder order)