QTreeWidget Class Reference

#include <qtreewidget.h>

Inheritance diagram for QTreeWidget:

Inheritance graph
[legend]
Collaboration diagram for QTreeWidget:

Collaboration graph
[legend]
List of all members.

Detailed Description

The QTreeWidget class provides a tree view that uses a predefined tree model.

The QTreeWidget class is a convenience class that provides a standard tree widget with a classic item-based interface similar to that used by the QListView class in Qt 3. This class is based on Qt's Model/View architecture and uses a default model to hold items, each of which is a QTreeWidgetItem.

Developers who do not need the flexibility of the Model/View framework can use this class to create simple hierarchical lists very easily. A more flexible approach involves combining a QTreeView with a standard item model. This allows the storage of data to be separated from its representation.

In its simplest form, a tree widget can be constructed in the following way:

    QTreeWidget *treeWidget = new QTreeWidget();
    treeWidget->setColumnCount(1);
    QList<QTreeWidgetItem *> items;
    for (int i = 0; i < 10; ++i)
        items.append(new QTreeWidgetItem((QTreeWidget*)0, QStringList(QString("item: %1").arg(i))));
    treeWidget->insertTopLevelItems(0, items);

Before items can be added to the tree widget, the number of columns must be set with setColumnCount(). This allows each item to have one or more labels or other decorations. The number of columns in use can be found with the columnCount() function.

The tree can have a header that contains a section for each column in the widget. It is easiest to set up the labels for each section by supplying a list of strings with setHeaderLabels(), but a custom header can be constructed with a QTreeWidgetItem and inserted into the tree with the setHeaderItem() function.

The items in the tree can be sorted by column according to a predefined sort order. If sorting is enabled, the user can sort the items by clicking on a column header. Sorting can be enabled or disabled by calling setSortingEnabled(). The isSortingEnabled() function indicates whether sorting is enabled.

100% windowsxp-treeview.png Screenshot of a Windows XP style tree widget macintosh-treeview.png Screenshot of a Macintosh style tree widget plastique-treeview.png Screenshot of a Plastique style tree widget A {Windows XP Style Widget Gallery}{Windows XP style} tree widget. A {Macintosh Style Widget Gallery}{Macintosh style} tree widget. A {Plastique Style Widget Gallery}{Plastique style} tree widget.

See also:
QTreeWidgetItem, QTreeView, {Model/View Programming}, {Settings Editor Example}

Definition at line 225 of file qtreewidget.h.

Public Slots

void scrollToItem (const QTreeWidgetItem *item, QAbstractItemView::ScrollHint hint=EnsureVisible)
void expandItem (const QTreeWidgetItem *item)
void collapseItem (const QTreeWidgetItem *item)
void clear ()

Signals

void itemPressed (QTreeWidgetItem *item, int column)
void itemClicked (QTreeWidgetItem *item, int column)
void itemDoubleClicked (QTreeWidgetItem *item, int column)
void itemActivated (QTreeWidgetItem *item, int column)
void itemEntered (QTreeWidgetItem *item, int column)
void itemChanged (QTreeWidgetItem *item, int column)
void itemExpanded (QTreeWidgetItem *item)
void itemCollapsed (QTreeWidgetItem *item)
void currentItemChanged (QTreeWidgetItem *current, QTreeWidgetItem *previous)
void itemSelectionChanged ()

Public Member Functions

 QTreeWidget (QWidget *parent=0)
 ~QTreeWidget ()
int columnCount () const
void setColumnCount (int columns)
QTreeWidgetIteminvisibleRootItem () const
QTreeWidgetItemtopLevelItem (int index) const
int topLevelItemCount () const
void insertTopLevelItem (int index, QTreeWidgetItem *item)
void addTopLevelItem (QTreeWidgetItem *item)
QTreeWidgetItemtakeTopLevelItem (int index)
int indexOfTopLevelItem (QTreeWidgetItem *item)
int indexOfTopLevelItem (QTreeWidgetItem *item) const
void insertTopLevelItems (int index, const QList< QTreeWidgetItem * > &items)
void addTopLevelItems (const QList< QTreeWidgetItem * > &items)
QTreeWidgetItemheaderItem () const
void setHeaderItem (QTreeWidgetItem *item)
void setHeaderLabels (const QStringList &labels)
void setHeaderLabel (const QString &label)
QTreeWidgetItemcurrentItem () const
int currentColumn () const
void setCurrentItem (QTreeWidgetItem *item)
void setCurrentItem (QTreeWidgetItem *item, int column)
QTreeWidgetItemitemAt (const QPoint &p) const
QTreeWidgetItemitemAt (int x, int y) const
QRect visualItemRect (const QTreeWidgetItem *item) const
int sortColumn () const
void sortItems (int column, Qt::SortOrder order)
void setSortingEnabled (bool enable)
bool isSortingEnabled () const
void editItem (QTreeWidgetItem *item, int column=0)
void openPersistentEditor (QTreeWidgetItem *item, int column=0)
void closePersistentEditor (QTreeWidgetItem *item, int column=0)
QWidgetitemWidget (QTreeWidgetItem *item, int column) const
void setItemWidget (QTreeWidgetItem *item, int column, QWidget *widget)
bool isItemSelected (const QTreeWidgetItem *item) const
void setItemSelected (const QTreeWidgetItem *item, bool select)
QList< QTreeWidgetItem * > selectedItems () const
QList< QTreeWidgetItem * > findItems (const QString &text, Qt::MatchFlags flags, int column=0) const
bool isItemHidden (const QTreeWidgetItem *item) const
void setItemHidden (const QTreeWidgetItem *item, bool hide)
bool isItemExpanded (const QTreeWidgetItem *item) const
void setItemExpanded (const QTreeWidgetItem *item, bool expand)

Protected Member Functions

bool event (QEvent *e)
virtual QStringList mimeTypes () const
virtual QMimeDatamimeData (const QList< QTreeWidgetItem * > items) const
virtual bool dropMimeData (QTreeWidgetItem *parent, int index, const QMimeData *data, Qt::DropAction action)
virtual Qt::DropActions supportedDropActions () const
QList< QTreeWidgetItem * > items (const QMimeData *data) const
QModelIndex indexFromItem (QTreeWidgetItem *item, int column=0) const
QTreeWidgetItemitemFromIndex (const QModelIndex &index) const
void dropEvent (QDropEvent *event)

Private Member Functions

