![]() Moves the cursor to the item in the same column on the previous row. QTreeView supports a set of key bindings that enable the user to navigate in the view and interact with the contents of items: For more information about rearranging sections, see Moving Header Sections. To disable movement of these columns, use QHeaderView's setSectionsMovable() function. If this value is set to true, this property will override the resize mode set on the last section in the header.īy default, all columns in a tree view are movable except the first. Note that each header is configured with its stretchLastSection property set to true, ensuring that the view does not waste any of the space assigned to it for its header. 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 |