44 #ifndef QT_NO_TREEWIDGET 50 #include <private/qtreewidget_p.h> 51 #include <private/qwidgetitemdata_p.h> 52 #include <private/qtreewidgetitemiterator_p.h> 207 if (count == columns)
210 if (columns < count) {
217 for (
int i = count; i < columns; ++i) {
292 if (row < 0 || column < 0 || column >= c)
296 if (parentItem && row < parentItem->childCount()) {
328 return index(parent, 0);
441 int column = index.
column();
442 if (column < itm->
values.count()) {
468 if (count < 1 || row < 0 || row >
rowCount(parent) || parent.
column() > 0)
500 column =
qBound(0, column, oldCount);
502 for (
int i = oldCount; i < oldCount + count; ++i) {
512 for (
int row = 0; row < children.
count(); ++row) {
515 itemstack.
push(child);
529 if (count < 1 || row < 0 || (row + count) >
rowCount(parent))
538 for (
int i = row + count - 1; i >= row; --i) {
590 if (section < 0 || orientation != Qt::Horizontal || !headerItem || section >=
columnCount())
659 int count = end - start + 1;
661 for (
int i = 0; i < count; ++i) {
662 sorting[i].
first = lst.
at(start + i);
663 sorting[i].second = start + i;
672 bool changed =
false;
674 for (
int i = 0; i < count; ++i) {
675 int oldRow = sorting.
at(i).second;
680 if ((newRow < oldRow) && !(*item < *lst.
at(oldRow - 1)) && !(*lst.
at(oldRow - 1) < *
item ))
683 lit = lst.
insert(lit, item);
684 if (newRow != oldRow) {
690 newPersistentIndexes = oldPersistentIndexes;
692 for (
int j = i + 1; j < count; ++j) {
693 int otherRow = sorting.
at(j).second;
694 if (oldRow < otherRow && newRow >= otherRow)
696 else if (oldRow > otherRow && newRow <= otherRow)
699 for (
int k = 0; k < newPersistentIndexes.
count(); ++k) {
703 int oldPersistentRow = pi.
row();
704 int newPersistentRow = oldPersistentRow;
705 if (oldPersistentRow == oldRow)
706 newPersistentRow =
newRow;
707 else if (oldRow < oldPersistentRow && newRow >= oldPersistentRow)
708 newPersistentRow = oldPersistentRow - 1;
709 else if (oldRow > oldPersistentRow && newRow <= oldPersistentRow)
710 newPersistentRow = oldPersistentRow + 1;
711 if (newPersistentRow != oldPersistentRow)
712 newPersistentIndexes[k] =
createIndex(newPersistentRow,
787 for (
int i = 0; i < indexes.
count(); ++i) {
789 items <<
item(indexes.
at(i));
803 if (row == -1 && column == -1)
824 return !
d->changes.isEmpty();
853 topLeft =
index(item, 0);
856 topLeft =
index(item, column);
857 bottomRight = topLeft;
882 for (
int j = 0; j < count; j++) {
884 iterators[i]->d_func()->ensureValidIterator(c);
903 for (
int i = 0; i < sorting.count(); ++i) {
904 sorting[i].
first = items->
at(i);
905 sorting[i].second = i;
915 for (
int r = 0; r < sorting.count(); ++r) {
916 int oldRow = sorting.at(r).second;
921 for (
int c = 0;
c < colCount; ++
c) {
923 if (static_cast<QAbstractItemModelPrivate *>(
d_ptr.
data())->persistent.indexes.contains(from)) {
1516 for (
int i = 0; i < strings.
count(); ++i)
1537 if (view && view->
model()) {
1562 for (
int i = 0; i < strings.
count(); ++i)
1564 if (view && view->
model()) {
1628 for (
int i = 0; i < strings.
count(); ++i)
1667 bool wasSkipSort =
false;
1725 parentStack.
push(0);
1733 parent = parentStack.
pop();
1746 for (
int i = 0; i < item->
childCount(); ++i) {
1748 parentStack.
push(copy);
1799 const bool changedExplicit =
d->
disabled != !enable;
1808 if (changedState && changedExplicit) {
1816 parents.
push(child);
1839 Qt::ItemFlags oldFlags = parent->
itemFlags;
1850 parents.
push(child);
1900 }
else if (
d->
display[column] != value) {
1913 child->
setData(column, role, value);
1923 for (
int i = 0; i < column_values.
count(); ++i) {
1924 if (column_values.
at(i).
role == role) {
1925 if (column_values.
at(i).
value == value)
1961 if (column >= 0 && column < d->
display.count())
1972 for (
int i = 0; i < column_values.
count(); ++i)
1973 if (column_values.
at(i).
role == role)
1974 return column_values.
at(i).
value;
1993 #ifndef QT_NO_DATASTREAM 2007 for (
int column = 0; column < values.count(); ++column) {
2009 for (
int i = 0; i < values.at(column).count(); ++i) {
2012 values[column].remove(i--);
2030 #endif // QT_NO_DATASTREAM 2090 if (index < 0 || index >
children.
count() || child == 0 || child->
view != 0 || child->
par != 0)
2094 const bool wasSkipSort = model->skipPendingSort;
2095 model->skipPendingSort =
true;
2096 if (model->rootItem ==
this)
2102 if (!model->sortPendingTimer.isActive())
2103 model->sortPendingTimer.start(0, model);
2105 model->beginInsertItems(
this, index, 1);
2117 model->endInsertItems();
2118 model->skipPendingSort = wasSkipSort;
2199 for (
int n = 0; n < children.
count(); ++n)
2206 for (
int n = 0; n < children.
count(); ++n) {
2208 if (child->
view || child->
par)
2210 itemsToInsert.
append(child);
2211 if (
view && model) {
2217 if (model && (model->
rootItem ==
this))
2222 if (!itemsToInsert.
isEmpty()) {
2230 for (
int n = 0; n < itemsToInsert.
count(); ++n) {
2232 this->children.
insert(index + n, child);
2287 model->
sortItems(&q->children, column, order);
2290 for (; it != q->children.end(); ++
it) {
2293 (*it)->d->sortChildren(column, order, climb);
2316 int oldSortColumn =
view->d_func()->explicitSortColumn;
2317 view->d_func()->explicitSortColumn = column;
2321 view->d_func()->explicitSortColumn = oldSortColumn;
2339 bool checkedChildren =
false;
2340 bool uncheckedChildren =
false;
2346 switch (static_cast<Qt::CheckState>(value.
toInt()))
2349 uncheckedChildren =
true;
2352 checkedChildren =
true;
2360 if (uncheckedChildren && checkedChildren)
2362 if (uncheckedChildren)
2364 else if (checkedChildren)
2396 model->itemChanged(
this);
2405 model->executePendingSort();
2409 #ifndef QT_NO_DATASTREAM 2445 #endif // QT_NO_DATASTREAM 2451 emit q->itemPressed(item(index), index.
column());
2457 emit q->itemClicked(item(index), index.
column());
2463 emit q->itemDoubleClicked(item(index), index.
column());
2469 emit q->itemActivated(item(index), index.
column());
2475 emit q->itemEntered(item(index), index.
column());
2483 emit q->itemChanged(indexItem, index.
column());
2489 emit q->itemExpanded(item(index));
2495 emit q->itemCollapsed(item(index));
2504 emit q->currentItemChanged(currentItem, previousItem);
2509 if (sortingEnabled) {
2510 int column = header->sortIndicatorSection();
2512 treeModel()->sort(column, order);
2522 for (i = 0; i < indices.
count(); ++i) {
2527 indices = deselected.
indexes();
2528 for (i = 0; i < indices.
count(); ++i) {
2533 emit q->itemSelectionChanged();
2540 && !treeModel()->sortPendingTimer.isActive()) {
2541 int column = header->sortIndicatorSection();
2542 if (column >= topLeft.
column() && column <= bottomRight.
column()) {
2544 treeModel()->ensureSorted(column, order, topLeft.
row(),
2758 this,
SLOT(_q_sort()));
2781 return d->model->columnCount();
2793 d->treeModel()->setColumnCount(columns);
2813 return d->treeModel()->rootItem;
2826 return d->treeModel()->rootItem->child(index);
2844 return d->treeModel()->rootItem->childCount();
2858 d->treeModel()->rootItem->insertChild(index, item);
2886 return d->treeModel()->rootItem->takeChild(index);
2895 d->treeModel()->executePendingSort();
2896 return d->treeModel()->rootItem->children.indexOf(item);
2908 d->treeModel()->executePendingSort();
2909 return d->treeModel()->rootItem->children.indexOf(item);
2927 d->treeModel()->rootItem->insertChildren(index, items);
2949 return d->treeModel()->headerItem;
2973 delete d->treeModel()->headerItem;
2974 d->treeModel()->headerItem = item;
2976 d->treeModel()->endInsertColumns();
2978 d->treeModel()->endRemoveColumns();
2997 for (
int i = 0; i < labels.
count(); ++i)
3075 QItemSelectionModel::SelectionFlags command)
3078 d->selectionModel->setCurrentIndex(
d->index(item, column), command);
3133 return (
d->explicitSortColumn != -1
3134 ?
d->explicitSortColumn
3135 :
header()->sortIndicatorSection());
3149 d->model->sort(column, order);
3179 edit(
d->index(item, column));
3310 for (
int i = 0; i < indexes.
count(); ++i) {
3329 for (
int i = 0; i < indexes.
size(); ++i)
3344 if (item ==
d->treeModel()->headerItem)
3346 if (
d->hiddenIndexes.isEmpty())
3349 return d->isRowHidden(
d->index(item));
3364 if (item ==
d->treeModel()->headerItem) {
3419 if (item ==
d->treeModel()->headerItem)
3439 if (item ==
d->treeModel()->headerItem)
3456 if (item ==
d->treeModel()->headerItem)
3460 return d->item(above);
3474 if (item ==
d->treeModel()->headerItem)
3478 return d->item(below);
3544 d->treeModel()->clear();
3555 return model()->QAbstractItemModel::mimeTypes();
3569 if (
d->treeModel()->cachedIndexes.isEmpty()) {
3571 for (
int i = 0; i < items.
count(); ++i) {
3577 return d->model->QAbstractItemModel::mimeData(indexes);
3579 return d->treeModel()->internalMimeData();
3597 return model()->QAbstractItemModel::dropMimeData(data, action , index, 0, idx);
3630 return d->index(item, column);
3641 return d->item(index);
3644 #ifndef QT_NO_DRAGANDDROP 3653 if (
d->dropOn(event, &row, &col, &topIndex)) {
3656 for (
int i = 0; i < idxs.
count(); i++)
3667 for (
int i = indexes.
count() - 1; i >= 0; --i) {
3669 if (!parent || !parent->
parent()) {
3677 for (
int i = 0; i < indexes.
count(); ++i) {
3687 int r = dropRow.
row() >= 0 ? dropRow.
row() : row;
3713 Q_ASSERT(!
"QTreeWidget::setModel() - Changing the model of the QTreeWidget is not allowed.");
3723 d->treeModel()->executePendingSort();
3729 #include "moc_qtreewidget.cpp" 3731 #endif // QT_NO_TREEWIDGET static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
The QVariant class acts like a union for the most common Qt data types.
T qobject_cast(QObject *object)
bool insertRows(int row, int count, const QModelIndex &)
void * internalPointer() const
Returns a void * pointer used by the model to associate the index with the internal data structure...
QModelIndex index(const QTreeWidgetItem *item, int column) const
Returns the model index that refers to the tree view item and column.
int row() const
Returns the row this persistent model index refers to.
void openPersistentEditor(const QModelIndex &index)
Opens a persistent editor on the item at the given index.
bool blockSignals(bool b)
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke...
The QItemSelectionModel class keeps track of a view's selected items.
bool executePendingSort() const
QTreeModel(int columns=0, QTreeWidget *parent=0)
Constructs a tree model with a parent object and the given number of columns.
virtual void clear()
Clears the selection model.
QModelIndexList persistentIndexList() const
Returns the list of indexes stored as persistent indexes in the model.
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
#define QT_END_NAMESPACE
This macro expands to.
void beginInsertColumns(const QModelIndex &parent, int first, int last)
Begins a column insertion operation.
void setRowHidden(int row, const QModelIndex &parent, bool hide)
If hide is true the row with the given parent is hidden, otherwise the row is shown.
QPointer< QWidget > widget
void currentChanged(const QModelIndex ¤t, const QModelIndex &previous)
Reimplemented Function
T * data() const
Returns the value of the pointer referenced by this object.
QModelIndexList selectedIndexes() const
Reimplemented Function
QModelIndex sibling(int row, int column) const
Returns the sibling at row and column.
#define it(className, varName)
QVariant headerData(int section, Qt::Orientation orientation, int role) const
Returns the header data corresponding to the given header section, orientation and data role...
int count(const T &t) const
Returns the number of occurrences of value in the vector.
void clicked(const QModelIndex &index)
This signal is emitted when a mouse button is clicked.
T & first()
Returns a reference to the first item in the vector.
QModelIndexList selectedIndexes() const
Returns a list of all selected model item indexes.
QTreeWidgetItem * item(const QModelIndex &index) const
Returns the tree view item corresponding to the index given.
virtual void timerEvent(QTimerEvent *)
This event handler can be reimplemented in a subclass to receive timer events for the object...
DragDropMode dragDropMode() const
iterator begin()
Returns an STL-style iterator pointing to the first item in the list.
int select(int, fd_set *, fd_set *, fd_set *, struct timeval *)
void beginRemoveColumns(const QModelIndex &parent, int first, int last)
Begins a column removal operation.
void setIndexWidget(const QModelIndex &index, QWidget *widget)
Sets the given widget on the item at the given index, passing the ownership of the widget to the view...
const QItemSelection selection() const
Returns the selection ranges stored in the selection model.
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 isFirstColumnSpanned(int row, const QModelIndex &parent) const
Returns true if the item in first column in the given row of the parent is spanning all the columns; ...
void insert(int i, const T &t)
Inserts value at index position i in the list.
QModelIndex indexBelow(const QModelIndex &index) const
Returns the model index of the item below index.
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...
The QStack class is a template class that provides a stack.
int count(const T &t) const
Returns the number of occurrences of value in the list.
void itemChanged(QTreeWidgetItem *item)
void setSelectionModel(QItemSelectionModel *selectionModel)
Reimplemented Function
void clear()
Removes all items in the model.
void endInsertRows()
Ends a row insertion operation.
void setModel(QAbstractItemModel *model)
Reimplemented Function
bool isExpanded(const QModelIndex &index) const
Returns true if the model item index is expanded; otherwise returns false.
static bool variantLessThan(const QVariant &v1, const QVariant &v2)
This function is used by our Q{Tree,Widget,Table}WidgetModel classes to sort.
The QString class provides a Unicode character string.
static QList< QVariant > toList(char **buf, int count, T *=0)
void scheduleDelayedItemsLayout()
Schedules a layout of the items in the view to be executed when the event processing starts...
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...
QModelIndex parent() const
Returns the parent of the model index, or QModelIndex() if it has no parent.
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
QWidget * indexWidget(const QModelIndex &index) const
Returns the widget for the item at the given index.
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
void changePersistentIndexList(const QModelIndexList &from, const QModelIndexList &to)
Changes the QPersistentModelIndexes that is equal to the indexes in the given from model index list t...
void collapse(const QModelIndex &index)
Collapses the model item specified by the index.
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
void resize(int size)
Sets the size of the vector to size.
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the vector...
int toInt(bool *ok=0) const
Returns the variant as an int if the variant has type() Int , Bool , ByteArray , Char ...
void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
Reimplemented Function
void scrollTo(const QModelIndex &index, ScrollHint hint=EnsureVisible)
Scroll the contents of the tree view until the given model item index is visible. ...
T pop()
Removes the top item from the stack and returns it.
void dropEvent(QDropEvent *event)
This function is called with the given event when a drop event occurs over the widget.
virtual 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 beginInsertItems(QTreeWidgetItem *parent, int row, int count)
void expanded(const QModelIndex &index)
This signal is emitted when the item specified by index is expanded.
void setFirstColumnSpanned(int row, const QModelIndex &parent, bool span)
If span is true the item in the first column in the row with the given parent is set to span all colu...
void append(const T &t)
Inserts value at the end of the list.
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...
void entered(const QModelIndex &index)
This signal is emitted when the mouse cursor enters the item specified by index.
#define QT_BEGIN_NAMESPACE
This macro expands to.
static bool compare(const QVariant::Private *a, const QVariant::Private *b)
Compares a to b.
Q_GUI_EXPORT EGLDisplay display()
friend class QTreeWidgetItem
QBool contains(const T &t) const
Returns true if the list contains an occurrence of value; otherwise returns false.
Qt::DropActions supportedDropActions() const
Returns the drop actions supported by this model.
QList< QTreeWidgetItemIterator * > iterators
int lastIndexOf(const T &t, int from=-1) const
Returns the index position of the last occurrence of value in the list, searching backward from index...
void layoutAboutToBeChanged()
This signal is emitted just before the layout of a model is changed.
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...
bool contains(const T &value) const
T takeFirst()
Removes the first item in the list and returns it.
int rowCount(const QModelIndex &parent) const
Returns the number of rows in the parent model index.
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
QItemSelectionModel * selectionModel() const
Returns the current selection model.
T value(int i) const
Returns the value at index position i in the vector.
The QTreeView class provides a default model/view implementation of a tree view.
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the list...
int row() const
Returns the row this model index refers to.
QTreeWidget * view() const
const T & at(int i) const
Returns the item at index position i in the list.
bool operator()(QTreeWidgetItem *i1, QTreeWidgetItem *i2) const
QTreeWidgetItem * rootItem
The QStringList class provides a list of strings.
QMimeData * internalMimeData() const
void append(const T &t)
Inserts value at the end of the vector.
void setCurrentIndex(const QModelIndex &index)
Sets the current item to be the item at index.
bool operator()(QTreeWidgetItem *i1, QTreeWidgetItem *i2) const
const_iterator insert(const T &value)
int timerId() const
Returns the unique timer identifier, which is the same identifier as returned from QObject::startTime...
QStringList mimeTypes() const
Returns a list of MIME types that can be used to describe a list of model indexes.
void setSortingEnabled(bool enable)
QModelIndex currentIndex() const
Returns the model index of the current item.
int columnCount(const QModelIndex &parent=QModelIndex()) const
Returns the number of columns in the item referred to by the given index.
void endRemoveRows()
Ends a row removal operation.
void clear()
Removes all items from the list.
void layoutChanged()
This signal is emitted whenever the layout of items exposed by the model has changed; for example...
void activated(const QModelIndex &index)
This signal is emitted when the item specified by index is activated by the user. ...
The QMimeData class provides a container for data that records information about its MIME type...
void replace(int i, const T &t)
Replaces the item at index position i with value.
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.
void push(const T &t)
Adds element t to the top of the stack.
bool isValid() const
Returns true if this model index is valid; otherwise returns false.
void expand(const QModelIndex &index)
Expands the model item specified by the index.
const T & at(int i) const
Returns the item at index position i in the vector.
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.
void qStableSort(RandomAccessIterator start, RandomAccessIterator end)
int version() const
Returns the version number of the data serialization format.
void insert(int i, const T &t)
Inserts value at index position i in the vector.
Q_OUTOFLINE_TEMPLATE RandomAccessIterator qLowerBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value)
QModelIndexList cachedIndexes
bool isSortingEnabled() const
The QItemSelection class manages information about selected items in a model.
The QDropEvent class provides an event which is sent when a drag and drop action is completed...
int indexOf(const T &t, int from=0) const
Returns the index position of the first occurrence of value in the list, searching forward from index...
The QTimerEvent class contains parameters that describe a timer event.
iterator begin()
Returns an STL-style iterator pointing to the first item in the vector.
void pressed(const QModelIndex &index)
This signal is emitted when a mouse button is pressed.
void headerDataChanged(Qt::Orientation orientation, int first, int last)
This signal is emitted whenever a header is changed.
The QPersistentModelIndex class is used to locate data in a data model.
virtual void select(const QModelIndex &index, QItemSelectionModel::SelectionFlags command)
Selects the model item index using the specified command, and emits selectionChanged().
iterator insert(const Key &key, const T &value)
Inserts a new item with the key key and a value of value.
QWidget * source() const
If the source of the drag operation is a widget in this application, this function returns that sourc...
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.
QRect visualRect(const QModelIndex &index) const
Returns the rectangle on the viewport occupied by the item at index.
The QPoint class defines a point in the plane using integer precision.
Q_DECL_CONSTEXPR const T & qBound(const T &min, const T &val, const T &max)
void beginRemoveRows(const QModelIndex &parent, int first, int last)
Begins a row removal operation.
QHeaderView * header() const
Returns the header for the tree view.
The QModelIndex class is used to locate data in a data model.
int size() const
Returns the number of items in the list.
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
This signal is emitted whenever the data in an existing item changes.
The QRect class defines a rectangle in the plane using integer precision.
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...
int timerId() const
Returns the timer's ID.
void edit(const QModelIndex &index)
Starts editing the item corresponding to the given index if it is editable.
const QObjectList & children() const
Returns a list of child objects.
T takeAt(int i)
Removes the item at index position i and returns it.
void beginRemoveItems(QTreeWidgetItem *parent, int row, int count)
void setExpanded(const QModelIndex &index, bool expand)
Sets the item referred to by index to either collapse or expanded, depending on the value of expanded...
void endInsertColumns()
Ends a column insertion operation.
QBasicTimer sortPendingTimer
QScopedPointer< QObjectData > d_ptr
bool isEmpty() const
Returns true if the vector has size 0; otherwise returns false.
The QDataStream class provides serialization of binary data to a QIODevice.
void reserve(int size)
Attempts to allocate memory for at least size elements.
QModelIndexList indexes() const
Returns a list of model indexes that correspond to the selected items.
void doubleClicked(const QModelIndex &index)
This signal is emitted when a mouse button is double-clicked.
void closePersistentEditor(const QModelIndex &index)
Closes the persistent editor for the item at the given index.
bool signalsBlocked() const
Returns true if signals are blocked; otherwise returns false.
bool insertColumns(int column, int count, const QModelIndex &)
QModelIndex indexAbove(const QModelIndex &index) const
Returns the model index of the item above index.
T value() const
Returns the stored value converted to the template type T.
void setColumnCount(int columns)
Sets the number of columns in the tree model.
bool isValid() const
Returns true if the storage type of this variant is not QVariant::Invalid; otherwise returns false...
void timerEvent(QTimerEvent *)
This event handler can be reimplemented in a subclass to receive timer events for the object...
QModelIndex indexAt(const QPoint &p) const
Reimplemented Function
Q_TESTLIB_EXPORT QTestData & newRow(const char *dataTag)
Appends a new row to the current test data.
QAbstractItemModel * model() const
Returns the model that this view is presenting.
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.
void collapsed(const QModelIndex &index)
This signal is emitted when the item specified by index is collapsed.
bool event(QEvent *event)
Reimplemented Function
The QEvent class is the base class of all event classes.
Qt::ItemFlags flags(const QModelIndex &index) const
Returns the flags for the item referred to the given index.
Type type() const
Returns the event type.
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
Reimplemented Function
bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex())
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
int size() const
Returns the number of items in the vector.
~QTreeModel()
Destroys this tree model.
The QMap class is a template class that provides a skip-list-based dictionary.
virtual QMimeData * mimeData(const QModelIndexList &indexes) const
Returns an object that contains serialized items of data corresponding to the list of indexes specifi...
void reserve(int size)
Reserve space for alloc elements.
void reset()
Resets the model to its original state in any attached views.
void beginInsertRows(const QModelIndex &parent, int first, int last)
Begins a row insertion operation.
int column() const
Returns the column this model index refers to.
The QList class is a template class that provides lists.
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 endRemoveColumns()
Ends a column removal operation.
void sortItems(QList< QTreeWidgetItem *> *items, int column, Qt::SortOrder order)