void setModel (QAbstractItemModel *model)
 Q_PRIVATE_SLOT (d_func(), void _q_emitItemPressed(const QModelIndex &index)) Q_PRIVATE_SLOT(d_func()
void _q_emitItemClicked (const QModelIndex &index)) Q_PRIVATE_SLOT(d_func()
void void _q_emitItemDoubleClicked (const QModelIndex &index)) Q_PRIVATE_SLOT(d_func()
void void void _q_emitItemActivated (const QModelIndex &index)) Q_PRIVATE_SLOT(d_func()
void void void void _q_emitItemEntered (const QModelIndex &index)) Q_PRIVATE_SLOT(d_func()
void void void void void _q_emitItemChanged (const QModelIndex &index)) Q_PRIVATE_SLOT(d_func()
void void void void void void _q_emitItemExpanded (const QModelIndex &index)) Q_PRIVATE_SLOT(d_func()
void void void void void void
void 
_q_emitItemCollapsed (const QModelIndex &index)) Q_PRIVATE_SLOT(d_func()
void void void void void void
void void 
_q_emitCurrentItemChanged (const QModelIndex &previous, const QModelIndex &current)) Q_PRIVATE_SLOT(d_func()
void void void void void void
void void void 
_q_sort ()) Q_PRIVATE_SLOT(d_func()

Friends

class QTreeModel


Constructor & Destructor Documentation

QTreeWidget::QTreeWidget ( QWidget parent = 0  )  [explicit]

Constructs a tree widget with the given parent.

Definition at line 2169 of file qtreewidget.cpp.

References _q_emitCurrentItemChanged(), _q_emitItemActivated(), _q_emitItemChanged(), _q_emitItemClicked(), _q_emitItemCollapsed(), _q_emitItemDoubleClicked(), _q_emitItemEntered(), _q_emitItemExpanded(), _q_sort(), QAbstractItemView::activated(), QAbstractItemView::clicked(), QTreeView::collapsed(), QObject::connect(), QAbstractItemView::currentChanged(), QTreeView::dataChanged(), QAbstractItemView::doubleClicked(), QAbstractItemView::entered(), QTreeView::expanded(), QTreeView::header(), itemSelectionChanged(), QAbstractItemView::model(), QAbstractItemView::pressed(), QTreeModel, QAbstractItemView::selectionChanged(), QAbstractItemView::selectionModel(), QHeaderView::setClickable(), QTreeView::setModel(), SIGNAL, and SLOT.

02170     : QTreeView(*new QTreeWidgetPrivate(), parent)
02171 {
02172     QTreeView::setModel(new QTreeModel(1, this));
02173     connect(this, SIGNAL(pressed(QModelIndex)),
02174             SLOT(_q_emitItemPressed(QModelIndex)));
02175     connect(this, SIGNAL(clicked(QModelIndex)),
02176             SLOT(_q_emitItemClicked(QModelIndex)));
02177     connect(this, SIGNAL(doubleClicked(QModelIndex)),
02178             SLOT(_q_emitItemDoubleClicked(QModelIndex)));
02179     connect(this, SIGNAL(activated(QModelIndex)),
02180             SLOT(_q_emitItemActivated(QModelIndex)));
02181     connect(this, SIGNAL(entered(QModelIndex)),
02182             SLOT(_q_emitItemEntered(QModelIndex)));
02183     connect(this, SIGNAL(expanded(QModelIndex)),
02184             SLOT(_q_emitItemExpanded(QModelIndex)));
02185     connect(this, SIGNAL(collapsed(QModelIndex)),
02186             SLOT(_q_emitItemCollapsed(QModelIndex)));
02187     connect(selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)),
02188             this, SLOT(_q_emitCurrentItemChanged(QModelIndex,QModelIndex)));
02189     connect(selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
02190             this, SIGNAL(itemSelectionChanged()));
02191     connect(model(), SIGNAL(dataChanged(QModelIndex,QModelIndex)),
02192             this, SLOT(_q_emitItemChanged(QModelIndex)));
02193     QObject::connect(model(), SIGNAL(dataChanged(QModelIndex,QModelIndex)),
02194                      this, SLOT(_q_dataChanged(QModelIndex,QModelIndex)));
02195     QObject::connect(model(), SIGNAL(columnsRemoved(QModelIndex,int,int)),
02196                      this, SLOT(_q_sort()));
02197 
02198     header()->setClickable(false);
02199 }

Here is the call graph for this function:

QTreeWidget::~QTreeWidget (  ) 

Destroys the tree widget and all its items.

Definition at line 2205 of file qtreewidget.cpp.

02206 {
02207 }


Member Function Documentation

int QTreeWidget::columnCount (  )  const

Definition at line 2215 of file qtreewidget.cpp.

References d.

Referenced by qdesigner_internal::TreeWidgetEditor::copyContents(), qdesigner_internal::ChangeTreeContentsCommand::init(), QAbstractFormBuilder::saveTreeWidgetExtraInfo(), setHeaderItem(), and setHeaderLabels().

02216 {
02217     Q_D(const QTreeWidget);
02218     return d->model()->columnCount();
02219 }

void QTreeWidget::setColumnCount ( int  columns  ) 

Definition at line 2225 of file qtreewidget.cpp.

References d.

Referenced by qdesigner_internal::ChangeTreeContentsCommand::changeContents(), qdesigner_internal::TreeWidgetEditor::copyContents(), FindFileDialog::createFilesTree(), QAbstractFormBuilder::loadTreeWidgetExtraInfo(), qdesigner_internal::ObjectInspector::ObjectInspector(), PluginDialog::PluginDialog(), setHeaderLabels(), and qdesigner_internal::WidgetBoxTreeView::WidgetBoxTreeView().

02226 {
02227     Q_D(QTreeWidget);
02228     if (columns < 0)
02229         return;
02230     d->model()->setColumnCount(columns);
02231 }

QTreeWidgetItem * QTreeWidget::invisibleRootItem (  )  const

Since:
4.2
Returns the tree widget's invisible root item.

The invisible root item provides access to the tree widget's top-level items through the QTreeWidgetItem API, making it possible to write functions that can treat top-level items and their children in a uniform way; for example, recursive functions.

Definition at line 2244 of file qtreewidget.cpp.

References d.

02245 {
02246     Q_D(const QTreeWidget);
02247     return d->model()->rootItem;
02248 }

QTreeWidgetItem * QTreeWidget::topLevelItem ( int  index  )  const

Returns the top level item at the given index, or 0 if the item does not exist.

See also:
topLevelItemCount(), insertTopLevelItem()

Definition at line 2257 of file qtreewidget.cpp.

References d.

