The isSortingEnabled() function indicates whether sorting is enabled. Sorting can be enabled or disabled by calling setSortingEnabled(). If sorting is enabled, the user can sort the items by clicking on a column header. The items in the tree can be sorted by column according to a predefined sort order. 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 tree can have a header that contains a section for each column in the widget. The number of columns in use can be found with the columnCount() function. This allows each item to have one or more labels or other decorations. TreeWidget - >insertTopLevelItems( 0, items) īefore items can be added to the tree widget, the number of columns must be set with setColumnCount(). QTreeWidget *treeWidget = new QTreeWidget() įor ( int i = 0 i (nullptr), QStringList( QString( "item: %1"). VisualItemRect(const QTreeWidgetItem * item) const SortItems(int column, Qt::SortOrder order) SetItemWidget(QTreeWidgetItem * item, int column, QWidget * widget) SetHeaderLabels(const QStringList & labels) SetCurrentItem(QTreeWidgetItem * item, int column, QItemSelectionModel::SelectionFlags command) SetCurrentItem(QTreeWidgetItem * item, int column) RemoveItemWidget(QTreeWidgetItem * item, int column) OpenPersistentEditor(QTreeWidgetItem * item, int column = 0) ItemWidget(QTreeWidgetItem * item, int column) const ItemFromIndex(const QModelIndex & index) const ItemBelow(const QTreeWidgetItem * item) const ItemAbove(const QTreeWidgetItem * item) const IsPersistentEditorOpen(QTreeWidgetItem * item, int column = 0) const InsertTopLevelItems(int index, const QList & items) InsertTopLevelItem(int index, QTreeWidgetItem * item) IndexOfTopLevelItem(QTreeWidgetItem * item) const IndexFromItem(const QTreeWidgetItem * item, int column = 0) const ClosePersistentEditor(QTreeWidgetItem * item, int column = 0)ĮditItem(QTreeWidgetItem * item, int column = 0)įindItems(const QString & text, Qt::MatchFlags flags, int column = 0) const
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |