<class name="QTreeWidget" doc="/** <p>The <a href="QTreeWidget.html#QTreeWidget(com.trolltech.qt.gui.QWidget)"><tt>QTreeWidget</tt></a> class provides a tree view that uses a predefined tree model.</p> <p>The <a href="QTreeWidget.html#QTreeWidget(com.trolltech.qt.gui.QWidget)"><tt>QTreeWidget</tt></a> class is a convenience class that provides a standard tree widget with a classic item-based interface similar to that used by the <a href="QListView.html"><tt>QListView</tt></a> 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 <a href="QTreeWidgetItem.html"><tt>QTreeWidgetItem</tt></a>.</p> <p>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 <a href="QTreeView.html#QTreeView(com.trolltech.qt.gui.QWidget)"><tt>QTreeView</tt></a> with a standard item model. This allows the storage of data to be separated from its representation.</p> <p>In its simplest form, a tree widget can be constructed in the following way:</p> <pre> QTreeWidget *treeWidget = new QTreeWidget(); treeWidget-&gt;setColumnCount(1); QList&lt;QTreeWidgetItem *&gt; items; for (int i = 0; i &lt; 10; ++i) items.append(new QTreeWidgetItem((QTreeWidget*)0, QStringList(QString(&quot;item: %1&quot;).arg(i)))); treeWidget-&gt;insertTopLevelItems(0, items);</pre> <p>Before items can be added to the tree widget, the number of columns must be set with <a href="QTreeWidget.html#setColumnCount(int)"><tt>setColumnCount</tt></a>. This allows each item to have one or more labels or other decorations. The number of columns in use can be found with the <a href="QTreeWidget.html#columnCount()"><tt>columnCount</tt></a> function.</p> <p>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 <a href="QTreeWidget.html#setHeaderLabels(java.util.List<java.lang.String>)"><tt>setHeaderLabels</tt></a>, but a custom header can be constructed with a <a href="QTreeWidgetItem.html"><tt>QTreeWidgetItem</tt></a> and inserted into the tree with the <a href="QTreeWidget.html#setHeaderItem(com.trolltech.qt.gui.QTreeWidgetItem)"><tt>setHeaderItem</tt></a> function.</p> <p>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 <a href="QTreeView.html#setSortingEnabled(boolean)"><tt>setSortingEnabled</tt></a>. The <a href="QTreeView.html#isSortingEnabled()"><tt>isSortingEnabled</tt></a> function indicates whether sorting is enabled.</p> <p><table width="100%" align="center" cellpadding="2" cellspacing="1" border="0"> <tr valign="top" class="odd"><td><img src="%2E%2E/images/windowsxp-treeview.png" alt="Screenshot of a Windows XP style tree widget" /></td><td><img src="%2E%2E/images/macintosh-treeview.png" alt="Screenshot of a Macintosh style tree widget" /></td><td><img src="%2E%2E/images/plastique-treeview.png" alt="Screenshot of a Plastique style tree widget" /></td></tr> <tr valign="top" class="even"><td>A <a href="%2E%2E/gallery-windowsxp.html">Windows XP style</tt></a> tree widget.</td><td>A <a href="%2E%2E/gallery-macintosh.html">Macintosh style</tt></a> tree widget.</td><td>A <a href="%2E%2E/gallery-plastique.html">Plastique style</tt></a> tree widget.</td></tr> </table></p> @see <a href="QTreeWidgetItem.html"><tt>QTreeWidgetItem</tt></a> @see <a href="QTreeView.html#QTreeView(com.trolltech.qt.gui.QWidget)"><tt>QTreeView</tt></a> @see <a href="%2E%2E/model-view-programming.html">Model/View Programming</tt></a> @see Settings Editor Example</tt> */"> <signal name="protected final void activated(com.trolltech.qt.core.QModelIndex index)" doc="/** <p>This signal is emitted when the item specified by <tt>index</tt> is activated by the user. How to activate items depends on the platform; e.g&#x2e;, by single- or double-clicking the item, or by pressing the Return or Enter key when the item is current.</p> <dl> <dt><b>Compatible Slot Signatures:</b></dt> <dd><tt>void mySlot(com.trolltech.qt.core.QModelIndex index)</tt></dd> <dd><tt>void mySlot()</tt></dd> </dl> <dl> <dt><b>See Also:</b></dt> <dd><a href="QTreeWidget.html#clicked(com.trolltech.qt.core.QModelIndex)"><tt>clicked</tt></a>, <a href="QTreeWidget.html#doubleClicked(com.trolltech.qt.core.QModelIndex)"><tt>doubleClicked</tt></a>, <a href="QTreeWidget.html#entered(com.trolltech.qt.core.QModelIndex)"><tt>entered</tt></a>, <a href="QTreeWidget.html#pressed(com.trolltech.qt.core.QModelIndex)"><tt>pressed</tt></a></dd> </dl> */"/> <signal name="protected final void clicked(com.trolltech.qt.core.QModelIndex index)" doc="/** <p>This signal is emitted when a mouse button is clicked. The item the mouse was clicked on is specified by <tt>index</tt>. The signal is only emitted when the index is valid.</p> <dl> <dt><b>Compatible Slot Signatures:</b></dt> <dd><tt>void mySlot(com.trolltech.qt.core.QModelIndex index)</tt></dd> <dd><tt>void mySlot()</tt></dd> </dl> <dl> <dt><b>See Also:</b></dt> <dd><a href="QTreeWidget.html#activated(com.trolltech.qt.core.QModelIndex)"><tt>activated</tt></a>, <a href="QTreeWidget.html#doubleClicked(com.trolltech.qt.core.QModelIndex)"><tt>doubleClicked</tt></a>, <a href="QTreeWidget.html#entered(com.trolltech.qt.core.QModelIndex)"><tt>entered</tt></a>, <a href="QTreeWidget.html#pressed(com.trolltech.qt.core.QModelIndex)"><tt>pressed</tt></a></dd> </dl> */"/> <signal name="protected final void collapsed(com.trolltech.qt.core.QModelIndex index)" doc="/** <p>This signal is emitted when the item specified by <tt>index</tt> is collapsed.</p> <dl> <dt><b>Compatible Slot Signatures:</b></dt> <dd><tt>void mySlot(com.trolltech.qt.core.QModelIndex index)</tt></dd> <dd><tt>void mySlot()</tt></dd> </dl> */"/> <signal name="protected final void currentItemChanged(com.trolltech.qt.gui.QTreeWidgetItem current, com.trolltech.qt.gui.QTreeWidgetItem previous)" doc="/** <p>This signal is emitted when the current item changes. The current item is specified by <tt>current</tt>, and this replaces the <tt>previous</tt> current item.</p> <dl> <dt><b>Compatible Slot Signatures:</b></dt> <dd><tt>void mySlot(com.trolltech.qt.gui.QTreeWidgetItem current, com.trolltech.qt.gui.QTreeWidgetItem previous)</tt></dd> <dd><tt>void mySlot(com.trolltech.qt.gui.QTreeWidgetItem current)</tt></dd> <dd><tt>void mySlot()</tt></dd> </dl> <dl> <dt><b>See Also:</b></dt> <dd><a href="QTreeWidget.html#setCurrentItem(com.trolltech.qt.gui.QTreeWidgetItem)"><tt>setCurrentItem</tt></a></dd> </dl> */"/> <signal name="protected final void customContextMenuRequested(com.trolltech.qt.core.QPoint pos)" doc="/** <p>This signal is emitted when the widget's <a href="QWidget.html#contextMenuPolicy()"><tt>contextMenuPolicy</tt></a> is Qt::CustomContextMenu, and the user has requested a context menu on the widget. The position <tt>pos</tt> is the position of the context menu event that the widget receives. Normally this is in widget coordinates. The exception to this rule is <a href="QAbstractScrollArea.html#QAbstractScrollArea(com.trolltech.qt.gui.QWidget)"><tt>QAbstractScrollArea</tt></a> and its subclasses that map the context menu event to coordinates of the viewport()</tt> .</p> <dl> <dt><b>Compatible Slot Signatures:</b></dt> <dd><tt>void mySlot(com.trolltech.qt.core.QPoint pos)</tt></dd> <dd><tt>void mySlot()</tt></dd> </dl> <dl> <dt><b>See Also:</b></dt> <dd><a href="QWidget.html#mapToGlobal(com.trolltech.qt.core.QPoint)"><tt>mapToGlobal</tt></a>, <a href="QMenu.html"><tt>QMenu</tt></a>, <a href="QWidget.html#contextMenuPolicy()"><tt>contextMenuPolicy</tt></a></dd> </dl> */"/> <signal name="protected final void doubleClicked(com.trolltech.qt.core.QModelIndex index)" doc="/** <p>This signal is emitted when a mouse button is double-clicked. The item the mouse was double-clicked on is specified by <tt>index</tt>. The signal is only emitted when the index is valid.</p> <dl> <dt><b>Compatible Slot Signatures:</b></dt> <dd><tt>void mySlot(com.trolltech.qt.core.QModelIndex index)</tt></dd> <dd><tt>void mySlot()</tt></dd> </dl> <dl> <dt><b>See Also:</b></dt> <dd><a href="QTreeWidget.html#clicked(com.trolltech.qt.core.QModelIndex)"><tt>clicked</tt></a>, <a href="QTreeWidget.html#activated(com.trolltech.qt.core.QModelIndex)"><tt>activated</tt></a></dd> </dl> */"/> <signal name="protected final void entered(com.trolltech.qt.core.QModelIndex index)" doc="/** <p>This signal is emitted when the mouse cursor enters the item specified by <tt>index</tt>. Mouse tracking needs to be enabled for this feature to work.</p> <dl> <dt><b>Compatible Slot Signatures:</b></dt> <dd><tt>void mySlot(com.trolltech.qt.core.QModelIndex index)</tt></dd> <dd><tt>void mySlot()</tt></dd> </dl> <dl> <dt><b>See Also:</b></dt> <dd><a href="QTreeWidget.html#viewportEntered()"><tt>viewportEntered</tt></a>, <a href="QTreeWidget.html#activated(com.trolltech.qt.core.QModelIndex)"><tt>activated</tt></a>, <a href="QTreeWidget.html#clicked(com.trolltech.qt.core.QModelIndex)"><tt>clicked</tt></a>, <a href="QTreeWidget.html#doubleClicked(com.trolltech.qt.core.QModelIndex)"><tt>doubleClicked</tt></a>, <a href="QTreeWidget.html#pressed(com.trolltech.qt.core.QModelIndex)"><tt>pressed</tt></a></dd> </dl> */"/> <signal name="protected final void expanded(com.trolltech.qt.core.QModelIndex index)" doc="/** <p>This signal is emitted when the item specified by <tt>index</tt> is expanded.</p> <dl> <dt><b>Compatible Slot Signatures:</b></dt> <dd><tt>void mySlot(com.trolltech.qt.core.QModelIndex index)</tt></dd> <dd><tt>void mySlot()</tt></dd> </dl> */"/> <signal name="protected final void itemActivated(com.trolltech.qt.gui.QTreeWidgetItem item, int column)" doc="/** <p>This signal is emitted when the user activates an item by single- or double-clicking (depending on the platform, i.e&#x2e; on the QStyle::SH_ItemView_ActivateItemOnSingleClick style hint) or pressing a special key (e.g&#x2e;, <b>Enter</b>).</p> <p>The specified <tt>item</tt> is the item that was clicked, or 0 if no item was clicked. The <tt>column</tt> is the item's column that was clicked, or -1 if no item was clicked.</p> <dl> <dt><b>Compatible Slot Signatures:</b></dt> <dd><tt>void mySlot(com.trolltech.qt.gui.QTreeWidgetItem item, int column)</tt></dd> <dd><tt>void mySlot(com.trolltech.qt.gui.QTreeWidgetItem item)</tt></dd> <dd><tt>void mySlot()</tt></dd> </dl> */"/> <signal name="protected final void itemChanged(com.trolltech.qt.gui.QTreeWidgetItem item, int column)" doc="/** <p>This signal is emitted when the contents of the <tt>column</tt> in the specified <tt>item</tt> changes.</p> <dl> <dt><b>Compatible Slot Signatures:</b></dt> <dd><tt>void mySlot(com.trolltech.qt.gui.QTreeWidgetItem item, int column)</tt></dd> <dd><tt>void mySlot(com.trolltech.qt.gui.QTreeWidgetItem item)</tt></dd> <dd><tt>void mySlot()</tt></dd> </dl> */"/> <signal name="protected final void itemClicked(com.trolltech.qt.gui.QTreeWidgetItem item, int column)" doc="/** <p>This signal is emitted when the user clicks inside the widget.</p> <p>The specified <tt>item</tt> is the item that was clicked, or 0 if no item was clicked. The <tt>column</tt> is the item's column that was clicked, or -1 if no item was clicked.</p> <dl> <dt><b>Compatible Slot Signatures:</b></dt> <dd><tt>void mySlot(com.trolltech.qt.gui.QTreeWidgetItem item, int column)</tt></dd> <dd><tt>void mySlot(com.trolltech.qt.gui.QTreeWidgetItem item)</tt></dd> <dd><tt>void mySlot()</tt></dd> </dl> */"/> <signal name="protected final void itemCollapsed(com.trolltech.qt.gui.QTreeWidgetItem item)" doc="/** <p>This signal is emitted when the specified <tt>item</tt> is collapsed so that none of its children are displayed.</p> <dl> <dt><b>Compatible Slot Signatures:</b></dt> <dd><tt>void mySlot(com.trolltech.qt.gui.QTreeWidgetItem item)</tt></dd> <dd><tt>void mySlot()</tt></dd> </dl> <dl> <dt><b>See Also:</b></dt> <dd><tt>isItemExpanded</tt>, <a href="QTreeWidget.html#itemExpanded(com.trolltech.qt.gui.QTreeWidgetItem)"><tt>itemExpanded</tt></a>, <a href="QTreeWidget.html#collapseItem(com.trolltech.qt.gui.QTreeWidgetItem)"><tt>collapseItem</tt></a></dd> </dl> */"/> <signal name="protected final void itemDoubleClicked(com.trolltech.qt.gui.QTreeWidgetItem item, int column)" doc="/** <p>This signal is emitted when the user double clicks inside the widget.</p> <p>The specified <tt>item</tt> is the item that was clicked, or 0 if no item was clicked. The <tt>column</tt> is the item's column that was clicked, or -1 if no item was clicked.</p> <dl> <dt><b>Compatible Slot Signatures:</b></dt> <dd><tt>void mySlot(com.trolltech.qt.gui.QTreeWidgetItem item, int column)</tt></dd> <dd><tt>void mySlot(com.trolltech.qt.gui.QTreeWidgetItem item)</tt></dd> <dd><tt>void mySlot()</tt></dd> </dl> */"/> <signal name="protected final void itemEntered(com.trolltech.qt.gui.QTreeWidgetItem item, int column)" doc="/** <p>This signal is emitted when the mouse cursor enters an <tt>item</tt> over the specified <tt>column</tt>. <a href="QTreeWidget.html#QTreeWidget(com.trolltech.qt.gui.QWidget)"><tt>QTreeWidget</tt></a> mouse tracking needs to be enabled for this feature to work.</p> <dl> <dt><b>Compatible Slot Signatures:</b></dt> <dd><tt>void mySlot(com.trolltech.qt.gui.QTreeWidgetItem item, int column)</tt></dd> <dd><tt>void mySlot(com.trolltech.qt.gui.QTreeWidgetItem item)</tt></dd> <dd><tt>void mySlot()</tt></dd> </dl> */"/> <signal name="protected final void itemExpanded(com.trolltech.qt.gui.QTreeWidgetItem item)" doc="/** <p>This signal is emitted when the specified <tt>item</tt> is expanded so that all of its children are displayed.</p> <dl> <dt><b>Compatible Slot Signatures:</b></dt> <dd><tt>void mySlot(com.trolltech.qt.gui.QTreeWidgetItem item)</tt></dd> <dd><tt>void mySlot()</tt></dd> </dl> <dl> <dt><b>See Also:</b></dt> <dd><tt>isItemExpanded</tt>, <a href="QTreeWidget.html#itemCollapsed(com.trolltech.qt.gui.QTreeWidgetItem)"><tt>itemCollapsed</tt></a>, <a href="QTreeWidget.html#expandItem(com.trolltech.qt.gui.QTreeWidgetItem)"><tt>expandItem</tt></a></dd> </dl> */"/> <signal name="protected final void itemPressed(com.trolltech.qt.gui.QTreeWidgetItem item, int column)" doc="/** <p>This signal is emitted when the user presses a mouse button inside the widget.</p> <p>The specified <tt>item</tt> is the item that was clicked, or 0 if no item was clicked. The <tt>column</tt> is the item's column that was clicked, or -1 if no item was clicked.</p> <dl> <dt><b>Compatible Slot Signatures:</b></dt> <dd><tt>void mySlot(com.trolltech.qt.gui.QTreeWidgetItem item, int column)</tt></dd> <dd><tt>void mySlot(com.trolltech.qt.gui.QTreeWidgetItem item)</tt></dd> <dd><tt>void mySlot()</tt></dd> </dl> */"/> <signal name="protected final void itemSelectionChanged()" doc="/** <p>This signal is emitted when the selection changes in the tree widget. The current selection can be found with <a href="QTreeWidget.html#selectedItems()"><tt>selectedItems</tt></a>.</p> <dl> <dt><b>Compatible Slot Signature:</b></dt> <dd><tt>void mySlot()</tt></dd> </dl> */"/> <signal name="protected final void pressed(com.trolltech.qt.core.QModelIndex index)" doc="/** <p>This signal is emitted when a mouse button is pressed. The item the mouse was pressed on is specified by <tt>index</tt>. The signal is only emitted when the index is valid.</p> <dl> <dt><b>Compatible Slot Signatures:</b></dt> <dd><tt>void mySlot(com.trolltech.qt.core.QModelIndex index)</tt></dd> <dd><tt>void mySlot()</tt></dd> </dl> <dl> <dt><b>See Also:</b></dt> <dd><a href="QTreeWidget.html#activated(com.trolltech.qt.core.QModelIndex)"><tt>activated</tt></a>, <a href="QTreeWidget.html#clicked(com.trolltech.qt.core.QModelIndex)"><tt>clicked</tt></a>, <a href="QTreeWidget.html#doubleClicked(com.trolltech.qt.core.QModelIndex)"><tt>doubleClicked</tt></a>, <a href="QTreeWidget.html#entered(com.trolltech.qt.core.QModelIndex)"><tt>entered</tt></a></dd> </dl> */"/> <signal name="protected final void viewportEntered()" doc="/** <p>This signal is emitted when the mouse cursor enters the viewport. Mouse tracking needs to be enabled for this feature to work.</p> <dl> <dt><b>Compatible Slot Signature:</b></dt> <dd><tt>void mySlot()</tt></dd> </dl> <dl> <dt><b>See Also:</b></dt> <dd><a href="QTreeWidget.html#entered(com.trolltech.qt.core.QModelIndex)"><tt>entered</tt></a></dd> </dl> */"/> <method name="public QTreeWidget(com.trolltech.qt.gui.QWidget parent)" doc="/** <p>Constructs a tree widget with the given <tt>parent</tt>.</p> */"/> <method name="public QTreeWidget()" doc="/** <p>Equivalent to <a href="QTreeWidget.html#QTreeWidget(com.trolltech.qt.gui.QWidget)"><tt>QTreeWidget</tt></a>(0). */"/> <method name="public final void addTopLevelItem(com.trolltech.qt.gui.QTreeWidgetItem item)" doc="/** <p>Appends the <tt>item</tt> as a top-level item in the widget.</p> @see <a href="QTreeWidget.html#insertTopLevelItem(int, com.trolltech.qt.gui.QTreeWidgetItem)"><tt>insertTopLevelItem</tt></a> */"/> <method name="public final void addTopLevelItems(java.util.List<com.trolltech.qt.gui.QTreeWidgetItem> items)" doc="/** <p>Appends the list of <tt>items</tt> as a top-level items in the widget.</p> @see <a href="QTreeWidget.html#insertTopLevelItems(int, java.util.List<com.trolltech.qt.gui.QTreeWidgetItem>)"><tt>insertTopLevelItems</tt></a> */"/> <method name="public final void clear()" doc="/** <p>Clears the tree widget by removing all of its items and selections.</p> <p><b>Note:</b> 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.</p> @see <a href="QTreeWidget.html#takeTopLevelItem(int)"><tt>takeTopLevelItem</tt></a> @see <a href="QTreeWidget.html#topLevelItemCount()"><tt>topLevelItemCount</tt></a> @see <a href="QTreeWidget.html#columnCount()"><tt>columnCount</tt></a> */"/> <method name="public final void closePersistentEditor(com.trolltech.qt.gui.QTreeWidgetItem item, int column)" doc="/** <p>Closes the persistent editor for the <tt>item</tt> in the given <tt>column</tt>.</p> <p>This function has no effect if no persistent editor is open for this combination of item and column.</p> @see <a href="QTreeWidget.html#openPersistentEditor(com.trolltech.qt.gui.QTreeWidgetItem, int)"><tt>openPersistentEditor</tt></a> */"/> <method name="public final void closePersistentEditor(com.trolltech.qt.gui.QTreeWidgetItem item)" doc="/** <p>Equivalent to <a href="QTreeWidget.html#closePersistentEditor(com.trolltech.qt.gui.QTreeWidgetItem, int)"><tt>closePersistentEditor</tt></a>(<tt>item</tt>, 0). */"/> <method name="public final void collapseItem(com.trolltech.qt.gui.QTreeWidgetItem item)" doc="/** <p>Closes the <tt>item</tt>. This causes the tree containing the item's children to be collapsed.</p> @see <a href="QTreeWidget.html#expandItem(com.trolltech.qt.gui.QTreeWidgetItem)"><tt>expandItem</tt></a> @see <a href="QTreeWidget.html#currentItem()"><tt>currentItem</tt></a> @see <a href="QTreeWidget.html#itemAt(int, int)"><tt>itemAt</tt></a> @see <a href="QTreeWidget.html#topLevelItem(int)"><tt>topLevelItem</tt></a> */"/> <method name="public final int columnCount()" doc="/** <p>Returns the number of columns displayed in the tree widget.</p> @see <a href="QTreeWidget.html#setColumnCount(int)"><tt>setColumnCount</tt></a> */"/> <method name="public final int currentColumn()" doc="/** <p>Returns the current column in the tree widget.</p> @see <a href="QTreeWidget.html#setCurrentItem(com.trolltech.qt.gui.QTreeWidgetItem)"><tt>setCurrentItem</tt></a> @see <a href="QTreeWidget.html#columnCount()"><tt>columnCount</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QTreeWidgetItem currentItem()" doc="/** <p>Returns the current item in the tree widget.</p> @see <a href="QTreeWidget.html#setCurrentItem(com.trolltech.qt.gui.QTreeWidgetItem)"><tt>setCurrentItem</tt></a> @see <a href="QTreeWidget.html#currentItemChanged(com.trolltech.qt.gui.QTreeWidgetItem, com.trolltech.qt.gui.QTreeWidgetItem)"><tt>currentItemChanged</tt></a> */"/> <method name="public final void editItem(com.trolltech.qt.gui.QTreeWidgetItem item, int column)" doc="/** <p>Starts editing the <tt>item</tt> in the given <tt>column</tt> if it is editable.</p> */"/> <method name="public final void editItem(com.trolltech.qt.gui.QTreeWidgetItem item)" doc="/** <p>Equivalent to <a href="QTreeWidget.html#editItem(com.trolltech.qt.gui.QTreeWidgetItem, int)"><tt>editItem</tt></a>(<tt>item</tt>, 0). */"/> <method name="public final void expandItem(com.trolltech.qt.gui.QTreeWidgetItem item)" doc="/** <p>Expands the <tt>item</tt>. This causes the tree containing the item's children to be expanded.</p> @see <a href="QTreeWidget.html#collapseItem(com.trolltech.qt.gui.QTreeWidgetItem)"><tt>collapseItem</tt></a> @see <a href="QTreeWidget.html#currentItem()"><tt>currentItem</tt></a> @see <a href="QTreeWidget.html#itemAt(int, int)"><tt>itemAt</tt></a> @see <a href="QTreeWidget.html#topLevelItem(int)"><tt>topLevelItem</tt></a> @see <a href="QTreeWidget.html#itemExpanded(com.trolltech.qt.gui.QTreeWidgetItem)"><tt>itemExpanded</tt></a> */"/> <method name="public final java.util.List<com.trolltech.qt.gui.QTreeWidgetItem> findItems(java.lang.String text, com.trolltech.qt.core.Qt.MatchFlags flags, int column)" doc="/** <p>Returns a list of items that match the given <tt>text</tt>, using the given <tt>flags</tt>, in the given <tt>column</tt>.</p> */"/> <method name="public final java.util.List<com.trolltech.qt.gui.QTreeWidgetItem> findItems(java.lang.String text, com.trolltech.qt.core.Qt.MatchFlags flags)" doc="/** <p>Equivalent to <a href="QTreeWidget.html#findItems(java.lang.String, com.trolltech.qt.core.Qt.MatchFlags, int)"><tt>findItems</tt></a>(<tt>text</tt>, <tt>flags</tt>, 0). */"/> <method name="public final com.trolltech.qt.gui.QTreeWidgetItem headerItem()" doc="/** <p>Returns the item used for the tree widget's header.</p> @see <a href="QTreeWidget.html#setHeaderItem(com.trolltech.qt.gui.QTreeWidgetItem)"><tt>setHeaderItem</tt></a> */"/> <method name="protected final com.trolltech.qt.core.QModelIndex indexFromItem(com.trolltech.qt.gui.QTreeWidgetItem item, int column)" doc="/** <p>Returns the QModelIndex assocated with the given <tt>item</tt> in the given <tt>column</tt>.</p> @see <a href="QTreeWidget.html#itemFromIndex(com.trolltech.qt.core.QModelIndex)"><tt>itemFromIndex</tt></a> @see <a href="QTreeWidget.html#topLevelItem(int)"><tt>topLevelItem</tt></a> */"/> <method name="protected final com.trolltech.qt.core.QModelIndex indexFromItem(com.trolltech.qt.gui.QTreeWidgetItem item)" doc="/** <p>Equivalent to <a href="QTreeWidget.html#indexFromItem(com.trolltech.qt.gui.QTreeWidgetItem, int)"><tt>indexFromItem</tt></a>(<tt>item</tt>, 0). */"/> <method name="public final int indexOfTopLevelItem(com.trolltech.qt.gui.QTreeWidgetItem item)" doc="/** <p>Returns the index of the given top-level <tt>item</tt>, or -1 if the item cannot be found.</p> @see <a href="QTreeWidget.html#sortItems(int, com.trolltech.qt.core.Qt.SortOrder)"><tt>sortItems</tt></a> @see <a href="QTreeWidget.html#topLevelItemCount()"><tt>topLevelItemCount</tt></a> */"/> <method name="public final void insertTopLevelItem(int index, com.trolltech.qt.gui.QTreeWidgetItem item)" doc="/** <p>Inserts the <tt>item</tt> at <tt>index</tt> in the top level in the view.</p> <p>If the item has already been inserted somewhere else it wont be inserted.</p> @see <a href="QTreeWidget.html#addTopLevelItem(com.trolltech.qt.gui.QTreeWidgetItem)"><tt>addTopLevelItem</tt></a> @see <a href="QTreeWidget.html#columnCount()"><tt>columnCount</tt></a> */"/> <method name="public final void insertTopLevelItems(int index, java.util.List<com.trolltech.qt.gui.QTreeWidgetItem> items)" doc="/** <p>Inserts the list of <tt>items</tt> at <tt>index</tt> in the top level in the view.</p> <p>Items that have already been inserted somewhere else wont be inserted.</p> @see <a href="QTreeWidget.html#addTopLevelItems(java.util.List<com.trolltech.qt.gui.QTreeWidgetItem>)"><tt>addTopLevelItems</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QTreeWidgetItem invisibleRootItem()" doc="/** <p>Returns the tree widget's invisible root item.</p> <p>The invisible root item provides access to the tree widget's top-level items through the <a href="QTreeWidgetItem.html"><tt>QTreeWidgetItem</tt></a> API, making it possible to write functions that can treat top-level items and their children in a uniform way; for example, recursive functions.</p> */"/> <method name="public final boolean isFirstItemColumnSpanned(com.trolltech.qt.gui.QTreeWidgetItem item)" doc="/** <p>Returns true if the given <tt>item</tt> is set to show only one section over all columns; otherwise returns false.</p> @see <a href="QTreeWidget.html#setFirstItemColumnSpanned(com.trolltech.qt.gui.QTreeWidgetItem, boolean)"><tt>setFirstItemColumnSpanned</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QTreeWidgetItem itemAbove(com.trolltech.qt.gui.QTreeWidgetItem item)" doc="/** <p>Returns the item above the given <tt>item</tt>.</p> */"/> <method name="public final com.trolltech.qt.gui.QTreeWidgetItem itemAt(com.trolltech.qt.core.QPoint p)" doc="/** <p>Returns a pointer to the item at the coordinates <tt>p</tt>.</p> @see <a href="QTreeWidget.html#visualItemRect(com.trolltech.qt.gui.QTreeWidgetItem)"><tt>visualItemRect</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QTreeWidgetItem itemAt(int x, int y)" doc="/** <p>Returns a pointer to the item at the coordinates (<tt>x</tt>, <tt>y</tt>).</p> */"/> <method name="public final com.trolltech.qt.gui.QTreeWidgetItem itemBelow(com.trolltech.qt.gui.QTreeWidgetItem item)" doc="/** <p>Returns the item below the given<tt>item</tt>.</p> */"/> <method name="protected final com.trolltech.qt.gui.QTreeWidgetItem itemFromIndex(com.trolltech.qt.core.QModelIndex index)" doc="/** <p>Returns a pointer to the <a href="QTreeWidgetItem.html"><tt>QTreeWidgetItem</tt></a> assocated with the given <tt>index</tt>.</p> @see <a href="QTreeWidget.html#indexFromItem(com.trolltech.qt.gui.QTreeWidgetItem, int)"><tt>indexFromItem</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QWidget itemWidget(com.trolltech.qt.gui.QTreeWidgetItem item, int column)" doc="/** <p>Returns the widget displayed in the cell specified by <tt>item</tt> and the given <tt>column</tt>.</p> @see <a href="QTreeWidget.html#setItemWidget(com.trolltech.qt.gui.QTreeWidgetItem, int, com.trolltech.qt.gui.QWidget)"><tt>setItemWidget</tt></a> */"/> <method name="public final void openPersistentEditor(com.trolltech.qt.gui.QTreeWidgetItem item, int column)" doc="/** <p>Opens a persistent editor for the <tt>item</tt> in the given <tt>column</tt>.</p> @see <a href="QTreeWidget.html#closePersistentEditor(com.trolltech.qt.gui.QTreeWidgetItem, int)"><tt>closePersistentEditor</tt></a> */"/> <method name="public final void openPersistentEditor(com.trolltech.qt.gui.QTreeWidgetItem item)" doc="/** <p>Equivalent to <a href="QTreeWidget.html#openPersistentEditor(com.trolltech.qt.gui.QTreeWidgetItem, int)"><tt>openPersistentEditor</tt></a>(<tt>item</tt>, 0). */"/> <method name="public final void removeItemWidget(com.trolltech.qt.gui.QTreeWidgetItem item, int column)" doc="/** <p>Removes the widget set in the given <tt>item</tt> in the given <tt>column</tt>.</p> */"/> <method name="public final void scrollToItem(com.trolltech.qt.gui.QTreeWidgetItem item, com.trolltech.qt.gui.QAbstractItemView.ScrollHint hint)" doc="/** <p>Ensures that the <tt>item</tt> is visible, scrolling the view if necessary using the specified <tt>hint</tt>.</p> @see <a href="QTreeWidget.html#currentItem()"><tt>currentItem</tt></a> @see <a href="QTreeWidget.html#itemAt(int, int)"><tt>itemAt</tt></a> @see <a href="QTreeWidget.html#topLevelItem(int)"><tt>topLevelItem</tt></a> */"/> <method name="public final void scrollToItem(com.trolltech.qt.gui.QTreeWidgetItem item)" doc="/** <p>Equivalent to <a href="QTreeWidget.html#scrollToItem(com.trolltech.qt.gui.QTreeWidgetItem, com.trolltech.qt.gui.QAbstractItemView.ScrollHint)"><tt>scrollToItem</tt></a>(<tt>item</tt>, EnsureVisible). */"/> <method name="public final java.util.List<com.trolltech.qt.gui.QTreeWidgetItem> selectedItems()" doc="/** <p>Returns a list of all selected non-hidden items.</p> @see <a href="QTreeWidget.html#itemSelectionChanged()"><tt>itemSelectionChanged</tt></a> */"/> <method name="public final void setColumnCount(int columns)" doc="/** <p>Sets the number of columns displayed in the tree widget to <tt>columns</tt>.</p> @see <a href="QTreeWidget.html#columnCount()"><tt>columnCount</tt></a> */"/> <method name="public final void setCurrentItem(com.trolltech.qt.gui.QTreeWidgetItem item, int column)" doc="/** <p>Sets the current <tt>item</tt> in the tree widget and the curernt column to <tt>column</tt>.</p> @see <a href="QTreeWidget.html#currentItem()"><tt>currentItem</tt></a> */"/> <method name="public final void setCurrentItem(com.trolltech.qt.gui.QTreeWidgetItem item)" doc="/** <p>Sets the current <tt>item</tt> in the tree widget.</p> <p>Depending on the current selection mode, the item may also be selected.</p> @see <a href="QTreeWidget.html#currentItem()"><tt>currentItem</tt></a> @see <a href="QTreeWidget.html#currentItemChanged(com.trolltech.qt.gui.QTreeWidgetItem, com.trolltech.qt.gui.QTreeWidgetItem)"><tt>currentItemChanged</tt></a> */"/> <method name="public final void setFirstItemColumnSpanned(com.trolltech.qt.gui.QTreeWidgetItem item, boolean span)" doc="/** <p>Sets the given <tt>item</tt> to only show one section for all columns if <tt>span</tt> is true; otherwise the item will show one section per column.</p> @see <a href="QTreeWidget.html#isFirstItemColumnSpanned(com.trolltech.qt.gui.QTreeWidgetItem)"><tt>isFirstItemColumnSpanned</tt></a> */"/> <method name="public final void setHeaderItem(com.trolltech.qt.gui.QTreeWidgetItem item)" doc="/** <p>Sets the header <tt>item</tt> for the tree widget. The label for each column in the header is supplied by the corresponding label in the item.</p> <p>The tree widget takes ownership of the item.</p> @see <a href="QTreeWidget.html#headerItem()"><tt>headerItem</tt></a> @see <a href="QTreeWidget.html#setHeaderLabels(java.util.List<java.lang.String>)"><tt>setHeaderLabels</tt></a> */"/> <method name="public final void setHeaderLabel(java.lang.String label)" doc="/** <p>Same as <a href="QTreeWidget.html#setHeaderLabels(java.util.List<java.lang.String>)"><tt>setHeaderLabels</tt></a>(<a href="%2E%2E/porting4.html#qstringlist"><tt>QStringList</tt></a>(<tt>label</tt>)).</p> */"/> <method name="public final void setHeaderLabels(java.util.List<java.lang.String> labels)" doc="/** <p>Adds a column in the header for each item in the <tt>labels</tt> list, and sets the label for each column.</p> <p>Note that <a href="QTreeWidget.html#setHeaderLabels(java.util.List<java.lang.String>)"><tt>setHeaderLabels</tt></a> won't remove existing columns.</p> @see <a href="QTreeWidget.html#setHeaderItem(com.trolltech.qt.gui.QTreeWidgetItem)"><tt>setHeaderItem</tt></a> @see <a href="QTreeWidget.html#setHeaderLabel(java.lang.String)"><tt>setHeaderLabel</tt></a> */"/> <method name="public final void setItemWidget(com.trolltech.qt.gui.QTreeWidgetItem item, int column, com.trolltech.qt.gui.QWidget widget)" doc="/** <p>Sets the given <tt>widget</tt> to be displayed in the cell specified by the given <tt>item</tt> and <tt>column</tt>.</p> <p>Note that the given <tt>widget</tt>'s <a href="QWidget.html#QWidget(com.trolltech.qt.gui.QWidget, com.trolltech.qt.core.Qt.WindowFlags)">autoFillBackground</a> property must be set to true, otherwise the widget's background will be transparent, showing both the model data and the tree widget item.</p> <p>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 <a href="QTreeView.html#QTreeView(com.trolltech.qt.gui.QWidget)"><tt>QTreeView</tt></a> and subclass <a href="QItemDelegate.html"><tt>QItemDelegate</tt></a> instead.</p> @see <a href="QTreeWidget.html#itemWidget(com.trolltech.qt.gui.QTreeWidgetItem, int)"><tt>itemWidget</tt></a> @see <a href="%2E%2E/model-view-delegate.html">Delegate Classes</tt></a> */"/> <method name="public @Deprecated public final void setModel(com.trolltech.qt.core.QAbstractItemModel model)" doc="/** <p>This function is reimplemented for internal reasons.</p> */"/> <method name="public final int sortColumn()" doc="/** <p>Returns the column used to sort the contents of the widget.</p> @see <a href="QTreeWidget.html#sortItems(int, com.trolltech.qt.core.Qt.SortOrder)"><tt>sortItems</tt></a> */"/> <method name="public final void sortItems(int column, com.trolltech.qt.core.Qt.SortOrder order)" doc="/** <p>Sorts the items in the widget in the specified <tt>order</tt> by the values in the given <tt>column</tt>.</p> @see <a href="QTreeWidget.html#sortColumn()"><tt>sortColumn</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QTreeWidgetItem takeTopLevelItem(int index)" doc="/** <p>Removes the top-level item at the given <tt>index</tt> in the tree and returns it, otherwise returns 0;</p> @see <a href="QTreeWidget.html#insertTopLevelItem(int, com.trolltech.qt.gui.QTreeWidgetItem)"><tt>insertTopLevelItem</tt></a> @see <a href="QTreeWidget.html#topLevelItem(int)"><tt>topLevelItem</tt></a> @see <a href="QTreeWidget.html#topLevelItemCount()"><tt>topLevelItemCount</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QTreeWidgetItem topLevelItem(int index)" doc="/** <p>Returns the top level item at the given <tt>index</tt>, or 0 if the item does not exist.</p> @see <a href="QTreeWidget.html#topLevelItemCount()"><tt>topLevelItemCount</tt></a> @see <a href="QTreeWidget.html#insertTopLevelItem(int, com.trolltech.qt.gui.QTreeWidgetItem)"><tt>insertTopLevelItem</tt></a> */"/> <method name="public final int topLevelItemCount()" doc="/** <p>Returns the number of top-level items.</p> @see <a href="QTreeWidget.html#columnCount()"><tt>columnCount</tt></a> @see <a href="QTreeWidget.html#currentItem()"><tt>currentItem</tt></a> */"/> <method name="public final com.trolltech.qt.core.QRect visualItemRect(com.trolltech.qt.gui.QTreeWidgetItem item)" doc="/** <p>Returns the rectangle on the viewport occupied by the item at <tt>item</tt>.</p> @see <a href="QTreeWidget.html#itemAt(int, int)"><tt>itemAt</tt></a> */"/> <method name="protected void dropEvent(com.trolltech.qt.gui.QDropEvent event)" doc="/** <p>This function is reimplemented for internal reasons.</p> */"/> <method name="protected boolean dropMimeData(com.trolltech.qt.gui.QTreeWidgetItem parent, int index, com.trolltech.qt.gui.QMimeData data, com.trolltech.qt.core.Qt.DropAction action)" doc="/** <p>Handles the <tt>data</tt> supplied by a drag and drop operation that ended with the given <tt>action</tt> in the <tt>index</tt> in the given <tt>parent</tt> item.</p> <p>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.</p> @see <a href="QTreeWidget.html#supportedDropActions()"><tt>supportedDropActions</tt></a> */"/> <method name="public boolean event(com.trolltech.qt.core.QEvent e)" doc="/** <p>This function is reimplemented for internal reasons.</p> */"/> <method name="protected com.trolltech.qt.gui.QMimeData mimeData(java.util.List<com.trolltech.qt.gui.QTreeWidgetItem> items)" doc="/** <p>Returns an object that contains a serialized description of the specified <tt>items</tt>. The format used to describe the items is obtained from the <a href="QTreeWidget.html#mimeTypes()"><tt>mimeTypes</tt></a> function.</p> <p>If the list of items is empty, 0 is returned rather than a serialized empty list.</p> */"/> <method name="protected java.util.List<java.lang.String> mimeTypes()" doc="/** <p>Returns a list of MIME types that can be used to describe a list of treewidget items.</p> @see <a href="QTreeWidget.html#mimeData(java.util.List<com.trolltech.qt.gui.QTreeWidgetItem>)"><tt>mimeData</tt></a> */"/> <method name="protected com.trolltech.qt.core.Qt.DropActions supportedDropActions()" doc="/** <p>Returns the drop actions supported by this view.</p> @see <tt>Qt::DropActions</tt> */"/> </class>