Referenced by qdesigner_internal::WidgetBoxTreeView::addCategory(), qdesigner_internal::WidgetBoxTreeView::addWidget(), qdesigner_internal::WidgetBoxTreeView::category(), SettingsTree::childAt(), qdesigner_internal::TreeWidgetEditor::copyContents(), qdesigner_internal::WidgetBoxTreeView::dropWidgets(), findItem(), qdesigner_internal::WidgetBoxTreeView::indexOfCategory(), qdesigner_internal::WidgetBoxTreeView::indexOfScratchpad(), qdesigner_internal::ChangeTreeContentsCommand::initState(), qdesigner_internal::WidgetBoxTreeView::load(), QTreeWidgetItemIteratorPrivate::nextSibling(), ConnectionWidget::refresh(), qdesigner_internal::WidgetBoxTreeView::removeWidget(), QAbstractFormBuilder::saveTreeWidgetExtraInfo(), ConnectionWidget::setActive(), FindFileDialog::showFiles(), store(), MainWindow::updateDownloadRate(), MainWindow::updatePeerInfo(), MainWindow::updateProgress(), MainWindow::updateState(), MainWindow::updateUploadRate(), qdesigner_internal::WidgetBoxTreeView::widget(), qdesigner_internal::WidgetBoxTreeView::widgetCount(), XbelGenerator::write(), and qdesigner_internal::WidgetBoxTreeView::~WidgetBoxTreeView().

02258 {
02259     Q_D(const QTreeWidget);
02260     d->model()->executePendingSort();
02261     return d->model()->rootItem->child(index);
02262 }

int QTreeWidget::topLevelItemCount (  )  const

Definition at line 2270 of file qtreewidget.cpp.

References d.

Referenced by addTopLevelItem(), addTopLevelItems(), qdesigner_internal::WidgetBoxTreeView::addWidget(), qdesigner_internal::WidgetBoxTreeView::category(), qdesigner_internal::WidgetBoxTreeView::categoryCount(), SettingsTree::childCount(), qdesigner_internal::TreeWidgetEditor::copyContents(), dropEvent(), findItem(), qdesigner_internal::WidgetBoxTreeView::indexOfCategory(), qdesigner_internal::WidgetBoxTreeView::indexOfScratchpad(), qdesigner_internal::ChangeTreeContentsCommand::initState(), qdesigner_internal::WidgetBoxTreeView::load(), qdesigner_internal::WidgetBoxTreeView::removeCategory(), qdesigner_internal::WidgetBoxTreeView::removeWidget(), QAbstractFormBuilder::saveTreeWidgetExtraInfo(), ConnectionWidget::setActive(), store(), FindFileDialog::update(), qdesigner_internal::WidgetBoxTreeView::widget(), qdesigner_internal::WidgetBoxTreeView::widgetCount(), and XbelGenerator::write().

02271 {
02272     Q_D(const QTreeWidget);
02273     return d->model()->rootItem->childCount();
02274 }

void QTreeWidget::insertTopLevelItem ( int  index,
QTreeWidgetItem item 
)

Inserts the item at index in the top level in the view.

If the item has already been inserted somewhere else it wont be inserted.

See also:
addTopLevelItem(), columnCount()

Definition at line 2284 of file qtreewidget.cpp.

References d.

Referenced by addTopLevelItem(), dropEvent(), MainWindow::moveTorrentDown(), and MainWindow::moveTorrentUp().

02285 {
02286     Q_D(QTreeWidget);
02287     d->model()->rootItem->insertChild(index, item);
02288 }

void QTreeWidget::addTopLevelItem ( QTreeWidgetItem item  ) 

Since:
4.1
Appends the item as a top-level item in the widget.

See also:
insertTopLevelItem()

Definition at line 2297 of file qtreewidget.cpp.

References insertTopLevelItem(), and topLevelItemCount().

Referenced by qdesigner_internal::ChangeTreeContentsCommand::changeContents().

02298 {
02299     insertTopLevelItem(topLevelItemCount(), item);
02300 }

Here is the call graph for this function:

QTreeWidgetItem * QTreeWidget::takeTopLevelItem ( int  index  ) 

Removes the top-level item at the given index in the tree and returns it, otherwise returns 0;

See also:
insertTopLevelItem(), topLevelItem(), topLevelItemCount()

Definition at line 2309 of file qtreewidget.cpp.

References d.

Referenced by qdesigner_internal::WidgetBoxTreeView::deleteScratchpad(), dropEvent(), MainWindow::moveTorrentDown(), MainWindow::moveTorrentUp(), qdesigner_internal::WidgetBoxTreeView::removeCategory(), qdesigner_internal::WidgetBoxTreeView::removeCurrentItem(), MainWindow::removeTorrent(), and MainWindow::torrentError().

02310 {
02311     Q_D(QTreeWidget);
02312     return d->model()->rootItem->takeChild(index);
02313 }

int QTreeWidget::indexOfTopLevelItem ( QTreeWidgetItem item  ) 

Definition at line 2318 of file qtreewidget.cpp.

References d.

Referenced by QTreeWidgetItemIteratorPrivate::ensureValidIterator(), MainWindow::moveTorrentDown(), MainWindow::moveTorrentUp(), QTreeWidgetItemIteratorPrivate::nextSibling(), MainWindow::pauseTorrent(), qdesigner_internal::WidgetBoxTreeView::removeCurrentItem(), MainWindow::removeTorrent(), MainWindow::setActionsEnabled(), and ConnectionWidget::setActive().

02319 {
02320     Q_D(QTreeWidget);
02321     d->model()->executePendingSort();
02322     return d->model()->rootItem->indexOfChild(item);
02323 }

int QTreeWidget::indexOfTopLevelItem ( QTreeWidgetItem item  )  const

Returns the index of the given top-level item, or -1 if the item cannot be found.

See also:
sortItems(), topLevelItemCount()

Definition at line 2331 of file qtreewidget.cpp.

References d.

02332 {
02333     Q_D(const QTreeWidget);
02334     d->model()->executePendingSort();
02335     return d->model()->rootItem->indexOfChild(item);
02336 }

void QTreeWidget::insertTopLevelItems ( int  index,
const QList< QTreeWidgetItem * > &  items 
)

Since:
4.1
Inserts the list of items at index in the top level in the view.

Items that have already been inserted somewhere else wont be inserted.

See also:
addTopLevelItems()

Definition at line 2347 of file qtreewidget.cpp.

References d, and items().

Referenced by addTopLevelItems().

02348 {
02349     Q_D(QTreeWidget);
02350     d->model()->rootItem->insertChildren(index, items);
02351 }

Here is the call graph for this function:

void QTreeWidget::addTopLevelItems ( const QList< QTreeWidgetItem * > &  items  ) 

Appends the list of items as a top-level items in the widget.

