![]() Headers in tree views are constructed using the QHeaderView class and can be hidden using header()->hide(). The amount of indentation used to indicate levels of hierarchy is controlled by the indentation property. When this state changes a collapsed() or expanded() signal is emitted with the model index of the relevant item. Items that have children can be in an expanded (children are visible) or collapsed (children are hidden) state. The model/view architecture ensures that the contents of the tree view are updated as the model changes. QTreeView *tree = new QTreeView(splitter) Model - >setRootPath( QDir ::currentPath()) QFileSystemModel *model = new QFileSystemModel VisualRegionForSelection(const QItemSelection & selection) const override SizeHintForColumn(int column) const override SetSelection(const QRect & rect, QItemSelectionModel::SelectionFlags command) override SelectionChanged(const QItemSelection & selected, const QItemSelection & deselected) override ScrollContentsBy(int dx, int dy) override RowsInserted(const QModelIndex & parent, int start, int end) override RowsAboutToBeRemoved(const QModelIndex & parent, int start, int end) override MoveCursor(QAbstractItemView::CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override MouseReleaseEvent(QMouseEvent * event) override MousePressEvent(QMouseEvent * event) override MouseMoveEvent(QMouseEvent * event) override MouseDoubleClickEvent(QMouseEvent * event) override KeyPressEvent(QKeyEvent * event) override IsIndexHidden(const QModelIndex & index) const override SetRowHidden(int row, const QModelIndex & parent, bool hide)ĬurrentChanged(const QModelIndex & current, const QModelIndex & previous) overrideĭragMoveEvent(QDragMoveEvent * event) override SetFirstColumnSpanned(int row, const QModelIndex & parent, bool span) SetExpanded(const QModelIndex & index, bool expanded) IsRowHidden(int row, const QModelIndex & parent) const IsFirstColumnSpanned(int row, const QModelIndex & parent) const ![]() IsExpanded(const QModelIndex & index) const IndexBelow(const QModelIndex & index) const IndexAbove(const QModelIndex & index) const
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |