QTreeWidget Class Reference |
A Windows XP style tree widget. | A Macintosh style tree widget. | A Plastique style tree widget. |
See also QTreeWidgetItem, QTreeView, and Model/View Programming.
This property holds the number of columns displayed in the tree widget.
Access functions:
This property holds whether the items in the tree widget can be sorted by clicking on the header.
Access functions:
This property holds the number of top-level items.
Access functions:
See also columnCount() and currentItem().
Constructs a tree widget with the given parent.
Destroys the tree widget and all its items.
Appends the item as a top-level item in the widget.
This function was introduced in Qt 4.1.
See also insertTopLevelItem().
Appends the list of items as a top-level items in the widget.
See also insertTopLevelItems().
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(), and columnCount().
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().
Closes the item. This causes the tree containing the item's children to be collapsed.
See also expandItem(), currentItem(), itemAt(), and topLevelItem().
Returns the current column in the tree widget.
This function was introduced in Qt 4.1.
See also setCurrentItem() and columnCount().
Returns the current item in the tree widget.
See also setCurrentItem() and currentItemChanged().
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().
Handles the data supplied by a drag and drop operation that ended with the given action in the index in the given parent item.
See also supportedDropActions().
Starts editing the item in the given column if it is editable.
Expands the item. This causes the tree containing the item's children to be expanded.
See also collapseItem(), currentItem(), itemAt(), topLevelItem(), and itemExpanded().
Returns a list of items that match the given text, using the given flags, in the given column.
Returns the item used for the tree widget's header.
See also setHeaderItem().
Returns the QModelIndex assocated with the given item in the given column.
See also itemFromIndex() and topLevelItem().
Returns the index of the given top-level item, or -1 if the item cannot be found.
See also sortItems() and topLevelItemCount().
Inserts the item at index in the top level in the view.
See also addTopLevelItem() and columnCount().
Inserts the list of items at index in the top level in the view.
This function was introduced in Qt 4.1.
See also addTopLevelItems().
Returns true if the given item is open; otherwise returns false.
See also itemExpanded().
Returns true if the item is explicitly hidden, otherwise returns false.
Returns true if the item is selected; otherwise returns false.
See also itemSelectionChanged().
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.
Returns a pointer to the item at the coordinates p.
See also visualItemRect().
This is an overloaded member function, provided for convenience.
Returns a pointer to the item at the coordinates (x, y).
This signal is emitted when the contents of the column in the specified item changes.
This signal is emitted when the user clicks inside the widget. The specified item is the item that was clicked.
This signal is emitted when the specified item is collapsed so that none of its children are displayed.
See also isItemExpanded().
This signal is emitted when the user double clicks inside the widget. The specified item is the item that was clicked.
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.
This signal is emitted when the specified item is expanded so that all of its children are displayed.
See also setItemExpanded() and isItemExpanded().
Returns a pointer to the QTreeWidgetItem assocated with the given index.
See also indexFromItem().
This signal is emitted when the user presses a mouse button inside the widget. The specified item is the item that was clicked.
This signal is emitted when the selection changes in the tree widget. The current selection can be found with selectedItems().
Returns the widget displayed in the cell specified by item and the given column.
This function was introduced in Qt 4.1.
See also setItemWidget().
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.
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.
Returns a list of MIME types that can be used to describe a list of treewidget items.
See also mimeData().
Opens a persistent editor for the item in the given column.
See also closePersistentEditor().
Returns a list of all selected non-hidden items.
See also itemSelectionChanged().
Sets the current item in the tree widget.
Depending on the current selection mode, the item may also be selected.
See also currentItem() and currentItemChanged().
This is an overloaded member function, provided for convenience.
Sets the current item in the tree widget and the curernt column to column.
This function was introduced in Qt 4.1.
See also currentItem().
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.
See also headerItem() and setHeaderLabels().
Adds a column in the header for each item in the labels list, and sets the label for each column.
Note that setHeaderLabels wont remove existing columns.
See also setHeaderItem().
Sets the item referred to by item to either closed or opened, depending on the value of expand.
See also expandItem(), collapseItem(), and itemExpanded().
Hides the given item if hide is true; otherwise shows the item.
See also isItemHidden() and itemChanged().
If select is true, the given item is selected; otherwise it is deselected.
See also isItemSelected() and itemSelectionChanged().
Sets the widget to be displayed in the cell specified by item and the given column.
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.
This function was introduced in Qt 4.1.
See also itemWidget() and Delegate Classes.
Returns the column used to sort the contents of the widget.
This function was introduced in Qt 4.1.
See also sortItems().
Sorts the items in the widget in the specified order by the values in the given column.
See also sortColumn().
Returns the drop actions supported by this view.
See also Qt::DropActions.
Removes the top-level item at the given index in the tree and returns it, otherwise returns 0;
See also insertTopLevelItem(), topLevelItem(), and topLevelItemCount().
Returns the top level item at the given index, or 0 if the item does not exist.
See also topLevelItemCount() and insertTopLevelItem().
Returns the rectangle on the viewport occupied by the item at item.
See also itemAt().
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. | Qt 4.1 | |
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD. | ||
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP ! |
Copyright © 2000-2012 - www.developpez.com