See also:
insertTopLevelItems()

Definition at line 2358 of file qtreewidget.cpp.

References insertTopLevelItems(), items(), and topLevelItemCount().

02359 {
02360     insertTopLevelItems(topLevelItemCount(), items);
02361 }

Here is the call graph for this function:

QTreeWidgetItem * QTreeWidget::headerItem (  )  const

Returns the item used for the tree widget's header.

See also:
setHeaderItem()

Definition at line 2369 of file qtreewidget.cpp.

References d.

Referenced by qdesigner_internal::TreeWidgetEditor::copyContents(), qdesigner_internal::ChangeTreeContentsCommand::initState(), QAbstractFormBuilder::loadTreeWidgetExtraInfo(), qdesigner_internal::ObjectInspector::ObjectInspector(), and QAbstractFormBuilder::saveTreeWidgetExtraInfo().

02370 {
02371     Q_D(const QTreeWidget);
02372     return d->model()->headerItem;
02373 }

void QTreeWidget::setHeaderItem ( QTreeWidgetItem item  ) 

Sets the header item for the tree widget. The label for each column in the header is supplied by the corresponding label in the item.

The tree widget takes ownership of the item.

See also:
headerItem(), setHeaderLabels()

Definition at line 2384 of file qtreewidget.cpp.

References columnCount(), QTreeWidgetItem::columnCount(), d, Qt::Horizontal, and QTreeWidgetItem::view.

Referenced by qdesigner_internal::ChangeTreeContentsCommand::changeContents().

02385 {
02386     Q_D(QTreeWidget);
02387     if (!item)
02388         return;
02389     item->view = this;
02390 
02391     int oldCount = columnCount();
02392     if (oldCount < item->columnCount())
02393          d->model()->beginInsertColumns(QModelIndex(), oldCount, item->columnCount());
02394     else
02395          d->model()->beginRemoveColumns(QModelIndex(), item->columnCount(), oldCount);
02396     delete d->model()->headerItem;
02397     d->model()->headerItem = item;
02398     if (oldCount < item->columnCount())
02399         d->model()->endInsertColumns();
02400     else
02401         d->model()->endRemoveColumns();
02402     d->model()->headerDataChanged(Qt::Horizontal, 0, oldCount);
02403 }

Here is the call graph for this function:

void QTreeWidget::setHeaderLabels ( const QStringList labels  ) 

Adds a column in the header for each item in the labels list, and sets the label for each column.

Note that setHeaderLabels() won't remove existing columns.

See also:
setHeaderItem(), setHeaderLabel()

Definition at line 2414 of file qtreewidget.cpp.

References QList< T >::at(), columnCount(), QList< T >::count(), d, i, QAbstractItemView::model(), setColumnCount(), and QTreeWidgetItem::setText().

Referenced by ConnectionWidget::ConnectionWidget(), FindFileDialog::createFilesTree(), QDBusViewer::QDBusViewer(), setHeaderLabel(), SettingsTree::SettingsTree(), and XbelTree::XbelTree().

02415 {
02416     Q_D(QTreeWidget);
02417     if (columnCount() < labels.count())
02418         setColumnCount(labels.count());
02419     QTreeModel *model = d->model();
02420     QTreeWidgetItem *item = model->headerItem;
02421     for (int i = 0; i < labels.count(); ++i)
02422         item->setText(i, labels.at(i));
02423 }

Here is the call graph for this function:

void QTreeWidget::setHeaderLabel ( const QString label  )  [inline]

Since:
4.2
Same as setHeaderLabels(QStringList(label)).

Definition at line 343 of file qtreewidget.h.

References setHeaderLabels().

00344 { setHeaderLabels(QStringList(alabel)); }

Here is the call graph for this function:

QTreeWidgetItem * QTreeWidget::currentItem (  )  const

Returns the current item in the tree widget.

See also:
setCurrentItem(), currentItemChanged()

Definition at line 2437 of file qtreewidget.cpp.

References QAbstractItemView::currentIndex(), and d.

Referenced by MainWindow::moveTorrentDown(), MainWindow::moveTorrentUp(), FindFileDialog::openFile(), MainWindow::pauseTorrent(), qdesigner_internal::WidgetBoxTreeView::removeCurrentItem(), MainWindow::removeTorrent(), and ConnectionWidget::showMetaData().

02438 {
02439     Q_D(const QTreeWidget);
02440     return d->item(currentIndex());
02441 }

Here is the call graph for this function:

int QTreeWidget::currentColumn (  )  const

Since:
4.1 Returns the current column in the tree widget.
See also:
setCurrentItem(), columnCount()

Definition at line 2449 of file qtreewidget.cpp.

References QModelIndex::column(), and QAbstractItemView::currentIndex().

02450 {
02451     return currentIndex().column();
02452 }

Here is the call graph for this function:

void QTreeWidget::setCurrentItem ( QTreeWidgetItem item  ) 

Sets the current item in the tree widget.

Depending on the current selection mode, the item may also be selected.

See also:
currentItem(), currentItemChanged()

Definition at line 2461 of file qtreewidget.cpp.

Referenced by qdesigner_internal::WidgetBoxTreeView::contextMenuEvent(), qdesigner_internal::WidgetBoxTreeView::dropWidgets(), and FindFileDialog::showFiles().

02462 {
02463     setCurrentItem(item, 0);
02464 }

void QTreeWidget::setCurrentItem ( QTreeWidgetItem item,
int  column 
)

Since:
4.1 Sets the current item in the tree widget and the curernt column to column.
See also:
currentItem()

Definition at line 2472 of file qtreewidget.cpp.

References d, and QAbstractItemView::setCurrentIndex().

02473 {
02474     Q_D(const QTreeWidget);
02475     setCurrentIndex(d->index(item, column));
02476 }

QTreeWidgetItem * QTreeWidget::itemAt ( const QPoint p  )  const

Returns a pointer to the item at the coordinates p.

See also:
visualItemRect()

Definition at line 2483 of file qtreewidget.cpp.

References d, QTreeView::indexAt(), and p.

Referenced by qdesigner_internal::WidgetBoxTreeView::contextMenuEvent(), HelpDialog::showTreeItemMenu(), and qdesigner_internal::ObjectInspector::slotPopupContextMenu().

02484 {
02485     Q_D(const QTreeWidget);
02486     return d->item(indexAt(p));
02487 }

Here is the call graph for this function:

QTreeWidgetItem * QTreeWidget::itemAt ( int  x,
int  y 
) const [inline]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Returns a pointer to the item at the coordinates (x, y).

Definition at line 340 of file qtreewidget.h.

00341 { return itemAt(QPoint(ax, ay)); }

QRect QTreeWidget::visualItemRect ( const QTreeWidgetItem item  )  const

Returns the rectangle on the viewport occupied by the item at item.

See also:
itemAt()

Definition at line 2501 of file qtreewidget.cpp.

References d, and QTreeView::visualRect().

02502 {
02503     Q_D(const QTreeWidget);
02504     return visualRect(d->index(item));
02505 }

Here is the call graph for this function:

int QTreeWidget::sortColumn (  )  const

Since:
4.1
Returns the column used to sort the contents of the widget.

See also:
sortItems()

Definition at line 2514 of file qtreewidget.cpp.

References QTreeView::header(), and QHeaderView::sortIndicatorSection().

Referenced by QTreeWidgetItem::operator<().

02515 {
02516     return header()->sortIndicatorSection();
02517 }

Here is the call graph for this function:

void QTreeWidget::sortItems ( int  column,
Qt::SortOrder  order 
)

Sorts the items in the widget in the specified order by the values in the given column.

See also:
sortColumn()

Definition at line 2526 of file qtreewidget.cpp.

References d, QTreeView::header(), and QHeaderView::setSortIndicator().

02527 {
02528     Q_D(QTreeWidget);
02529     header()->setSortIndicator(column, order);
02530     d->model()->sort(column, order);
02531 }

Here is the call graph for this function:

void QTreeWidget::setSortingEnabled ( bool  enable  ) 

Reimplemented from QTreeView.

Definition at line 2538 of file qtreewidget.cpp.

References QTreeView::setSortingEnabled().

02539 {
02540     QTreeView::setSortingEnabled(enable);
02541 }

Here is the call graph for this function:

bool QTreeWidget::isSortingEnabled (  )  const

Reimplemented from QTreeView.

Definition at line 2548 of file qtreewidget.cpp.

References QTreeView::isSortingEnabled().

Referenced by QTreeWidgetItem::insertChild(), and QTreeWidgetItem::insertChildren().

02549 {
02550     return QTreeView::isSortingEnabled();
02551 }

Here is the call graph for this function:

void QTreeWidget::editItem ( QTreeWidgetItem item,
int  column = 0 
)

Starts editing the item in the given column if it is editable.

Definition at line 2557 of file qtreewidget.cpp.

References d, and QAbstractItemView::edit().

02558 {
02559     Q_D(QTreeWidget);
02560     edit(d->index(item, column));
02561 }

void QTreeWidget::openPersistentEditor ( QTreeWidgetItem item,
int  column = 0 
)

Opens a persistent editor for the item in the given column.

See also:
closePersistentEditor()

Definition at line 2569 of file qtreewidget.cpp.

References d, and QAbstractItemView::openPersistentEditor().

02570 {
02571     Q_D(QTreeWidget);
02572     QAbstractItemView::openPersistentEditor(d->index(item, column));
02573 }

Here is the call graph for this function:

void QTreeWidget::closePersistentEditor ( QTreeWidgetItem item,
int  column = 0 
)

Closes the persistent editor for the item in the given column.

This function has no effect if no persistent editor is open for this combination of item and column.

See also:
openPersistentEditor()

Definition at line 2584 of file qtreewidget.cpp.

References QAbstractItemView::closePersistentEditor(), and d.

02585 {
02586     Q_D(QTreeWidget);
02587     QAbstractItemView::closePersistentEditor(d->index(item, column));
02588 }

Here is the call graph for this function:

QWidget * QTreeWidget::itemWidget ( QTreeWidgetItem item,
int  column 
) const

Since:
4.1
Returns the widget displayed in the cell specified by item and the given column.

Definition at line 2595 of file qtreewidget.cpp.

References d, and QAbstractItemView::indexWidget().

02596 {
02597     Q_D(const QTreeWidget);
02598     return QAbstractItemView::indexWidget(d->index(item, column));
02599 }

Here is the call graph for this function:

void QTreeWidget::setItemWidget ( QTreeWidgetItem item,
int  column,
QWidget widget 
)

Since:
4.1
Sets the given widget to be displayed in the cell specified by the given item and column.

Note that the given widget's {QWidget}{autoFillBackground} property must be set to true, otherwise the widget's background will be transparent, showing both the model data and the tree widget item.

This function should only be used to display static content in the place of a tree widget item. If you want to display custom dynamic content or implement a custom editor widget, use QTreeView and subclass QItemDelegate instead.

See also:
{Delegate Classes}

Definition at line 2619 of file qtreewidget.cpp.

References d, and QAbstractItemView::setIndexWidget().

02620 {
02621     Q_D(QTreeWidget);
02622     QAbstractItemView::setIndexWidget(d->index(item, column), widget);
02623 }

Here is the call graph for this function:

bool QTreeWidget::isItemSelected ( const QTreeWidgetItem item  )  const

Returns true if the item is selected; otherwise returns false.

See also:
itemSelectionChanged()

This function is deprecated. Use {QTreeWidgetItem::isSelected()} instead.

Definition at line 2634 of file qtreewidget.cpp.

References d, QItemSelectionModel::isSelected(), and QAbstractItemView::selectionModel().

Referenced by QTreeWidgetItem::isSelected(), and QTreeWidgetItemIterator::matchesFlags().

02635 {
02636     Q_D(const QTreeWidget);
02637     return selectionModel()->isSelected(d->index(item));
02638 
02639 }

Here is the call graph for this function:

void QTreeWidget::setItemSelected ( const QTreeWidgetItem item,
bool  select 
)

If select is true, the given item is selected; otherwise it is deselected.

See also:
itemSelectionChanged()

This function is deprecated. Use {QTreeWidgetItem::setSelected()} instead.

Definition at line 2651 of file qtreewidget.cpp.

References d, QItemSelectionModel::Deselect, QItemSelectionModel::Rows, QItemSelectionModel::select(), QItemSelectionModel::Select, and QAbstractItemView::selectionModel().

Referenced by QTreeWidgetItem::setSelected().

02652 {
02653     Q_D(QTreeWidget);
02654     selectionModel()->select(d->index(item), (select ? QItemSelectionModel::Select
02655                                               : QItemSelectionModel::Deselect)
02656                              |QItemSelectionModel::Rows);
02657 }

Here is the call graph for this function:

QList< QTreeWidgetItem * > QTreeWidget::selectedItems (  )  const

Returns a list of all selected non-hidden items.

See also:
itemSelectionChanged()

Definition at line 2664 of file qtreewidget.cpp.

References QList< T >::append(), QList< T >::at(), QList< T >::contains(), QList< T >::count(), d, i, items(), QItemSelectionModel::selectedIndexes(), and QAbstractItemView::selectionModel().

Referenced by MainWindow::setActionsEnabled(), and qdesigner_internal::ObjectInspector::slotSelectionChanged().

02665 {
02666     Q_D(const QTreeWidget);
02667     QModelIndexList indexes = selectionModel()->selectedIndexes();
02668     QList<QTreeWidgetItem*> items;
02669     for (int i = 0; i < indexes.count(); ++i) {
02670         QTreeWidgetItem *item = d->item(indexes.at(i));
02671         if (!items.contains(item)) // ### slow, optimize later
02672             items.append(item);
02673     }
02674     return items;
02675 }

Here is the call graph for this function:

QList< QTreeWidgetItem * > QTreeWidget::findItems ( const QString text,
Qt::MatchFlags  flags,
int  column = 0 
) const

Returns a list of items that match the given text, using the given flags, in the given column.

Definition at line 2680 of file qtreewidget.cpp.

References QList< T >::append(), QList< T >::at(), d, Qt::DisplayRole, i, index, items(), QAbstractItemView::model(), and QList< T >::size().

02681 {
02682     Q_D(const QTreeWidget);
02683     QModelIndexList indexes = d->model()->match(model()->index(0, column, QModelIndex()),
02684                                                 Qt::DisplayRole, text, -1, flags);
02685     QList<QTreeWidgetItem*> items;
02686     for (int i = 0; i < indexes.size(); ++i)
02687         items.append(d->item(indexes.at(i)));
02688     return items;
02689 }

Here is the call graph for this function:

bool QTreeWidget::isItemHidden ( const QTreeWidgetItem item  )  const

Returns true if the item is explicitly hidden, otherwise returns false.

This function is deprecated. Use {QTreeWidgetItem::isHidden()} instead.

Definition at line 2698 of file qtreewidget.cpp.

References d, QTreeView::header(), index, QWidget::isHidden(), and QTreeView::isRowHidden().

Referenced by QTreeWidgetItem::isHidden(), and QTreeWidgetItemIterator::matchesFlags().

02699 {
02700     Q_D(const QTreeWidget);
02701     if (item == d->model()->headerItem)
02702         return header()->isHidden();
02703     const QModelIndex index = d->index(item);
02704     return isRowHidden(index.row(), index.parent());
02705 }

Here is the call graph for this function:

void QTreeWidget::setItemHidden ( const QTreeWidgetItem item,
bool  hide 
)

Hides the given item if hide is true; otherwise shows the item.

See also:
itemChanged()

This function is deprecated. Use {QTreeWidgetItem::setHidden()} instead.

Definition at line 2716 of file qtreewidget.cpp.

References d, QTreeView::header(), index, QWidget::setHidden(), and QTreeView::setRowHidden().

Referenced by QTreeWidgetItem::setHidden().

02717 {
02718     Q_D(QTreeWidget);
02719     if (item == d->model()->headerItem) {
02720         header()->setHidden(hide);
02721     } else {
02722         const QModelIndex index = d->index(item);
02723         setRowHidden(index.row(), index.parent(), hide);
02724     }
02725 }

Here is the call graph for this function:

bool QTreeWidget::isItemExpanded ( const QTreeWidgetItem item  )  const

Returns true if the given item is open; otherwise returns false.

See also:
itemExpanded()

This function is deprecated. Use {QTreeWidgetItem::isExpanded()} instead.

Definition at line 2736 of file qtreewidget.cpp.

References d, and QTreeView::isExpanded().

Referenced by XbelGenerator::generateItem(), qdesigner_internal::WidgetBoxTreeView::handleMousePress(), QTreeWidgetItem::isExpanded(), qdesigner_internal::WidgetBoxTreeView::load(), and qdesigner_internal::WidgetBoxTreeView::~WidgetBoxTreeView().

02737 {
02738     Q_D(const QTreeWidget);
02739     return isExpanded(d->index(item));
02740 }

Here is the call graph for this function:

void QTreeWidget::setItemExpanded ( const QTreeWidgetItem item,
bool  expand 
)

Sets the item referred to by item to either closed or opened, depending on the value of expand.

See also:
expandItem(), collapseItem(), itemExpanded()

This function is deprecated. Use {QTreeWidgetItem::setExpanded()} instead.

Definition at line 2752 of file qtreewidget.cpp.

References d, and QTreeView::setExpanded().

Referenced by qdesigner_internal::WidgetBoxTreeView::addCategory(), qdesigner_internal::TreeWidgetEditor::copyContents(), qdesigner_internal::WidgetBoxTreeView::dropWidgets(), qdesigner_internal::WidgetBoxTreeView::handleMousePress(), qdesigner_internal::WidgetBoxTreeView::load(), XbelTree::parseFolderElement(), PluginDialog::populateTreeWidget(), qdesigner_internal::WidgetBoxTreeView::removeCurrentItem(), QTreeWidgetItem::setExpanded(), and XbelHandler::startElement().

02753 {
02754     Q_D(QTreeWidget);
02755     setExpanded(d->index(item), expand);
02756 }

Here is the call graph for this function:

void QTreeWidget::scrollToItem ( const QTreeWidgetItem item,
QAbstractItemView::ScrollHint  hint = EnsureVisible 
) [slot]

Ensures that the item is visible, scrolling the view if necessary using the specified hint.

See also:
currentItem(), itemAt(), topLevelItem()

Definition at line 2764 of file qtreewidget.cpp.

References d, and QTreeView::scrollTo().

02765 {
02766     Q_D(QTreeWidget);
02767     QTreeView::scrollTo(d->index(item), hint);
02768 }

void QTreeWidget::expandItem ( const QTreeWidgetItem item  )  [slot]

Expands the item. This causes the tree containing the item's children to be expanded.

See also:
collapseItem(), currentItem(), itemAt(), topLevelItem(), itemExpanded()

Definition at line 2776 of file qtreewidget.cpp.

References d, and QTreeView::expand().

02777 {
02778     Q_D(QTreeWidget);
02779     expand(d->index(item));
02780 }

void QTreeWidget::collapseItem ( const QTreeWidgetItem item  )  [slot]

Closes the item. This causes the tree containing the item's children to be collapsed.

See also:
expandItem(), currentItem(), itemAt(), topLevelItem()

Definition at line 2788 of file qtreewidget.cpp.

References QTreeView::collapse(), and d.

02789 {
02790     Q_D(QTreeWidget);
02791     collapse(d->index(item));
02792 }

void QTreeWidget::clear (  )  [slot]

Clears the tree widget by removing all of its items and selections.

{Note:} Since each item is removed from the tree widget before being deleted, the return value of QTreeWidgetItem::treeWidget() will be invalid when called from an item's destructor.

See also:
takeTopLevelItem(), topLevelItemCount(), columnCount()

Definition at line 2803 of file qtreewidget.cpp.

References QItemSelectionModel::clear(), d, and QAbstractItemView::selectionModel().

Referenced by qdesigner_internal::ChangeTreeContentsCommand::changeContents(), qdesigner_internal::TreeWidgetEditor::copyContents(), XbelTree::read(), ConnectionWidget::refresh(), QDBusViewer::refresh(), qdesigner_internal::ObjectInspector::setFormWindow(), SettingsTree::setSettingsObject(), and FindFileDialog::showFiles().

02804 {
02805     Q_D(QTreeWidget);
02806     selectionModel()->clear();
02807     d->model()->clear();
02808 }

void QTreeWidget::itemPressed ( QTreeWidgetItem item,
int  column 
) [signal]

This signal is emitted when the user presses a mouse button inside the widget.

The specified item is the item that was clicked, or 0 if no item was clicked. The column is the item's column that was clicked, or -1 if no item was clicked.

Referenced by qdesigner_internal::WidgetBoxTreeView::WidgetBoxTreeView().

void QTreeWidget::itemClicked ( QTreeWidgetItem item,
int  column 
) [signal]

This signal is emitted when the user clicks inside the widget.

The specified item is the item that was clicked, or 0 if no item was clicked. The column is the item's column that was clicked, or -1 if no item was clicked.

void QTreeWidget::itemDoubleClicked ( QTreeWidgetItem item,
int  column 
) [signal]

This signal is emitted when the user double clicks inside the widget.

The specified item is the item that was clicked, or 0 if no item was clicked. The column is the item's column that was clicked, or -1 if no item was clicked.

void QTreeWidget::itemActivated ( QTreeWidgetItem item,
int  column 
) [signal]

This signal is emitted when the user activates an item by single- or double-clicking (depending on the platform, i.e. on the QStyle::SH_ItemView_ActivateItemOnSingleClick style hint) or pressing a special key (e.g., Enter).

The specified item is the item that was clicked, or 0 if no item was clicked. The column is the item's column that was clicked, or -1 if no item was clicked.

void QTreeWidget::itemEntered ( QTreeWidgetItem item,
int  column 
) [signal]

This signal is emitted when the mouse cursor enters an item over the specified column. QTreeWidget mouse tracking needs to be enabled for this feature to work.

void QTreeWidget::itemChanged ( QTreeWidgetItem item,
int  column 
) [signal]

This signal is emitted when the contents of the column in the specified item changes.

Referenced by XbelTree::read(), SettingsTree::refresh(), and qdesigner_internal::WidgetBoxTreeView::WidgetBoxTreeView().

void QTreeWidget::itemExpanded ( QTreeWidgetItem item  )  [signal]

This signal is emitted when the specified item is expanded so that all of its children are displayed.

See also:
isItemExpanded(), itemCollapsed(), expandItem()

void QTreeWidget::itemCollapsed ( QTreeWidgetItem item  )  [signal]

This signal is emitted when the specified item is collapsed so that none of its children are displayed.

See also:
isItemExpanded(), itemExpanded(), collapseItem()

void QTreeWidget::currentItemChanged ( QTreeWidgetItem current,
QTreeWidgetItem previous 
) [signal]

This signal is emitted when the current item changes. The current item is specified by current, and this replaces the previous current item.

See also:
setCurrentItem()

void QTreeWidget::itemSelectionChanged (  )  [signal]

This signal is emitted when the selection changes in the tree widget. The current selection can be found with selectedItems().

Referenced by QTreeWidget().

bool QTreeWidget::event ( QEvent e  )  [protected, virtual]

Reimplemented from QAbstractItemView.

Definition at line 2973 of file qtreewidget.cpp.

References QAbstractItemView::event().

Referenced by TorrentView::dragMoveEvent(), TorrentView::dropEvent(), dropEvent(), and SettingsTree::event().

02974 {
02975     return QTreeView::event(e);
02976 }

Here is the call graph for this function:

QStringList QTreeWidget::mimeTypes (  )  const [protected, virtual]

Returns a list of MIME types that can be used to describe a list of treewidget items.

See also:
mimeData()

Definition at line 2816 of file qtreewidget.cpp.

References QAbstractItemView::model().

Referenced by QTreeModel::mimeTypes().

02817 {
02818     return model()->QAbstractItemModel::mimeTypes();
02819 }

Here is the call graph for this function:

QMimeData * QTreeWidget::mimeData ( const QList< QTreeWidgetItem * >  items  )  const [protected, virtual]

Returns an object that contains a serialized description of the specified items. The format used to describe the items is obtained from the mimeTypes() function.

If the list of items is empty, 0 is returned rather than a serialized empty list.

Definition at line 2829 of file qtreewidget.cpp.

Referenced by QTreeModel::mimeData().

02830 {
02831     return d_func()->model()->internalMimeData();
02832 }

bool QTreeWidget::dropMimeData ( QTreeWidgetItem parent,
int  index,
const QMimeData data,
Qt::DropAction  action 
) [protected, virtual]

Handles the data supplied by a drag and drop operation that ended with the given action in the index in the given parent item.

The default implementation returns true if the drop was successfully handled by decoding the mime data and inserting it into the model; otherwise it returns false.

See also:
supportedDropActions()

Definition at line 2844 of file qtreewidget.cpp.

References data, indexFromItem(), QAbstractItemView::model(), and QObject::parent().

Referenced by QTreeModel::dropMimeData().

02846 {
02847     QModelIndex idx;
02848     if (parent) idx = indexFromItem(parent);
02849     return model()->QAbstractItemModel::dropMimeData(data, action , index, 0, idx);
02850 }

Here is the call graph for this function:

Qt::DropActions QTreeWidget::supportedDropActions (  )  const [protected, virtual]

Returns the drop actions supported by this view.

See also:
Qt::DropActions

Definition at line 2857 of file qtreewidget.cpp.

References QAbstractItemView::model(), and Qt::MoveAction.

Referenced by QTreeModel::supportedDropActions().

02858 {
02859     return model()->QAbstractItemModel::supportedDropActions() | Qt::MoveAction;
02860 }

Here is the call graph for this function:

QList< QTreeWidgetItem * > QTreeWidget::items ( const QMimeData data  )  const [protected]

Returns a list of pointers to the items contained in the data object. If the object was not created by a QTreeWidget in the same process, the list is empty.

Definition at line 2868 of file qtreewidget.cpp.

References data, and QTreeWidgetMimeData::items.

Referenced by addTopLevelItems(), findItems(), insertTopLevelItems(), and selectedItems().

02869 {
02870     const QTreeWidgetMimeData *twd = qobject_cast<const QTreeWidgetMimeData*>(data);
02871     if (twd)
02872         return twd->items;
02873     return QList<QTreeWidgetItem*>();
02874 }

QModelIndex QTreeWidget::indexFromItem ( QTreeWidgetItem item,
int  column = 0 
) const [protected]

Returns the QModelIndex assocated with the given item in the given column.

See also:
itemFromIndex(), topLevelItem()

Definition at line 2881 of file qtreewidget.cpp.

References d.

Referenced by dropMimeData().

02882 {
02883     Q_D(const QTreeWidget);
02884     return d->index(item, column);
02885 }

QTreeWidgetItem * QTreeWidget::itemFromIndex ( const QModelIndex index  )  const [protected]

Returns a pointer to the QTreeWidgetItem assocated with the given index.

See also:
indexFromItem()

Definition at line 2892 of file qtreewidget.cpp.

References d, and index.

Referenced by dropEvent().

02893 {
02894     Q_D(const QTreeWidget);
02895     return d->item(index);
02896 }

void QTreeWidget::dropEvent ( QDropEvent event  )  [protected, virtual]

Reimplemented from QAbstractItemView.

Definition at line 2900 of file qtreewidget.cpp.

References QList< T >::append(), QList< T >::at(), QList< T >::contains(), Qt::CopyAction, QList< T >::count(), d, QAbstractItemView::dragDropMode(), QAbstractItemView::dropEvent(), event(), i, QAbstractItemModel::index(), insertTopLevelItem(), QAbstractItemView::InternalMove, itemFromIndex(), QAbstractItemView::model(), Qt::MoveAction, QObject::parent(), qMin(), QPersistentModelIndex::row(), row, QTreeView::selectedIndexes(), QList< T >::takeFirst(), takeTopLevelItem(), and topLevelItemCount().

02900                                              {
02901     Q_D(QTreeWidget);
02902     if (event->source() == this && (event->proposedAction() == Qt::MoveAction ||
02903                                     dragDropMode() == QAbstractItemView::InternalMove)) {
02904         QModelIndex topIndex;
02905         int col = -1;
02906         int row = -1;
02907         if (d->dropOn(event, &row, &col, &topIndex)) {
02908             QList<QModelIndex> idxs = selectedIndexes();
02909             QList<QPersistentModelIndex> indexes;
02910             for (int i = 0; i < idxs.count(); i++)
02911                 indexes.append(idxs.at(i));
02912 
02913             if (indexes.contains(topIndex))
02914                 return;
02915 
02916             // When removing items the drop location could shift
02917             QPersistentModelIndex dropRow = model()->index(row, col, topIndex);
02918 
02919             // Remove the items
02920             QList<QTreeWidgetItem *> taken;
02921             for (int i = indexes.count() - 1; i >= 0; --i) {
02922                 QTreeWidgetItem *parent = itemFromIndex(indexes.at(i));
02923                 if (!parent || !parent->parent()) {
02924                     taken.append(takeTopLevelItem(indexes.at(i).row()));
02925                 } else {
02926                     taken.append(parent->parent()->takeChild(indexes.at(i).row()));
02927                 }
02928             }
02929 
02930             // insert them back in at their new positions
02931             for (int i = 0; i < indexes.count(); ++i) {
02932                 // Either at a specific point or appended
02933                 if (row == -1) {
02934                     if (topIndex.isValid()) {
02935                         QTreeWidgetItem *parent = itemFromIndex(topIndex);
02936                         parent->insertChild(parent->childCount(), taken.takeFirst());
02937                     } else {
02938                         insertTopLevelItem(topLevelItemCount(), taken.takeFirst());
02939                     }
02940                 } else {
02941                     int r = dropRow.row() >= 0 ? dropRow.row() : row;
02942                     if (topIndex.isValid()) {
02943                         QTreeWidgetItem *parent = itemFromIndex(topIndex);
02944                         parent->insertChild(qMin(r, parent->childCount()), taken.takeFirst());
02945                     } else {
02946                         insertTopLevelItem(qMin(r, topLevelItemCount()), taken.takeFirst());
02947                     }
02948                 }
02949             }
02950 
02951             event->accept();
02952             // Don't want QAbstractItemView to delete it because it was "moved" we already did it
02953             event->setDropAction(Qt::CopyAction);
02954         }
02955     }
02956 
02957     QTreeView::dropEvent(event);
02958 }

Here is the call graph for this function:

void QTreeWidget::setModel ( QAbstractItemModel model  )  [private, virtual]

Reimplemented from QTreeView.

Definition at line 2965 of file qtreewidget.cpp.

02966 {
02967     qFatal("QTreeWidget::setModel() - Changing the model of the QTreeWidget is not allowed.");
02968 }

QTreeWidget::Q_PRIVATE_SLOT ( d_func()  ,
void   _q_emitItemPressed(const QModelIndex &index) 
) [private]

void QTreeWidget::_q_emitItemClicked ( const QModelIndex index  )  [private]

Referenced by QTreeWidget().

void void QTreeWidget::_q_emitItemDoubleClicked ( const QModelIndex index  )  [private]

Referenced by QTreeWidget().

void void void QTreeWidget::_q_emitItemActivated ( const QModelIndex index  )  [private]

Referenced by QTreeWidget().

void void void void QTreeWidget::_q_emitItemEntered ( const QModelIndex index  )  [private]

Referenced by QTreeWidget().

void void void void void QTreeWidget::_q_emitItemChanged ( const QModelIndex index  )  [private]

Referenced by QTreeWidget().

void void void void void void QTreeWidget::_q_emitItemExpanded ( const QModelIndex index  )  [private]

Referenced by QTreeWidget().

void void void void void void void QTreeWidget::_q_emitItemCollapsed ( const QModelIndex index  )  [private]

Referenced by QTreeWidget().

void void void void void void void void QTreeWidget::_q_emitCurrentItemChanged ( const QModelIndex previous,
const QModelIndex current 
) [private]

Referenced by QTreeWidget().

void void void void void void void void void QTreeWidget::_q_sort (  )  [private]

Referenced by QTreeWidget().


Friends And Related Function Documentation

friend class QTreeModel [friend]

Definition at line 231 of file qtreewidget.h.

Referenced by QTreeWidget().


The documentation for this class was generated from the following files:
Generated on Thu Mar 15 19:38:21 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1