[][src]Struct qt_widgets::QTreeView

#[repr(C)]pub struct QTreeView { /* fields omitted */ }

The QTreeView class provides a default model/view implementation of a tree view.

C++ class: QTreeView.

C++ documentation:

The QTreeView class provides a default model/view implementation of a tree view.

A QTreeView implements a tree representation of items from a model. This class is used to provide standard hierarchical lists that were previously provided by the QListView class, but using the more flexible approach provided by Qt's model/view architecture.

The QTreeView class is one of the Model/View Classes and is part of Qt's model/view framework.

QTreeView implements the interfaces defined by the QAbstractItemView class to allow it to display data provided by models derived from the QAbstractItemModel class.

It is simple to construct a tree view displaying data from a model. In the following example, the contents of a directory are supplied by a QFileSystemModel and displayed as a tree:

QFileSystemModel model = new QFileSystemModel; model->setRootPath(QDir::currentPath()); QTreeView tree = new QTreeView(splitter); tree->setModel(model);

The model/view architecture ensures that the contents of the tree view are updated as the model changes.

Items that have children can be in an expanded (children are visible) or collapsed (children are hidden) state. When this state changes a collapsed() or expanded() signal is emitted with the model index of the relevant item.

The amount of indentation used to indicate levels of hierarchy is controlled by the indentation property.

Headers in tree views are constructed using the QHeaderView class and can be hidden using header()->hide(). 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. If this value is set to true, this property will override the resize mode set on the last section in the header.

By default, all columns in a tree view are movable except the first. To disable movement of these columns, use QHeaderView's setSectionsMovable() function. For more information about rearranging sections, see Moving Header Sections.

Methods

impl QTreeView[src]

pub fn expanded(&self) -> Signal<(*const QModelIndex,)>[src]

This signal is emitted when the item specified by index is expanded.

Returns a built-in Qt signal QTreeView::expanded that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted when the item specified by index is expanded.

See also setExpanded().

pub fn collapsed(&self) -> Signal<(*const QModelIndex,)>[src]

This signal is emitted when the item specified by index is collapsed.

Returns a built-in Qt signal QTreeView::collapsed that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted when the item specified by index is collapsed.

pub fn slot_hide_column(&self) -> Receiver<(c_int,)>[src]

Hides the column given.

Returns a built-in Qt slot QTreeView::hideColumn that can be passed to qt_core::Signal::connect.

C++ documentation:

Hides the column given.

Note: This function should only be called after the model has been initialized, as the view needs to know the number of columns in order to hide column.

See also showColumn() and setColumnHidden().

pub fn slot_show_column(&self) -> Receiver<(c_int,)>[src]

Shows the given column in the tree view.

Returns a built-in Qt slot QTreeView::showColumn that can be passed to qt_core::Signal::connect.

C++ documentation:

Shows the given column in the tree view.

See also hideColumn() and setColumnHidden().

pub fn slot_expand(&self) -> Receiver<(*const QModelIndex,)>[src]

Expands the model item specified by the index.

Returns a built-in Qt slot QTreeView::expand that can be passed to qt_core::Signal::connect.

C++ documentation:

Expands the model item specified by the index.

See also expanded().

pub fn slot_collapse(&self) -> Receiver<(*const QModelIndex,)>[src]

Collapses the model item specified by the index.

Returns a built-in Qt slot QTreeView::collapse that can be passed to qt_core::Signal::connect.

C++ documentation:

Collapses the model item specified by the index.

See also collapsed().

pub fn slot_resize_column_to_contents(&self) -> Receiver<(c_int,)>[src]

Resizes the column given to the size of its contents.

Returns a built-in Qt slot QTreeView::resizeColumnToContents that can be passed to qt_core::Signal::connect.

C++ documentation:

Resizes the column given to the size of its contents.

See also columnWidth(), setColumnWidth(), sizeHintForColumn(), and QHeaderView::resizeContentsPrecision().

pub fn slot_sort_by_column(&self) -> Receiver<(c_int,)>[src]

Sets the model up for sorting by the values in the given column and order.

Returns a built-in Qt slot QTreeView::sortByColumn that can be passed to qt_core::Signal::connect.

Warning: no exact match found in C++ documentation. Below is the C++ documentation for void QTreeView::sortByColumn(int column, Qt::SortOrder order):

Sets the model up for sorting by the values in the given column and order.

column may be -1, in which case no sort indicator will be shown and the model will return to its natural, unsorted order. Note that not all models support this and may even crash in this case.

This function was introduced in Qt 4.2.

See also sortingEnabled.

pub fn slot_expand_all(&self) -> Receiver<()>[src]

Expands all expandable items.

Returns a built-in Qt slot QTreeView::expandAll that can be passed to qt_core::Signal::connect.

C++ documentation:

Expands all expandable items.

Warning: if the model contains a large number of items, this function will take some time to execute.

This function was introduced in Qt 4.2.

See also collapseAll(), expand(), collapse(), and setExpanded().

pub fn slot_collapse_all(&self) -> Receiver<()>[src]

Collapses all expanded items.

Returns a built-in Qt slot QTreeView::collapseAll that can be passed to qt_core::Signal::connect.

C++ documentation:

Collapses all expanded items.

This function was introduced in Qt 4.2.

See also expandAll(), expand(), collapse(), and setExpanded().

pub fn slot_expand_to_depth(&self) -> Receiver<(c_int,)>[src]

Expands all expandable items to the given depth.

Returns a built-in Qt slot QTreeView::expandToDepth that can be passed to qt_core::Signal::connect.

C++ documentation:

Expands all expandable items to the given depth.

This function was introduced in Qt 4.3.

See also expandAll(), collapseAll(), expand(), collapse(), and setExpanded().

pub fn slot_column_resized(&self) -> Receiver<(c_int, c_int, c_int)>[src]

This function is called whenever column's size is changed in the header. oldSize and newSize give the previous size and the new size in pixels.

Returns a built-in Qt slot QTreeView::columnResized that can be passed to qt_core::Signal::connect.

C++ documentation:

This function is called whenever column's size is changed in the header. oldSize and newSize give the previous size and the new size in pixels.

See also setColumnWidth().

pub fn slot_column_count_changed(&self) -> Receiver<(c_int, c_int)>[src]

Informs the tree view that the number of columns in the tree view has changed from oldCount to newCount.

Returns a built-in Qt slot QTreeView::columnCountChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

Informs the tree view that the number of columns in the tree view has changed from oldCount to newCount.

pub fn slot_column_moved(&self) -> Receiver<()>[src]

This slot is called whenever a column has been moved.

Returns a built-in Qt slot QTreeView::columnMoved that can be passed to qt_core::Signal::connect.

C++ documentation:

This slot is called whenever a column has been moved.

pub fn slot_reexpand(&self) -> Receiver<()>[src]

Returns a built-in Qt slot QTreeView::reexpand that can be passed to qt_core::Signal::connect.

pub fn slot_rows_removed(&self) -> Receiver<(*const QModelIndex, c_int, c_int)>[src]

Informs the view that the rows from the start row to the end row inclusive have been removed from the given parent model item.

Returns a built-in Qt slot QTreeView::rowsRemoved that can be passed to qt_core::Signal::connect.

C++ documentation:

Informs the view that the rows from the start row to the end row inclusive have been removed from the given parent model item.

This function was introduced in Qt 4.1.

pub unsafe fn all_columns_show_focus(&self) -> bool[src]

This property holds whether items should show keyboard focus using all columns

Calls C++ function: bool QTreeView::allColumnsShowFocus() const.

C++ documentation:

This property holds whether items should show keyboard focus using all columns

If this property is true all columns will show focus, otherwise only one column will show focus.

The default is false.

This property was introduced in Qt 4.2.

Access functions:

bool allColumnsShowFocus() const
void setAllColumnsShowFocus(bool enable)

pub unsafe fn auto_expand_delay(&self) -> c_int[src]

This property holds the delay time before items in a tree are opened during a drag and drop operation.

Calls C++ function: int QTreeView::autoExpandDelay() const.

C++ documentation:

This property holds the delay time before items in a tree are opened during a drag and drop operation.

This property holds the amount of time in milliseconds that the user must wait over a node before that node will automatically open or close. If the time is set to less then 0 then it will not be activated.

By default, this property has a value of -1, meaning that auto-expansion is disabled.

This property was introduced in Qt 4.3.

Access functions:

int autoExpandDelay() const
void setAutoExpandDelay(int delay)

pub unsafe fn collapse(&self, index: impl CastInto<Ref<QModelIndex>>)[src]

Collapses the model item specified by the index.

Calls C++ function: [slot] void QTreeView::collapse(const QModelIndex& index).

C++ documentation:

Collapses the model item specified by the index.

See also collapsed().

pub unsafe fn collapse_all(&self)[src]

Collapses all expanded items.

Calls C++ function: [slot] void QTreeView::collapseAll().

C++ documentation:

Collapses all expanded items.

This function was introduced in Qt 4.2.

See also expandAll(), expand(), collapse(), and setExpanded().

pub unsafe fn column_at(&self, x: c_int) -> c_int[src]

Returns the column in the tree view whose header covers the x coordinate given.

Calls C++ function: int QTreeView::columnAt(int x) const.

C++ documentation:

Returns the column in the tree view whose header covers the x coordinate given.

pub unsafe fn column_viewport_position(&self, column: c_int) -> c_int[src]

Returns the horizontal position of the column in the viewport.

Calls C++ function: int QTreeView::columnViewportPosition(int column) const.

C++ documentation:

Returns the horizontal position of the column in the viewport.

pub unsafe fn column_width(&self, column: c_int) -> c_int[src]

Returns the width of the column.

Calls C++ function: int QTreeView::columnWidth(int column) const.

C++ documentation:

Returns the width of the column.

See also resizeColumnToContents() and setColumnWidth().

pub unsafe fn data_changed_3a(
    &self,
    top_left: impl CastInto<Ref<QModelIndex>>,
    bottom_right: impl CastInto<Ref<QModelIndex>>,
    roles: impl CastInto<Ref<QVectorOfInt>>
)
[src]

Reimplemented from QAbstractItemView::dataChanged().

Calls C++ function: virtual void QTreeView::dataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight, const QVector<int>& roles = …).

C++ documentation:

Reimplemented from QAbstractItemView::dataChanged().

pub unsafe fn data_changed_2a(
    &self,
    top_left: impl CastInto<Ref<QModelIndex>>,
    bottom_right: impl CastInto<Ref<QModelIndex>>
)
[src]

Reimplemented from QAbstractItemView::dataChanged().

Calls C++ function: virtual void QTreeView::dataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight).

C++ documentation:

Reimplemented from QAbstractItemView::dataChanged().

pub unsafe fn do_items_layout(&self)[src]

Calls C++ function: virtual void QTreeView::doItemsLayout().

pub unsafe fn expand(&self, index: impl CastInto<Ref<QModelIndex>>)[src]

Expands the model item specified by the index.

Calls C++ function: [slot] void QTreeView::expand(const QModelIndex& index).

C++ documentation:

Expands the model item specified by the index.

See also expanded().

pub unsafe fn expand_all(&self)[src]

Expands all expandable items.

Calls C++ function: [slot] void QTreeView::expandAll().

C++ documentation:

Expands all expandable items.

Warning: if the model contains a large number of items, this function will take some time to execute.

This function was introduced in Qt 4.2.

See also collapseAll(), expand(), collapse(), and setExpanded().

pub unsafe fn expand_recursively_2a(
    &self,
    index: impl CastInto<Ref<QModelIndex>>,
    depth: c_int
)
[src]

This is supported on cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Expands the item at the given index and all its children to the given depth. The depth is relative to the given index. A depth of -1 will expand all children, a depth of 0 will only expand the given index.

Calls C++ function: void QTreeView::expandRecursively(const QModelIndex& index, int depth = …).

C++ documentation:

Expands the item at the given index and all its children to the given depth. The depth is relative to the given index. A depth of -1 will expand all children, a depth of 0 will only expand the given index.

Warning: : if the model contains a large number of items, this function will take some time to execute.

This function was introduced in Qt 5.13.

See also expandAll().

pub unsafe fn expand_recursively_1a(
    &self,
    index: impl CastInto<Ref<QModelIndex>>
)
[src]

This is supported on cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Expands the item at the given index and all its children to the given depth. The depth is relative to the given index. A depth of -1 will expand all children, a depth of 0 will only expand the given index.

Calls C++ function: void QTreeView::expandRecursively(const QModelIndex& index).

C++ documentation:

Expands the item at the given index and all its children to the given depth. The depth is relative to the given index. A depth of -1 will expand all children, a depth of 0 will only expand the given index.

Warning: : if the model contains a large number of items, this function will take some time to execute.

This function was introduced in Qt 5.13.

See also expandAll().

pub unsafe fn expand_to_depth(&self, depth: c_int)[src]

Expands all expandable items to the given depth.

Calls C++ function: [slot] void QTreeView::expandToDepth(int depth).

C++ documentation:

Expands all expandable items to the given depth.

This function was introduced in Qt 4.3.

See also expandAll(), collapseAll(), expand(), collapse(), and setExpanded().

pub unsafe fn expands_on_double_click(&self) -> bool[src]

This property holds whether the items can be expanded by double-clicking.

Calls C++ function: bool QTreeView::expandsOnDoubleClick() const.

C++ documentation:

This property holds whether the items can be expanded by double-clicking.

This property holds whether the user can expand and collapse items by double-clicking. The default value is true.

This property was introduced in Qt 4.4.

Access functions:

bool expandsOnDoubleClick() const
void setExpandsOnDoubleClick(bool enable)

See also itemsExpandable.

pub unsafe fn header(&self) -> QPtr<QHeaderView>[src]

Returns the header for the tree view.

Calls C++ function: QHeaderView* QTreeView::header() const.

C++ documentation:

Returns the header for the tree view.

See also setHeader() and QAbstractItemModel::headerData().

pub unsafe fn hide_column(&self, column: c_int)[src]

Hides the column given.

Calls C++ function: [slot] void QTreeView::hideColumn(int column).

C++ documentation:

Hides the column given.

Note: This function should only be called after the model has been initialized, as the view needs to know the number of columns in order to hide column.

See also showColumn() and setColumnHidden().

pub unsafe fn indentation(&self) -> c_int[src]

indentation of the items in the tree view.

Calls C++ function: int QTreeView::indentation() const.

C++ documentation:

indentation of the items in the tree view.

This property holds the indentation measured in pixels of the items for each level in the tree view. For top-level items, the indentation specifies the horizontal distance from the viewport edge to the items in the first column; for child items, it specifies their indentation from their parent items.

By default, the value of this property is style dependent. Thus, when the style changes, this property updates from it. Calling setIndentation() stops the updates, calling resetIndentation() will restore default behavior.

Access functions:

int indentation() const
void setIndentation(int i)
void resetIndentation()

pub unsafe fn index_above(
    &self,
    index: impl CastInto<Ref<QModelIndex>>
) -> CppBox<QModelIndex>
[src]

Returns the model index of the item above index.

Calls C++ function: QModelIndex QTreeView::indexAbove(const QModelIndex& index) const.

C++ documentation:

Returns the model index of the item above index.

pub unsafe fn index_at(
    &self,
    p: impl CastInto<Ref<QPoint>>
) -> CppBox<QModelIndex>
[src]

Reimplemented from QAbstractItemView::indexAt().

Calls C++ function: virtual QModelIndex QTreeView::indexAt(const QPoint& p) const.

C++ documentation:

Reimplemented from QAbstractItemView::indexAt().

pub unsafe fn index_below(
    &self,
    index: impl CastInto<Ref<QModelIndex>>
) -> CppBox<QModelIndex>
[src]

Returns the model index of the item below index.

Calls C++ function: QModelIndex QTreeView::indexBelow(const QModelIndex& index) const.

C++ documentation:

Returns the model index of the item below index.

pub unsafe fn is_animated(&self) -> bool[src]

This property holds whether animations are enabled

Calls C++ function: bool QTreeView::isAnimated() const.

C++ documentation:

This property holds whether animations are enabled

If this property is true the treeview will animate expansion and collapsing of branches. If this property is false, the treeview will expand or collapse branches immediately without showing the animation.

By default, this property is false.

This property was introduced in Qt 4.2.

Access functions:

bool isAnimated() const
void setAnimated(bool enable)

pub unsafe fn is_column_hidden(&self, column: c_int) -> bool[src]

Returns true if the column is hidden; otherwise returns false.

Calls C++ function: bool QTreeView::isColumnHidden(int column) const.

C++ documentation:

Returns true if the column is hidden; otherwise returns false.

See also hideColumn() and isRowHidden().

pub unsafe fn is_expanded(&self, index: impl CastInto<Ref<QModelIndex>>) -> bool[src]

Returns true if the model item index is expanded; otherwise returns false.

Calls C++ function: bool QTreeView::isExpanded(const QModelIndex& index) const.

C++ documentation:

Returns true if the model item index is expanded; otherwise returns false.

See also expand(), expanded(), and setExpanded().

pub unsafe fn is_first_column_spanned(
    &self,
    row: c_int,
    parent: impl CastInto<Ref<QModelIndex>>
) -> bool
[src]

Returns true if the item in first column in the given row of the parent is spanning all the columns; otherwise returns false.

Calls C++ function: bool QTreeView::isFirstColumnSpanned(int row, const QModelIndex& parent) const.

C++ documentation:

Returns true if the item in first column in the given row of the parent is spanning all the columns; otherwise returns false.

This function was introduced in Qt 4.3.

See also setFirstColumnSpanned().

pub unsafe fn is_header_hidden(&self) -> bool[src]

This property holds whether the header is shown or not.

Calls C++ function: bool QTreeView::isHeaderHidden() const.

C++ documentation:

This property holds whether the header is shown or not.

If this property is true, the header is not shown otherwise it is. The default value is false.

This property was introduced in Qt 4.4.

Access functions:

bool isHeaderHidden() const
void setHeaderHidden(bool hide)

See also header().

pub unsafe fn is_row_hidden(
    &self,
    row: c_int,
    parent: impl CastInto<Ref<QModelIndex>>
) -> bool
[src]

Returns true if the item in the given row of the parent is hidden; otherwise returns false.

Calls C++ function: bool QTreeView::isRowHidden(int row, const QModelIndex& parent) const.

C++ documentation:

Returns true if the item in the given row of the parent is hidden; otherwise returns false.

See also setRowHidden() and isColumnHidden().

pub unsafe fn is_sorting_enabled(&self) -> bool[src]

This property holds whether sorting is enabled

Calls C++ function: bool QTreeView::isSortingEnabled() const.

C++ documentation:

This property holds whether sorting is enabled

If this property is true, sorting is enabled for the tree; if the property is false, sorting is not enabled. The default value is false.

Note: In order to avoid performance issues, it is recommended that sorting is enabled after inserting the items into the tree. Alternatively, you could also insert the items into a list before inserting the items into the tree.

This property was introduced in Qt 4.2.

Access functions:

bool isSortingEnabled() const
void setSortingEnabled(bool enable)

See also sortByColumn().

pub unsafe fn items_expandable(&self) -> bool[src]

This property holds whether the items are expandable by the user.

Calls C++ function: bool QTreeView::itemsExpandable() const.

C++ documentation:

This property holds whether the items are expandable by the user.

This property holds whether the user can expand and collapse items interactively.

By default, this property is true.

Access functions:

bool itemsExpandable() const
void setItemsExpandable(bool enable)

Reimplemented from QAbstractItemView::keyboardSearch().

Calls C++ function: virtual void QTreeView::keyboardSearch(const QString& search).

C++ documentation:

Reimplemented from QAbstractItemView::keyboardSearch().

pub unsafe fn meta_object(&self) -> Ptr<QMetaObject>[src]

Calls C++ function: virtual const QMetaObject* QTreeView::metaObject() const.

pub unsafe fn new_1a(parent: impl CastInto<Ptr<QWidget>>) -> QBox<QTreeView>[src]

Constructs a tree view with a parent to represent a model's data. Use setModel() to set the model.

Calls C++ function: [constructor] void QTreeView::QTreeView(QWidget* parent = …).

C++ documentation:

Constructs a tree view with a parent to represent a model's data. Use setModel() to set the model.

See also QAbstractItemModel.

pub unsafe fn new_0a() -> QBox<QTreeView>[src]

The QTreeView class provides a default model/view implementation of a tree view.

Calls C++ function: [constructor] void QTreeView::QTreeView().

C++ documentation:

The QTreeView class provides a default model/view implementation of a tree view.

A QTreeView implements a tree representation of items from a model. This class is used to provide standard hierarchical lists that were previously provided by the QListView class, but using the more flexible approach provided by Qt's model/view architecture.

The QTreeView class is one of the Model/View Classes and is part of Qt's model/view framework.

QTreeView implements the interfaces defined by the QAbstractItemView class to allow it to display data provided by models derived from the QAbstractItemModel class.

It is simple to construct a tree view displaying data from a model. In the following example, the contents of a directory are supplied by a QFileSystemModel and displayed as a tree:

QFileSystemModel model = new QFileSystemModel; model->setRootPath(QDir::currentPath()); QTreeView tree = new QTreeView(splitter); tree->setModel(model);

The model/view architecture ensures that the contents of the tree view are updated as the model changes.

Items that have children can be in an expanded (children are visible) or collapsed (children are hidden) state. When this state changes a collapsed() or expanded() signal is emitted with the model index of the relevant item.

The amount of indentation used to indicate levels of hierarchy is controlled by the indentation property.

Headers in tree views are constructed using the QHeaderView class and can be hidden using header()->hide(). 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. If this value is set to true, this property will override the resize mode set on the last section in the header.

By default, all columns in a tree view are movable except the first. To disable movement of these columns, use QHeaderView's setSectionsMovable() function. For more information about rearranging sections, see Moving Header Sections.

pub unsafe fn qt_metacall(
    &self,
    arg1: Call,
    arg2: c_int,
    arg3: *mut *mut c_void
) -> c_int
[src]

Calls C++ function: virtual int QTreeView::qt_metacall(QMetaObject::Call arg1, int arg2, void** arg3).

pub unsafe fn qt_metacast(&self, arg1: *const c_char) -> *mut c_void[src]

Calls C++ function: virtual void* QTreeView::qt_metacast(const char* arg1).

pub unsafe fn reset(&self)[src]

Reimplemented from QAbstractItemView::reset().

Calls C++ function: virtual void QTreeView::reset().

C++ documentation:

Reimplemented from QAbstractItemView::reset().

pub unsafe fn reset_indentation(&self)[src]

indentation of the items in the tree view.

Calls C++ function: void QTreeView::resetIndentation().

C++ documentation:

indentation of the items in the tree view.

This property holds the indentation measured in pixels of the items for each level in the tree view. For top-level items, the indentation specifies the horizontal distance from the viewport edge to the items in the first column; for child items, it specifies their indentation from their parent items.

By default, the value of this property is style dependent. Thus, when the style changes, this property updates from it. Calling setIndentation() stops the updates, calling resetIndentation() will restore default behavior.

Access functions:

int indentation() const
void setIndentation(int i)
void resetIndentation()

pub unsafe fn resize_column_to_contents(&self, column: c_int)[src]

Resizes the column given to the size of its contents.

Calls C++ function: [slot] void QTreeView::resizeColumnToContents(int column).

C++ documentation:

Resizes the column given to the size of its contents.

See also columnWidth(), setColumnWidth(), sizeHintForColumn(), and QHeaderView::resizeContentsPrecision().

pub unsafe fn root_is_decorated(&self) -> bool[src]

This property holds whether to show controls for expanding and collapsing top-level items

Calls C++ function: bool QTreeView::rootIsDecorated() const.

C++ documentation:

This property holds whether to show controls for expanding and collapsing top-level items

Items with children are typically shown with controls to expand and collapse them, allowing their children to be shown or hidden. If this property is false, these controls are not shown for top-level items. This can be used to make a single level tree structure appear like a simple list of items.

By default, this property is true.

Access functions:

bool rootIsDecorated() const
void setRootIsDecorated(bool show)

pub unsafe fn scroll_to_2a(
    &self,
    index: impl CastInto<Ref<QModelIndex>>,
    hint: ScrollHint
)
[src]

Reimplemented from QAbstractItemView::scrollTo().

Calls C++ function: virtual void QTreeView::scrollTo(const QModelIndex& index, QAbstractItemView::ScrollHint hint = …).

C++ documentation:

Reimplemented from QAbstractItemView::scrollTo().

Scroll the contents of the tree view until the given model item index is visible. The hint parameter specifies more precisely where the item should be located after the operation. If any of the parents of the model item are collapsed, they will be expanded to ensure that the model item is visible.

pub unsafe fn scroll_to_1a(&self, index: impl CastInto<Ref<QModelIndex>>)[src]

Reimplemented from QAbstractItemView::scrollTo().

Calls C++ function: virtual void QTreeView::scrollTo(const QModelIndex& index).

C++ documentation:

Reimplemented from QAbstractItemView::scrollTo().

Scroll the contents of the tree view until the given model item index is visible. The hint parameter specifies more precisely where the item should be located after the operation. If any of the parents of the model item are collapsed, they will be expanded to ensure that the model item is visible.

pub unsafe fn select_all(&self)[src]

Reimplemented from QAbstractItemView::selectAll().

Calls C++ function: virtual void QTreeView::selectAll().

C++ documentation:

Reimplemented from QAbstractItemView::selectAll().

pub unsafe fn set_all_columns_show_focus(&self, enable: bool)[src]

This property holds whether items should show keyboard focus using all columns

Calls C++ function: void QTreeView::setAllColumnsShowFocus(bool enable).

C++ documentation:

This property holds whether items should show keyboard focus using all columns

If this property is true all columns will show focus, otherwise only one column will show focus.

The default is false.

This property was introduced in Qt 4.2.

Access functions:

bool allColumnsShowFocus() const
void setAllColumnsShowFocus(bool enable)

pub unsafe fn set_animated(&self, enable: bool)[src]

This property holds whether animations are enabled

Calls C++ function: void QTreeView::setAnimated(bool enable).

C++ documentation:

This property holds whether animations are enabled

If this property is true the treeview will animate expansion and collapsing of branches. If this property is false, the treeview will expand or collapse branches immediately without showing the animation.

By default, this property is false.

This property was introduced in Qt 4.2.

Access functions:

bool isAnimated() const
void setAnimated(bool enable)

pub unsafe fn set_auto_expand_delay(&self, delay: c_int)[src]

This property holds the delay time before items in a tree are opened during a drag and drop operation.

Calls C++ function: void QTreeView::setAutoExpandDelay(int delay).

C++ documentation:

This property holds the delay time before items in a tree are opened during a drag and drop operation.

This property holds the amount of time in milliseconds that the user must wait over a node before that node will automatically open or close. If the time is set to less then 0 then it will not be activated.

By default, this property has a value of -1, meaning that auto-expansion is disabled.

This property was introduced in Qt 4.3.

Access functions:

int autoExpandDelay() const
void setAutoExpandDelay(int delay)

pub unsafe fn set_column_hidden(&self, column: c_int, hide: bool)[src]

If hide is true the column is hidden, otherwise the column is shown.

Calls C++ function: void QTreeView::setColumnHidden(int column, bool hide).

C++ documentation:

If hide is true the column is hidden, otherwise the column is shown.

See also isColumnHidden(), hideColumn(), and setRowHidden().

pub unsafe fn set_column_width(&self, column: c_int, width: c_int)[src]

Sets the width of the given column to the width specified.

Calls C++ function: void QTreeView::setColumnWidth(int column, int width).

C++ documentation:

Sets the width of the given column to the width specified.

This function was introduced in Qt 4.2.

See also columnWidth() and resizeColumnToContents().

pub unsafe fn set_expanded(
    &self,
    index: impl CastInto<Ref<QModelIndex>>,
    expand: bool
)
[src]

Sets the item referred to by index to either collapse or expanded, depending on the value of expanded.

Calls C++ function: void QTreeView::setExpanded(const QModelIndex& index, bool expand).

C++ documentation:

Sets the item referred to by index to either collapse or expanded, depending on the value of expanded.

See also expanded(), expand(), and isExpanded().

pub unsafe fn set_expands_on_double_click(&self, enable: bool)[src]

This property holds whether the items can be expanded by double-clicking.

Calls C++ function: void QTreeView::setExpandsOnDoubleClick(bool enable).

C++ documentation:

This property holds whether the items can be expanded by double-clicking.

This property holds whether the user can expand and collapse items by double-clicking. The default value is true.

This property was introduced in Qt 4.4.

Access functions:

bool expandsOnDoubleClick() const
void setExpandsOnDoubleClick(bool enable)

See also itemsExpandable.

pub unsafe fn set_first_column_spanned(
    &self,
    row: c_int,
    parent: impl CastInto<Ref<QModelIndex>>,
    span: bool
)
[src]

If span is true the item in the first column in the row with the given parent is set to span all columns, otherwise all items on the row are shown.

Calls C++ function: void QTreeView::setFirstColumnSpanned(int row, const QModelIndex& parent, bool span).

C++ documentation:

If span is true the item in the first column in the row with the given parent is set to span all columns, otherwise all items on the row are shown.

This function was introduced in Qt 4.3.

See also isFirstColumnSpanned().

pub unsafe fn set_header(&self, header: impl CastInto<Ptr<QHeaderView>>)[src]

Sets the header for the tree view, to the given header.

Calls C++ function: void QTreeView::setHeader(QHeaderView* header).

C++ documentation:

Sets the header for the tree view, to the given header.

The view takes ownership over the given header and deletes it when a new header is set.

See also QAbstractItemModel::headerData().

pub unsafe fn set_header_hidden(&self, hide: bool)[src]

This property holds whether the header is shown or not.

Calls C++ function: void QTreeView::setHeaderHidden(bool hide).

C++ documentation:

This property holds whether the header is shown or not.

If this property is true, the header is not shown otherwise it is. The default value is false.

This property was introduced in Qt 4.4.

Access functions:

bool isHeaderHidden() const
void setHeaderHidden(bool hide)

See also header().

pub unsafe fn set_indentation(&self, i: c_int)[src]

indentation of the items in the tree view.

Calls C++ function: void QTreeView::setIndentation(int i).

C++ documentation:

indentation of the items in the tree view.

This property holds the indentation measured in pixels of the items for each level in the tree view. For top-level items, the indentation specifies the horizontal distance from the viewport edge to the items in the first column; for child items, it specifies their indentation from their parent items.

By default, the value of this property is style dependent. Thus, when the style changes, this property updates from it. Calling setIndentation() stops the updates, calling resetIndentation() will restore default behavior.

Access functions:

int indentation() const
void setIndentation(int i)
void resetIndentation()

pub unsafe fn set_items_expandable(&self, enable: bool)[src]

This property holds whether the items are expandable by the user.

Calls C++ function: void QTreeView::setItemsExpandable(bool enable).

C++ documentation:

This property holds whether the items are expandable by the user.

This property holds whether the user can expand and collapse items interactively.

By default, this property is true.

Access functions:

bool itemsExpandable() const
void setItemsExpandable(bool enable)

pub unsafe fn set_model(&self, model: impl CastInto<Ptr<QAbstractItemModel>>)[src]

Reimplemented from QAbstractItemView::setModel().

Calls C++ function: virtual void QTreeView::setModel(QAbstractItemModel* model).

C++ documentation:

Reimplemented from QAbstractItemView::setModel().

pub unsafe fn set_root_index(&self, index: impl CastInto<Ref<QModelIndex>>)[src]

Reimplemented from QAbstractItemView::setRootIndex().

Calls C++ function: virtual void QTreeView::setRootIndex(const QModelIndex& index).

C++ documentation:

Reimplemented from QAbstractItemView::setRootIndex().

pub unsafe fn set_root_is_decorated(&self, show: bool)[src]

This property holds whether to show controls for expanding and collapsing top-level items

Calls C++ function: void QTreeView::setRootIsDecorated(bool show).

C++ documentation:

This property holds whether to show controls for expanding and collapsing top-level items

Items with children are typically shown with controls to expand and collapse them, allowing their children to be shown or hidden. If this property is false, these controls are not shown for top-level items. This can be used to make a single level tree structure appear like a simple list of items.

By default, this property is true.

Access functions:

bool rootIsDecorated() const
void setRootIsDecorated(bool show)

pub unsafe fn set_row_hidden(
    &self,
    row: c_int,
    parent: impl CastInto<Ref<QModelIndex>>,
    hide: bool
)
[src]

If hide is true the row with the given parent is hidden, otherwise the row is shown.

Calls C++ function: void QTreeView::setRowHidden(int row, const QModelIndex& parent, bool hide).

C++ documentation:

If hide is true the row with the given parent is hidden, otherwise the row is shown.

See also isRowHidden() and setColumnHidden().

pub unsafe fn set_selection_model(
    &self,
    selection_model: impl CastInto<Ptr<QItemSelectionModel>>
)
[src]

Reimplemented from QAbstractItemView::setSelectionModel().

Calls C++ function: virtual void QTreeView::setSelectionModel(QItemSelectionModel* selectionModel).

C++ documentation:

Reimplemented from QAbstractItemView::setSelectionModel().

pub unsafe fn set_sorting_enabled(&self, enable: bool)[src]

This property holds whether sorting is enabled

Calls C++ function: void QTreeView::setSortingEnabled(bool enable).

C++ documentation:

This property holds whether sorting is enabled

If this property is true, sorting is enabled for the tree; if the property is false, sorting is not enabled. The default value is false.

Note: In order to avoid performance issues, it is recommended that sorting is enabled after inserting the items into the tree. Alternatively, you could also insert the items into a list before inserting the items into the tree.

This property was introduced in Qt 4.2.

Access functions:

bool isSortingEnabled() const
void setSortingEnabled(bool enable)

See also sortByColumn().

pub unsafe fn set_tree_position(&self, logical_index: c_int)[src]

This specifies that the tree structure should be placed at logical index index. If set to -1 then the tree will always follow visual index 0.

Calls C++ function: void QTreeView::setTreePosition(int logicalIndex).

C++ documentation:

This specifies that the tree structure should be placed at logical index index. If set to -1 then the tree will always follow visual index 0.

This function was introduced in Qt 5.2.

See also treePosition(), QHeaderView::swapSections(), and QHeaderView::moveSection().

pub unsafe fn set_uniform_row_heights(&self, uniform: bool)[src]

This property holds whether all items in the treeview have the same height

Calls C++ function: void QTreeView::setUniformRowHeights(bool uniform).

C++ documentation:

This property holds whether all items in the treeview have the same height

This property should only be set to true if it is guaranteed that all items in the view has the same height. This enables the view to do some optimizations.

The height is obtained from the first item in the view. It is updated when the data changes on that item.

Note: If the editor size hint is bigger than the cell size hint, then the size hint of the editor will be used.

By default, this property is false.

Access functions:

bool uniformRowHeights() const
void setUniformRowHeights(bool uniform)

pub unsafe fn set_word_wrap(&self, on: bool)[src]

This property holds the item text word-wrapping policy

Calls C++ function: void QTreeView::setWordWrap(bool on).

C++ documentation:

This property holds the item text word-wrapping policy

If this property is true then the item text is wrapped where necessary at word-breaks; otherwise it is not wrapped at all. This property is false by default.

Note that even if wrapping is enabled, the cell will not be expanded to fit all text. Ellipsis will be inserted according to the current textElideMode.

This property was introduced in Qt 4.3.

Access functions:

bool wordWrap() const
void setWordWrap(bool on)

pub unsafe fn show_column(&self, column: c_int)[src]

Shows the given column in the tree view.

Calls C++ function: [slot] void QTreeView::showColumn(int column).

C++ documentation:

Shows the given column in the tree view.

See also hideColumn() and setColumnHidden().

pub unsafe fn sort_by_column_2a(&self, column: c_int, order: SortOrder)[src]

Sets the model up for sorting by the values in the given column and order.

Calls C++ function: void QTreeView::sortByColumn(int column, Qt::SortOrder order).

C++ documentation:

Sets the model up for sorting by the values in the given column and order.

column may be -1, in which case no sort indicator will be shown and the model will return to its natural, unsorted order. Note that not all models support this and may even crash in this case.

This function was introduced in Qt 4.2.

See also sortingEnabled.

pub unsafe fn sort_by_column_1a(&self, column: c_int)[src]

Sets the model up for sorting by the values in the given column and order.

Calls C++ function: [slot] void QTreeView::sortByColumn(int column).

Warning: no exact match found in C++ documentation. Below is the C++ documentation for void QTreeView::sortByColumn(int column, Qt::SortOrder order):

Sets the model up for sorting by the values in the given column and order.

column may be -1, in which case no sort indicator will be shown and the model will return to its natural, unsorted order. Note that not all models support this and may even crash in this case.

This function was introduced in Qt 4.2.

See also sortingEnabled.

pub unsafe fn static_meta_object() -> Ref<QMetaObject>[src]

Returns a reference to the staticMetaObject field.

pub unsafe fn tr(
    s: *const c_char,
    c: *const c_char,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString QTreeView::tr(const char* s, const char* c, int n).

pub unsafe fn tr_utf8(
    s: *const c_char,
    c: *const c_char,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString QTreeView::trUtf8(const char* s, const char* c, int n).

pub unsafe fn tree_position(&self) -> c_int[src]

Return the logical index the tree is set on. If the return value is -1 then the tree is placed on the visual index 0.

Calls C++ function: int QTreeView::treePosition() const.

C++ documentation:

Return the logical index the tree is set on. If the return value is -1 then the tree is placed on the visual index 0.

This function was introduced in Qt 5.2.

See also setTreePosition().

pub unsafe fn uniform_row_heights(&self) -> bool[src]

This property holds whether all items in the treeview have the same height

Calls C++ function: bool QTreeView::uniformRowHeights() const.

C++ documentation:

This property holds whether all items in the treeview have the same height

This property should only be set to true if it is guaranteed that all items in the view has the same height. This enables the view to do some optimizations.

The height is obtained from the first item in the view. It is updated when the data changes on that item.

Note: If the editor size hint is bigger than the cell size hint, then the size hint of the editor will be used.

By default, this property is false.

Access functions:

bool uniformRowHeights() const
void setUniformRowHeights(bool uniform)

pub unsafe fn visual_rect(
    &self,
    index: impl CastInto<Ref<QModelIndex>>
) -> CppBox<QRect>
[src]

Reimplemented from QAbstractItemView::visualRect().

Calls C++ function: virtual QRect QTreeView::visualRect(const QModelIndex& index) const.

C++ documentation:

Reimplemented from QAbstractItemView::visualRect().

Returns the rectangle on the viewport occupied by the item at index. If the index is not visible or explicitly hidden, the returned rectangle is invalid.

pub unsafe fn word_wrap(&self) -> bool[src]

This property holds the item text word-wrapping policy

Calls C++ function: bool QTreeView::wordWrap() const.

C++ documentation:

This property holds the item text word-wrapping policy

If this property is true then the item text is wrapped where necessary at word-breaks; otherwise it is not wrapped at all. This property is false by default.

Note that even if wrapping is enabled, the cell will not be expanded to fit all text. Ellipsis will be inserted according to the current textElideMode.

This property was introduced in Qt 4.3.

Access functions:

bool wordWrap() const
void setWordWrap(bool on)

Methods from Deref<Target = QAbstractItemView>

pub fn slot_reset(&self) -> Receiver<()>[src]

Reset the internal state of the view.

Returns a built-in Qt slot QAbstractItemView::reset that can be passed to qt_core::Signal::connect.

C++ documentation:

Reset the internal state of the view.

Warning: This function will reset open editors, scroll bar positions, selections, etc. Existing changes will not be committed. If you would like to save your changes when resetting the view, you can reimplement this function, commit your changes, and then call the superclass' implementation.

pub fn slot_set_root_index(&self) -> Receiver<(*const QModelIndex,)>[src]

Sets the root item to the item at the given index.

Returns a built-in Qt slot QAbstractItemView::setRootIndex that can be passed to qt_core::Signal::connect.

C++ documentation:

Sets the root item to the item at the given index.

See also rootIndex().

pub fn slot_do_items_layout(&self) -> Receiver<()>[src]

Returns a built-in Qt slot QAbstractItemView::doItemsLayout that can be passed to qt_core::Signal::connect.

pub fn slot_select_all(&self) -> Receiver<()>[src]

Selects all items in the view. This function will use the selection behavior set on the view when selecting.

Returns a built-in Qt slot QAbstractItemView::selectAll that can be passed to qt_core::Signal::connect.

C++ documentation:

Selects all items in the view. This function will use the selection behavior set on the view when selecting.

See also setSelection(), selectedIndexes(), and clearSelection().

pub fn slot_edit(&self) -> Receiver<(*const QModelIndex,)>[src]

Starts editing the item corresponding to the given index if it is editable.

Returns a built-in Qt slot QAbstractItemView::edit that can be passed to qt_core::Signal::connect.

C++ documentation:

Starts editing the item corresponding to the given index if it is editable.

Note that this function does not change the current index. Since the current index defines the next and previous items to edit, users may find that keyboard navigation does not work as expected. To provide consistent navigation behavior, call setCurrentIndex() before this function with the same model index.

See also QModelIndex::flags().

pub fn slot_clear_selection(&self) -> Receiver<()>[src]

Deselects all selected items. The current index will not be changed.

Returns a built-in Qt slot QAbstractItemView::clearSelection that can be passed to qt_core::Signal::connect.

C++ documentation:

Deselects all selected items. The current index will not be changed.

See also setSelection() and selectAll().

pub fn slot_set_current_index(&self) -> Receiver<(*const QModelIndex,)>[src]

Sets the current item to be the item at index.

Returns a built-in Qt slot QAbstractItemView::setCurrentIndex that can be passed to qt_core::Signal::connect.

C++ documentation:

Sets the current item to be the item at index.

Unless the current selection mode is NoSelection, the item is also selected. Note that this function also updates the starting position for any new selections the user performs.

To set an item as the current item without selecting it, call

selectionModel()->setCurrentIndex(index, QItemSelectionModel::NoUpdate);

See also currentIndex(), currentChanged(), and selectionMode.

pub fn slot_scroll_to_top(&self) -> Receiver<()>[src]

Scrolls the view to the top.

Returns a built-in Qt slot QAbstractItemView::scrollToTop that can be passed to qt_core::Signal::connect.

C++ documentation:

Scrolls the view to the top.

This function was introduced in Qt 4.1.

See also scrollTo() and scrollToBottom().

pub fn slot_scroll_to_bottom(&self) -> Receiver<()>[src]

Scrolls the view to the bottom.

Returns a built-in Qt slot QAbstractItemView::scrollToBottom that can be passed to qt_core::Signal::connect.

C++ documentation:

Scrolls the view to the bottom.

This function was introduced in Qt 4.1.

See also scrollTo() and scrollToTop().

pub fn slot_update(&self) -> Receiver<(*const QModelIndex,)>[src]

Updates the area occupied by the given index.

Returns a built-in Qt slot QAbstractItemView::update that can be passed to qt_core::Signal::connect.

C++ documentation:

Updates the area occupied by the given index.

This function was introduced in Qt 4.3.

pub fn slot_data_changed(
    &self
) -> Receiver<(*const QModelIndex, *const QModelIndex, *const QVectorOfInt)>
[src]

This slot is called when items with the given roles are changed in the model. The changed items are those from topLeft to bottomRight inclusive. If just one item is changed topLeft == bottomRight.

Returns a built-in Qt slot QAbstractItemView::dataChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This slot is called when items with the given roles are changed in the model. The changed items are those from topLeft to bottomRight inclusive. If just one item is changed topLeft == bottomRight.

The roles which have been changed can either be an empty container (meaning everything has changed), or a non-empty container with the subset of roles which have changed.

pub fn slot_rows_inserted(&self) -> Receiver<(*const QModelIndex, c_int, c_int)>[src]

This slot is called when rows are inserted. The new rows are those under the given parent from start to end inclusive. The base class implementation calls fetchMore() on the model to check for more data.

Returns a built-in Qt slot QAbstractItemView::rowsInserted that can be passed to qt_core::Signal::connect.

C++ documentation:

This slot is called when rows are inserted. The new rows are those under the given parent from start to end inclusive. The base class implementation calls fetchMore() on the model to check for more data.

See also rowsAboutToBeRemoved().

pub fn slot_rows_about_to_be_removed(
    &self
) -> Receiver<(*const QModelIndex, c_int, c_int)>
[src]

This slot is called when rows are about to be removed. The deleted rows are those under the given parent from start to end inclusive.

Returns a built-in Qt slot QAbstractItemView::rowsAboutToBeRemoved that can be passed to qt_core::Signal::connect.

C++ documentation:

This slot is called when rows are about to be removed. The deleted rows are those under the given parent from start to end inclusive.

See also rowsInserted().

pub fn slot_selection_changed(
    &self
) -> Receiver<(*const QItemSelection, *const QItemSelection)>
[src]

This slot is called when the selection is changed. The previous selection (which may be empty), is specified by deselected, and the new selection by selected.

Returns a built-in Qt slot QAbstractItemView::selectionChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This slot is called when the selection is changed. The previous selection (which may be empty), is specified by deselected, and the new selection by selected.

See also setSelection().

pub fn slot_current_changed(
    &self
) -> Receiver<(*const QModelIndex, *const QModelIndex)>
[src]

This slot is called when a new item becomes the current item. The previous current item is specified by the previous index, and the new item by the current index.

Returns a built-in Qt slot QAbstractItemView::currentChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This slot is called when a new item becomes the current item. The previous current item is specified by the previous index, and the new item by the current index.

If you want to know about changes to items see the dataChanged() signal.

pub fn slot_update_editor_data(&self) -> Receiver<()>[src]

Returns a built-in Qt slot QAbstractItemView::updateEditorData that can be passed to qt_core::Signal::connect.

pub fn slot_update_editor_geometries(&self) -> Receiver<()>[src]

Returns a built-in Qt slot QAbstractItemView::updateEditorGeometries that can be passed to qt_core::Signal::connect.

pub fn slot_update_geometries(&self) -> Receiver<()>[src]

Updates the geometry of the child widgets of the view.

Returns a built-in Qt slot QAbstractItemView::updateGeometries that can be passed to qt_core::Signal::connect.

C++ documentation:

Updates the geometry of the child widgets of the view.

This function was introduced in Qt 4.4.

pub fn slot_vertical_scrollbar_action(&self) -> Receiver<(c_int,)>[src]

Returns a built-in Qt slot QAbstractItemView::verticalScrollbarAction that can be passed to qt_core::Signal::connect.

pub fn slot_horizontal_scrollbar_action(&self) -> Receiver<(c_int,)>[src]

Returns a built-in Qt slot QAbstractItemView::horizontalScrollbarAction that can be passed to qt_core::Signal::connect.

pub fn slot_vertical_scrollbar_value_changed(&self) -> Receiver<(c_int,)>[src]

Returns a built-in Qt slot QAbstractItemView::verticalScrollbarValueChanged that can be passed to qt_core::Signal::connect.

pub fn slot_horizontal_scrollbar_value_changed(&self) -> Receiver<(c_int,)>[src]

Returns a built-in Qt slot QAbstractItemView::horizontalScrollbarValueChanged that can be passed to qt_core::Signal::connect.

pub fn slot_close_editor(&self) -> Receiver<(*mut QWidget, EndEditHint)>[src]

Closes the given editor, and releases it. The hint is used to specify how the view should respond to the end of the editing operation. For example, the hint may indicate that the next item in the view should be opened for editing.

Returns a built-in Qt slot QAbstractItemView::closeEditor that can be passed to qt_core::Signal::connect.

C++ documentation:

Closes the given editor, and releases it. The hint is used to specify how the view should respond to the end of the editing operation. For example, the hint may indicate that the next item in the view should be opened for editing.

See also edit() and commitData().

pub fn slot_commit_data(&self) -> Receiver<(*mut QWidget,)>[src]

Commit the data in the editor to the model.

Returns a built-in Qt slot QAbstractItemView::commitData that can be passed to qt_core::Signal::connect.

C++ documentation:

Commit the data in the editor to the model.

See also closeEditor().

pub fn slot_editor_destroyed(&self) -> Receiver<(*mut QObject,)>[src]

This function is called when the given editor has been destroyed.

Returns a built-in Qt slot QAbstractItemView::editorDestroyed that can be passed to qt_core::Signal::connect.

C++ documentation:

This function is called when the given editor has been destroyed.

See also closeEditor().

pub fn pressed(&self) -> Signal<(*const QModelIndex,)>[src]

This signal is emitted when a mouse button is pressed. The item the mouse was pressed on is specified by index. The signal is only emitted when the index is valid.

Returns a built-in Qt signal QAbstractItemView::pressed that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted when a mouse button is pressed. The item the mouse was pressed on is specified by index. The signal is only emitted when the index is valid.

Use the QApplication::mouseButtons() function to get the state of the mouse buttons.

See also activated(), clicked(), doubleClicked(), and entered().

pub fn clicked(&self) -> Signal<(*const QModelIndex,)>[src]

This signal is emitted when a mouse button is left-clicked. The item the mouse was clicked on is specified by index. The signal is only emitted when the index is valid.

Returns a built-in Qt signal QAbstractItemView::clicked that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted when a mouse button is left-clicked. The item the mouse was clicked on is specified by index. The signal is only emitted when the index is valid.

See also activated(), doubleClicked(), entered(), and pressed().

pub fn double_clicked(&self) -> Signal<(*const QModelIndex,)>[src]

This signal is emitted when a mouse button is double-clicked. The item the mouse was double-clicked on is specified by index. The signal is only emitted when the index is valid.

Returns a built-in Qt signal QAbstractItemView::doubleClicked that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted when a mouse button is double-clicked. The item the mouse was double-clicked on is specified by index. The signal is only emitted when the index is valid.

See also clicked() and activated().

pub fn activated(&self) -> Signal<(*const QModelIndex,)>[src]

This signal is emitted when the item specified by index is activated by the user. How to activate items depends on the platform; e.g., by single- or double-clicking the item, or by pressing the Return or Enter key when the item is current.

Returns a built-in Qt signal QAbstractItemView::activated that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted when the item specified by index is activated by the user. How to activate items depends on the platform; e.g., by single- or double-clicking the item, or by pressing the Return or Enter key when the item is current.

See also clicked(), doubleClicked(), entered(), and pressed().

pub fn entered(&self) -> Signal<(*const QModelIndex,)>[src]

This signal is emitted when the mouse cursor enters the item specified by index. Mouse tracking needs to be enabled for this feature to work.

Returns a built-in Qt signal QAbstractItemView::entered that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted when the mouse cursor enters the item specified by index. Mouse tracking needs to be enabled for this feature to work.

See also viewportEntered(), activated(), clicked(), doubleClicked(), and pressed().

pub fn viewport_entered(&self) -> Signal<()>[src]

This signal is emitted when the mouse cursor enters the viewport. Mouse tracking needs to be enabled for this feature to work.

Returns a built-in Qt signal QAbstractItemView::viewportEntered that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted when the mouse cursor enters the viewport. Mouse tracking needs to be enabled for this feature to work.

See also entered().

pub fn icon_size_changed(&self) -> Signal<(*const QSize,)>[src]

This property holds the size of items' icons

Returns a built-in Qt signal QAbstractItemView::iconSizeChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This property holds the size of items' icons

Setting this property when the view is visible will cause the items to be laid out again.

Access functions:

QSize iconSize() const
void setIconSize(const QSize &size)

Notifier signal:

void iconSizeChanged(const QSize &size)

pub unsafe fn alternating_row_colors(&self) -> bool[src]

This property holds whether to draw the background using alternating colors

Calls C++ function: bool QAbstractItemView::alternatingRowColors() const.

C++ documentation:

This property holds whether to draw the background using alternating colors

If this property is true, the item background will be drawn using QPalette::Base and QPalette::AlternateBase; otherwise the background will be drawn using the QPalette::Base color.

By default, this property is false.

Access functions:

bool alternatingRowColors() const
void setAlternatingRowColors(bool enable)

pub unsafe fn auto_scroll_margin(&self) -> c_int[src]

This property holds the size of the area when auto scrolling is triggered

Calls C++ function: int QAbstractItemView::autoScrollMargin() const.

C++ documentation:

This property holds the size of the area when auto scrolling is triggered

This property controls the size of the area at the edge of the viewport that triggers autoscrolling. The default value is 16 pixels.

This property was introduced in Qt 4.4.

Access functions:

int autoScrollMargin() const
void setAutoScrollMargin(int margin)

pub unsafe fn clear_selection(&self)[src]

Deselects all selected items. The current index will not be changed.

Calls C++ function: [slot] void QAbstractItemView::clearSelection().

C++ documentation:

Deselects all selected items. The current index will not be changed.

See also setSelection() and selectAll().

pub unsafe fn close_persistent_editor(
    &self,
    index: impl CastInto<Ref<QModelIndex>>
)
[src]

Closes the persistent editor for the item at the given index.

Calls C++ function: void QAbstractItemView::closePersistentEditor(const QModelIndex& index).

C++ documentation:

Closes the persistent editor for the item at the given index.

See also openPersistentEditor().

pub unsafe fn current_index(&self) -> CppBox<QModelIndex>[src]

Returns the model index of the current item.

Calls C++ function: QModelIndex QAbstractItemView::currentIndex() const.

C++ documentation:

Returns the model index of the current item.

See also setCurrentIndex().

pub unsafe fn default_drop_action(&self) -> DropAction[src]

This property holds the drop action that will be used by default in QAbstractItemView::drag()

Calls C++ function: Qt::DropAction QAbstractItemView::defaultDropAction() const.

C++ documentation:

This property holds the drop action that will be used by default in QAbstractItemView::drag()

If the property is not set, the drop action is CopyAction when the supported actions support CopyAction.

This property was introduced in Qt 4.6.

Access functions:

Qt::DropAction defaultDropAction() const
void setDefaultDropAction(Qt::DropAction dropAction)

See also showDropIndicator and dragDropOverwriteMode.

pub unsafe fn do_items_layout(&self)[src]

Calls C++ function: virtual [slot] void QAbstractItemView::doItemsLayout().

pub unsafe fn drag_drop_mode(&self) -> DragDropMode[src]

This property holds the drag and drop event the view will act upon

Calls C++ function: QAbstractItemView::DragDropMode QAbstractItemView::dragDropMode() const.

C++ documentation:

This property holds the drag and drop event the view will act upon

This property was introduced in Qt 4.2.

Access functions:

DragDropMode dragDropMode() const
void setDragDropMode(DragDropMode behavior)

See also showDropIndicator and dragDropOverwriteMode.

pub unsafe fn drag_drop_overwrite_mode(&self) -> bool[src]

This property holds the view's drag and drop behavior

Calls C++ function: bool QAbstractItemView::dragDropOverwriteMode() const.

C++ documentation:

This property holds the view's drag and drop behavior

If its value is true, the selected data will overwrite the existing item data when dropped, while moving the data will clear the item. If its value is false, the selected data will be inserted as a new item when the data is dropped. When the data is moved, the item is removed as well.

The default value is false, as in the QListView and QTreeView subclasses. In the QTableView subclass, on the other hand, the property has been set to true.

Note: This is not intended to prevent overwriting of items. The model's implementation of flags() should do that by not returning Qt::ItemIsDropEnabled.

This property was introduced in Qt 4.2.

Access functions:

bool dragDropOverwriteMode() const
void setDragDropOverwriteMode(bool overwrite)

See also dragDropMode.

pub unsafe fn drag_enabled(&self) -> bool[src]

This property holds whether the view supports dragging of its own items

Calls C++ function: bool QAbstractItemView::dragEnabled() const.

C++ documentation:

This property holds whether the view supports dragging of its own items

Access functions:

bool dragEnabled() const
void setDragEnabled(bool enable)

See also showDropIndicator, DragDropMode, dragDropOverwriteMode, and acceptDrops.

pub unsafe fn edit(&self, index: impl CastInto<Ref<QModelIndex>>)[src]

Starts editing the item corresponding to the given index if it is editable.

Calls C++ function: [slot] void QAbstractItemView::edit(const QModelIndex& index).

C++ documentation:

Starts editing the item corresponding to the given index if it is editable.

Note that this function does not change the current index. Since the current index defines the next and previous items to edit, users may find that keyboard navigation does not work as expected. To provide consistent navigation behavior, call setCurrentIndex() before this function with the same model index.

See also QModelIndex::flags().

pub unsafe fn edit_triggers(&self) -> QFlags<EditTrigger>[src]

This property holds which actions will initiate item editing

Calls C++ function: QFlags<QAbstractItemView::EditTrigger> QAbstractItemView::editTriggers() const.

C++ documentation:

This property holds which actions will initiate item editing

This property is a selection of flags defined by EditTrigger, combined using the OR operator. The view will only initiate the editing of an item if the action performed is set in this property.

Access functions:

EditTriggers editTriggers() const
void setEditTriggers(EditTriggers triggers)

pub unsafe fn has_auto_scroll(&self) -> bool[src]

This property holds whether autoscrolling in drag move events is enabled

Calls C++ function: bool QAbstractItemView::hasAutoScroll() const.

C++ documentation:

This property holds whether autoscrolling in drag move events is enabled

If this property is set to true (the default), the QAbstractItemView automatically scrolls the contents of the view if the user drags within 16 pixels of the viewport edge. If the current item changes, then the view will scroll automatically to ensure that the current item is fully visible.

This property only works if the viewport accepts drops. Autoscroll is switched off by setting this property to false.

Access functions:

bool hasAutoScroll() const
void setAutoScroll(bool enable)

pub unsafe fn horizontal_scroll_mode(&self) -> ScrollMode[src]

how the view scrolls its contents in the horizontal direction

Calls C++ function: QAbstractItemView::ScrollMode QAbstractItemView::horizontalScrollMode() const.

C++ documentation:

how the view scrolls its contents in the horizontal direction

This property controls how the view scroll its contents horizontally. Scrolling can be done either per pixel or per item. Its default value comes from the style via the QStyle::SH_ItemView_ScrollMode style hint.

This property was introduced in Qt 4.2.

Access functions:

ScrollMode horizontalScrollMode() const
void setHorizontalScrollMode(ScrollMode mode)
void resetHorizontalScrollMode()

pub unsafe fn icon_size(&self) -> CppBox<QSize>[src]

This property holds the size of items' icons

Calls C++ function: QSize QAbstractItemView::iconSize() const.

C++ documentation:

This property holds the size of items' icons

Setting this property when the view is visible will cause the items to be laid out again.

Access functions:

QSize iconSize() const
void setIconSize(const QSize &size)

Notifier signal:

void iconSizeChanged(const QSize &size)

pub unsafe fn index_at(
    &self,
    point: impl CastInto<Ref<QPoint>>
) -> CppBox<QModelIndex>
[src]

Returns the model index of the item at the viewport coordinates point.

Calls C++ function: pure virtual QModelIndex QAbstractItemView::indexAt(const QPoint& point) const.

C++ documentation:

Returns the model index of the item at the viewport coordinates point.

In the base class this is a pure virtual function.

See also visualRect().

pub unsafe fn index_widget(
    &self,
    index: impl CastInto<Ref<QModelIndex>>
) -> QPtr<QWidget>
[src]

Returns the widget for the item at the given index.

Calls C++ function: QWidget* QAbstractItemView::indexWidget(const QModelIndex& index) const.

C++ documentation:

Returns the widget for the item at the given index.

This function was introduced in Qt 4.1.

See also setIndexWidget().

pub unsafe fn input_method_query(
    &self,
    query: InputMethodQuery
) -> CppBox<QVariant>
[src]

Reimplemented from QWidget::inputMethodQuery().

Calls C++ function: virtual QVariant QAbstractItemView::inputMethodQuery(Qt::InputMethodQuery query) const.

C++ documentation:

Reimplemented from QWidget::inputMethodQuery().

pub unsafe fn is_persistent_editor_open(
    &self,
    index: impl CastInto<Ref<QModelIndex>>
) -> bool
[src]

This is supported on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns whether a persistent editor is open for the item at index index.

Calls C++ function: bool QAbstractItemView::isPersistentEditorOpen(const QModelIndex& index) const.

C++ documentation:

Returns whether a persistent editor is open for the item at index index.

This function was introduced in Qt 5.10.

See also openPersistentEditor() and closePersistentEditor().

pub unsafe fn item_delegate_0a(&self) -> QPtr<QAbstractItemDelegate>[src]

Returns the item delegate used by this view and model. This is either one set with setItemDelegate(), or the default one.

Calls C++ function: QAbstractItemDelegate* QAbstractItemView::itemDelegate() const.

C++ documentation:

Returns the item delegate used by this view and model. This is either one set with setItemDelegate(), or the default one.

See also setItemDelegate().

pub unsafe fn item_delegate_1a(
    &self,
    index: impl CastInto<Ref<QModelIndex>>
) -> QPtr<QAbstractItemDelegate>
[src]

Returns the item delegate used by this view and model for the given index.

Calls C++ function: QAbstractItemDelegate* QAbstractItemView::itemDelegate(const QModelIndex& index) const.

C++ documentation:

Returns the item delegate used by this view and model for the given index.

pub unsafe fn item_delegate_for_column(
    &self,
    column: c_int
) -> QPtr<QAbstractItemDelegate>
[src]

Returns the item delegate used by this view and model for the given column. You can call itemDelegate() to get a pointer to the current delegate for a given index.

Calls C++ function: QAbstractItemDelegate* QAbstractItemView::itemDelegateForColumn(int column) const.

C++ documentation:

Returns the item delegate used by this view and model for the given column. You can call itemDelegate() to get a pointer to the current delegate for a given index.

This function was introduced in Qt 4.2.

See also setItemDelegateForColumn(), itemDelegateForRow(), and itemDelegate().

pub unsafe fn item_delegate_for_row(
    &self,
    row: c_int
) -> QPtr<QAbstractItemDelegate>
[src]

Returns the item delegate used by this view and model for the given row, or 0 if no delegate has been assigned. You can call itemDelegate() to get a pointer to the current delegate for a given index.

Calls C++ function: QAbstractItemDelegate* QAbstractItemView::itemDelegateForRow(int row) const.

C++ documentation:

Returns the item delegate used by this view and model for the given row, or 0 if no delegate has been assigned. You can call itemDelegate() to get a pointer to the current delegate for a given index.

This function was introduced in Qt 4.2.

See also setItemDelegateForRow(), itemDelegateForColumn(), and setItemDelegate().

pub unsafe fn keyboard_search(&self, search: impl CastInto<Ref<QString>>)[src]

Moves to and selects the item best matching the string search. If no item is found nothing happens.

Calls C++ function: virtual void QAbstractItemView::keyboardSearch(const QString& search).

C++ documentation:

Moves to and selects the item best matching the string search. If no item is found nothing happens.

In the default implementation, the search is reset if search is empty, or the time interval since the last search has exceeded QApplication::keyboardInputInterval().

pub unsafe fn meta_object(&self) -> Ptr<QMetaObject>[src]

Calls C++ function: virtual const QMetaObject* QAbstractItemView::metaObject() const.

pub unsafe fn model(&self) -> QPtr<QAbstractItemModel>[src]

Returns the model that this view is presenting.

Calls C++ function: QAbstractItemModel* QAbstractItemView::model() const.

C++ documentation:

Returns the model that this view is presenting.

See also setModel().

pub unsafe fn open_persistent_editor(
    &self,
    index: impl CastInto<Ref<QModelIndex>>
)
[src]

Opens a persistent editor on the item at the given index. If no editor exists, the delegate will create a new editor.

Calls C++ function: void QAbstractItemView::openPersistentEditor(const QModelIndex& index).

C++ documentation:

Opens a persistent editor on the item at the given index. If no editor exists, the delegate will create a new editor.

See also closePersistentEditor().

pub unsafe fn qt_metacall(
    &self,
    arg1: Call,
    arg2: c_int,
    arg3: *mut *mut c_void
) -> c_int
[src]

Calls C++ function: virtual int QAbstractItemView::qt_metacall(QMetaObject::Call arg1, int arg2, void** arg3).

pub unsafe fn qt_metacast(&self, arg1: *const c_char) -> *mut c_void[src]

Calls C++ function: virtual void* QAbstractItemView::qt_metacast(const char* arg1).

pub unsafe fn reset(&self)[src]

Reset the internal state of the view.

Calls C++ function: virtual [slot] void QAbstractItemView::reset().

C++ documentation:

Reset the internal state of the view.

Warning: This function will reset open editors, scroll bar positions, selections, etc. Existing changes will not be committed. If you would like to save your changes when resetting the view, you can reimplement this function, commit your changes, and then call the superclass' implementation.

pub unsafe fn reset_horizontal_scroll_mode(&self)[src]

how the view scrolls its contents in the horizontal direction

Calls C++ function: void QAbstractItemView::resetHorizontalScrollMode().

C++ documentation:

how the view scrolls its contents in the horizontal direction

This property controls how the view scroll its contents horizontally. Scrolling can be done either per pixel or per item. Its default value comes from the style via the QStyle::SH_ItemView_ScrollMode style hint.

This property was introduced in Qt 4.2.

Access functions:

ScrollMode horizontalScrollMode() const
void setHorizontalScrollMode(ScrollMode mode)
void resetHorizontalScrollMode()

pub unsafe fn reset_vertical_scroll_mode(&self)[src]

how the view scrolls its contents in the vertical direction

Calls C++ function: void QAbstractItemView::resetVerticalScrollMode().

C++ documentation:

how the view scrolls its contents in the vertical direction

This property controls how the view scroll its contents vertically. Scrolling can be done either per pixel or per item. Its default value comes from the style via the QStyle::SH_ItemView_ScrollMode style hint.

This property was introduced in Qt 4.2.

Access functions:

ScrollMode verticalScrollMode() const
void setVerticalScrollMode(ScrollMode mode)
void resetVerticalScrollMode()

pub unsafe fn root_index(&self) -> CppBox<QModelIndex>[src]

Returns the model index of the model's root item. The root item is the parent item to the view's toplevel items. The root can be invalid.

Calls C++ function: QModelIndex QAbstractItemView::rootIndex() const.

C++ documentation:

Returns the model index of the model's root item. The root item is the parent item to the view's toplevel items. The root can be invalid.

See also setRootIndex().

pub unsafe fn scroll_to_2a(
    &self,
    index: impl CastInto<Ref<QModelIndex>>,
    hint: ScrollHint
)
[src]

Scrolls the view if necessary to ensure that the item at index is visible. The view will try to position the item according to the given hint.

Calls C++ function: pure virtual void QAbstractItemView::scrollTo(const QModelIndex& index, QAbstractItemView::ScrollHint hint = …).

C++ documentation:

Scrolls the view if necessary to ensure that the item at index is visible. The view will try to position the item according to the given hint.

In the base class this is a pure virtual function.

pub unsafe fn scroll_to_1a(&self, index: impl CastInto<Ref<QModelIndex>>)[src]

Scrolls the view if necessary to ensure that the item at index is visible. The view will try to position the item according to the given hint.

Calls C++ function: pure virtual void QAbstractItemView::scrollTo(const QModelIndex& index).

C++ documentation:

Scrolls the view if necessary to ensure that the item at index is visible. The view will try to position the item according to the given hint.

In the base class this is a pure virtual function.

pub unsafe fn scroll_to_bottom(&self)[src]

Scrolls the view to the bottom.

Calls C++ function: [slot] void QAbstractItemView::scrollToBottom().

C++ documentation:

Scrolls the view to the bottom.

This function was introduced in Qt 4.1.

See also scrollTo() and scrollToTop().

pub unsafe fn scroll_to_top(&self)[src]

Scrolls the view to the top.

Calls C++ function: [slot] void QAbstractItemView::scrollToTop().

C++ documentation:

Scrolls the view to the top.

This function was introduced in Qt 4.1.

See also scrollTo() and scrollToBottom().

pub unsafe fn select_all(&self)[src]

Selects all items in the view. This function will use the selection behavior set on the view when selecting.

Calls C++ function: virtual [slot] void QAbstractItemView::selectAll().

C++ documentation:

Selects all items in the view. This function will use the selection behavior set on the view when selecting.

See also setSelection(), selectedIndexes(), and clearSelection().

pub unsafe fn selection_behavior(&self) -> SelectionBehavior[src]

This property holds which selection behavior the view uses

Calls C++ function: QAbstractItemView::SelectionBehavior QAbstractItemView::selectionBehavior() const.

C++ documentation:

This property holds which selection behavior the view uses

This property holds whether selections are done in terms of single items, rows or columns.

Access functions:

QAbstractItemView::SelectionBehavior selectionBehavior() const
void setSelectionBehavior(QAbstractItemView::SelectionBehavior behavior)

See also SelectionMode and SelectionBehavior.

pub unsafe fn selection_mode(&self) -> SelectionMode[src]

This property holds which selection mode the view operates in

Calls C++ function: QAbstractItemView::SelectionMode QAbstractItemView::selectionMode() const.

C++ documentation:

This property holds which selection mode the view operates in

This property controls whether the user can select one or many items and, in many-item selections, whether the selection must be a continuous range of items.

Access functions:

QAbstractItemView::SelectionMode selectionMode() const
void setSelectionMode(QAbstractItemView::SelectionMode mode)

See also SelectionMode and SelectionBehavior.

pub unsafe fn selection_model(&self) -> QPtr<QItemSelectionModel>[src]

Returns the current selection model.

Calls C++ function: QItemSelectionModel* QAbstractItemView::selectionModel() const.

C++ documentation:

Returns the current selection model.

See also setSelectionModel() and selectedIndexes().

pub unsafe fn set_alternating_row_colors(&self, enable: bool)[src]

This property holds whether to draw the background using alternating colors

Calls C++ function: void QAbstractItemView::setAlternatingRowColors(bool enable).

C++ documentation:

This property holds whether to draw the background using alternating colors

If this property is true, the item background will be drawn using QPalette::Base and QPalette::AlternateBase; otherwise the background will be drawn using the QPalette::Base color.

By default, this property is false.

Access functions:

bool alternatingRowColors() const
void setAlternatingRowColors(bool enable)

pub unsafe fn set_auto_scroll(&self, enable: bool)[src]

This property holds whether autoscrolling in drag move events is enabled

Calls C++ function: void QAbstractItemView::setAutoScroll(bool enable).

C++ documentation:

This property holds whether autoscrolling in drag move events is enabled

If this property is set to true (the default), the QAbstractItemView automatically scrolls the contents of the view if the user drags within 16 pixels of the viewport edge. If the current item changes, then the view will scroll automatically to ensure that the current item is fully visible.

This property only works if the viewport accepts drops. Autoscroll is switched off by setting this property to false.

Access functions:

bool hasAutoScroll() const
void setAutoScroll(bool enable)

pub unsafe fn set_auto_scroll_margin(&self, margin: c_int)[src]

This property holds the size of the area when auto scrolling is triggered

Calls C++ function: void QAbstractItemView::setAutoScrollMargin(int margin).

C++ documentation:

This property holds the size of the area when auto scrolling is triggered

This property controls the size of the area at the edge of the viewport that triggers autoscrolling. The default value is 16 pixels.

This property was introduced in Qt 4.4.

Access functions:

int autoScrollMargin() const
void setAutoScrollMargin(int margin)

pub unsafe fn set_current_index(&self, index: impl CastInto<Ref<QModelIndex>>)[src]

Sets the current item to be the item at index.

Calls C++ function: [slot] void QAbstractItemView::setCurrentIndex(const QModelIndex& index).

C++ documentation:

Sets the current item to be the item at index.

Unless the current selection mode is NoSelection, the item is also selected. Note that this function also updates the starting position for any new selections the user performs.

To set an item as the current item without selecting it, call

selectionModel()->setCurrentIndex(index, QItemSelectionModel::NoUpdate);

See also currentIndex(), currentChanged(), and selectionMode.

pub unsafe fn set_default_drop_action(&self, drop_action: DropAction)[src]

This property holds the drop action that will be used by default in QAbstractItemView::drag()

Calls C++ function: void QAbstractItemView::setDefaultDropAction(Qt::DropAction dropAction).

C++ documentation:

This property holds the drop action that will be used by default in QAbstractItemView::drag()

If the property is not set, the drop action is CopyAction when the supported actions support CopyAction.

This property was introduced in Qt 4.6.

Access functions:

Qt::DropAction defaultDropAction() const
void setDefaultDropAction(Qt::DropAction dropAction)

See also showDropIndicator and dragDropOverwriteMode.

pub unsafe fn set_drag_drop_mode(&self, behavior: DragDropMode)[src]

This property holds the drag and drop event the view will act upon

Calls C++ function: void QAbstractItemView::setDragDropMode(QAbstractItemView::DragDropMode behavior).

C++ documentation:

This property holds the drag and drop event the view will act upon

This property was introduced in Qt 4.2.

Access functions:

DragDropMode dragDropMode() const
void setDragDropMode(DragDropMode behavior)

See also showDropIndicator and dragDropOverwriteMode.

pub unsafe fn set_drag_drop_overwrite_mode(&self, overwrite: bool)[src]

This property holds the view's drag and drop behavior

Calls C++ function: void QAbstractItemView::setDragDropOverwriteMode(bool overwrite).

C++ documentation:

This property holds the view's drag and drop behavior

If its value is true, the selected data will overwrite the existing item data when dropped, while moving the data will clear the item. If its value is false, the selected data will be inserted as a new item when the data is dropped. When the data is moved, the item is removed as well.

The default value is false, as in the QListView and QTreeView subclasses. In the QTableView subclass, on the other hand, the property has been set to true.

Note: This is not intended to prevent overwriting of items. The model's implementation of flags() should do that by not returning Qt::ItemIsDropEnabled.

This property was introduced in Qt 4.2.

Access functions:

bool dragDropOverwriteMode() const
void setDragDropOverwriteMode(bool overwrite)

See also dragDropMode.

pub unsafe fn set_drag_enabled(&self, enable: bool)[src]

This property holds whether the view supports dragging of its own items

Calls C++ function: void QAbstractItemView::setDragEnabled(bool enable).

C++ documentation:

This property holds whether the view supports dragging of its own items

Access functions:

bool dragEnabled() const
void setDragEnabled(bool enable)

See also showDropIndicator, DragDropMode, dragDropOverwriteMode, and acceptDrops.

pub unsafe fn set_drop_indicator_shown(&self, enable: bool)[src]

This property holds whether the drop indicator is shown when dragging items and dropping.

Calls C++ function: void QAbstractItemView::setDropIndicatorShown(bool enable).

C++ documentation:

This property holds whether the drop indicator is shown when dragging items and dropping.

Access functions:

bool showDropIndicator() const
void setDropIndicatorShown(bool enable)

See also dragEnabled, DragDropMode, dragDropOverwriteMode, and acceptDrops.

pub unsafe fn set_edit_triggers(&self, triggers: QFlags<EditTrigger>)[src]

This property holds which actions will initiate item editing

Calls C++ function: void QAbstractItemView::setEditTriggers(QFlags<QAbstractItemView::EditTrigger> triggers).

C++ documentation:

This property holds which actions will initiate item editing

This property is a selection of flags defined by EditTrigger, combined using the OR operator. The view will only initiate the editing of an item if the action performed is set in this property.

Access functions:

EditTriggers editTriggers() const
void setEditTriggers(EditTriggers triggers)

pub unsafe fn set_horizontal_scroll_mode(&self, mode: ScrollMode)[src]

how the view scrolls its contents in the horizontal direction

Calls C++ function: void QAbstractItemView::setHorizontalScrollMode(QAbstractItemView::ScrollMode mode).

C++ documentation:

how the view scrolls its contents in the horizontal direction

This property controls how the view scroll its contents horizontally. Scrolling can be done either per pixel or per item. Its default value comes from the style via the QStyle::SH_ItemView_ScrollMode style hint.

This property was introduced in Qt 4.2.

Access functions:

ScrollMode horizontalScrollMode() const
void setHorizontalScrollMode(ScrollMode mode)
void resetHorizontalScrollMode()

pub unsafe fn set_icon_size(&self, size: impl CastInto<Ref<QSize>>)[src]

This property holds the size of items' icons

Calls C++ function: void QAbstractItemView::setIconSize(const QSize& size).

C++ documentation:

This property holds the size of items' icons

Setting this property when the view is visible will cause the items to be laid out again.

Access functions:

QSize iconSize() const
void setIconSize(const QSize &size)

Notifier signal:

void iconSizeChanged(const QSize &size)

pub unsafe fn set_index_widget(
    &self,
    index: impl CastInto<Ref<QModelIndex>>,
    widget: impl CastInto<Ptr<QWidget>>
)
[src]

Sets the given widget on the item at the given index, passing the ownership of the widget to the viewport.

Calls C++ function: void QAbstractItemView::setIndexWidget(const QModelIndex& index, QWidget* widget).

C++ documentation:

Sets the given widget on the item at the given index, passing the ownership of the widget to the viewport.

If index is invalid (e.g., if you pass the root index), this function will do nothing.

The given widget's autoFillBackground property must be set to true, otherwise the widget's background will be transparent, showing both the model data and the item at the given index.

If index widget A is replaced with index widget B, index widget A will be deleted. For example, in the code snippet below, the QLineEdit object will be deleted.

setIndexWidget(index, new QLineEdit); ... setIndexWidget(index, new QTextEdit);

This function should only be used to display static content within the visible area corresponding to an item of data. If you want to display custom dynamic content or implement a custom editor widget, subclass QItemDelegate instead.

This function was introduced in Qt 4.1.

See also indexWidget() and Delegate Classes.

pub unsafe fn set_item_delegate(
    &self,
    delegate: impl CastInto<Ptr<QAbstractItemDelegate>>
)
[src]

Sets the item delegate for this view and its model to delegate. This is useful if you want complete control over the editing and display of items.

Calls C++ function: void QAbstractItemView::setItemDelegate(QAbstractItemDelegate* delegate).

C++ documentation:

Sets the item delegate for this view and its model to delegate. This is useful if you want complete control over the editing and display of items.

Any existing delegate will be removed, but not deleted. QAbstractItemView does not take ownership of delegate.

Warning: You should not share the same instance of a delegate between views. Doing so can cause incorrect or unintuitive editing behavior since each view connected to a given delegate may receive the closeEditor() signal, and attempt to access, modify or close an editor that has already been closed.

See also itemDelegate().

pub unsafe fn set_item_delegate_for_column(
    &self,
    column: c_int,
    delegate: impl CastInto<Ptr<QAbstractItemDelegate>>
)
[src]

Sets the given item delegate used by this view and model for the given column. All items on column will be drawn and managed by delegate instead of using the default delegate (i.e., itemDelegate()).

Calls C++ function: void QAbstractItemView::setItemDelegateForColumn(int column, QAbstractItemDelegate* delegate).

C++ documentation:

Sets the given item delegate used by this view and model for the given column. All items on column will be drawn and managed by delegate instead of using the default delegate (i.e., itemDelegate()).

Any existing column delegate for column will be removed, but not deleted. QAbstractItemView does not take ownership of delegate.

Note: If a delegate has been assigned to both a row and a column, the row delegate will take precedence and manage the intersecting cell index.

Warning: You should not share the same instance of a delegate between views. Doing so can cause incorrect or unintuitive editing behavior since each view connected to a given delegate may receive the closeEditor() signal, and attempt to access, modify or close an editor that has already been closed.

This function was introduced in Qt 4.2.

See also itemDelegateForColumn(), setItemDelegateForRow(), and itemDelegate().

pub unsafe fn set_item_delegate_for_row(
    &self,
    row: c_int,
    delegate: impl CastInto<Ptr<QAbstractItemDelegate>>
)
[src]

Sets the given item delegate used by this view and model for the given row. All items on row will be drawn and managed by delegate instead of using the default delegate (i.e., itemDelegate()).

Calls C++ function: void QAbstractItemView::setItemDelegateForRow(int row, QAbstractItemDelegate* delegate).

C++ documentation:

Sets the given item delegate used by this view and model for the given row. All items on row will be drawn and managed by delegate instead of using the default delegate (i.e., itemDelegate()).

Any existing row delegate for row will be removed, but not deleted. QAbstractItemView does not take ownership of delegate.

Note: If a delegate has been assigned to both a row and a column, the row delegate (i.e., this delegate) will take precedence and manage the intersecting cell index.

Warning: You should not share the same instance of a delegate between views. Doing so can cause incorrect or unintuitive editing behavior since each view connected to a given delegate may receive the closeEditor() signal, and attempt to access, modify or close an editor that has already been closed.

This function was introduced in Qt 4.2.

See also itemDelegateForRow(), setItemDelegateForColumn(), and itemDelegate().

pub unsafe fn set_model(&self, model: impl CastInto<Ptr<QAbstractItemModel>>)[src]

Sets the model for the view to present.

Calls C++ function: virtual void QAbstractItemView::setModel(QAbstractItemModel* model).

C++ documentation:

Sets the model for the view to present.

This function will create and set a new selection model, replacing any model that was previously set with setSelectionModel(). However, the old selection model will not be deleted as it may be shared between several views. We recommend that you delete the old selection model if it is no longer required. This is done with the following code:

QItemSelectionModel *m = view->selectionModel(); view->setModel(new model); delete m;

If both the old model and the old selection model do not have parents, or if their parents are long-lived objects, it may be preferable to call their deleteLater() functions to explicitly delete them.

The view does not take ownership of the model unless it is the model's parent object because the model may be shared between many different views.

See also model(), selectionModel(), and setSelectionModel().

pub unsafe fn set_root_index(&self, index: impl CastInto<Ref<QModelIndex>>)[src]

Sets the root item to the item at the given index.

Calls C++ function: virtual [slot] void QAbstractItemView::setRootIndex(const QModelIndex& index).

C++ documentation:

Sets the root item to the item at the given index.

See also rootIndex().

pub unsafe fn set_selection_behavior(&self, behavior: SelectionBehavior)[src]

This property holds which selection behavior the view uses

Calls C++ function: void QAbstractItemView::setSelectionBehavior(QAbstractItemView::SelectionBehavior behavior).

C++ documentation:

This property holds which selection behavior the view uses

This property holds whether selections are done in terms of single items, rows or columns.

Access functions:

QAbstractItemView::SelectionBehavior selectionBehavior() const
void setSelectionBehavior(QAbstractItemView::SelectionBehavior behavior)

See also SelectionMode and SelectionBehavior.

pub unsafe fn set_selection_mode(&self, mode: SelectionMode)[src]

This property holds which selection mode the view operates in

Calls C++ function: void QAbstractItemView::setSelectionMode(QAbstractItemView::SelectionMode mode).

C++ documentation:

This property holds which selection mode the view operates in

This property controls whether the user can select one or many items and, in many-item selections, whether the selection must be a continuous range of items.

Access functions:

QAbstractItemView::SelectionMode selectionMode() const
void setSelectionMode(QAbstractItemView::SelectionMode mode)

See also SelectionMode and SelectionBehavior.

pub unsafe fn set_selection_model(
    &self,
    selection_model: impl CastInto<Ptr<QItemSelectionModel>>
)
[src]

Sets the current selection model to the given selectionModel.

Calls C++ function: virtual void QAbstractItemView::setSelectionModel(QItemSelectionModel* selectionModel).

C++ documentation:

Sets the current selection model to the given selectionModel.

Note that, if you call setModel() after this function, the given selectionModel will be replaced by one created by the view.

Note: It is up to the application to delete the old selection model if it is no longer needed; i.e., if it is not being used by other views. This will happen automatically when its parent object is deleted. However, if it does not have a parent, or if the parent is a long-lived object, it may be preferable to call its deleteLater() function to explicitly delete it.

See also selectionModel(), setModel(), and clearSelection().

pub unsafe fn set_tab_key_navigation(&self, enable: bool)[src]

This property holds whether item navigation with tab and backtab is enabled.

Calls C++ function: void QAbstractItemView::setTabKeyNavigation(bool enable).

C++ documentation:

This property holds whether item navigation with tab and backtab is enabled.

Access functions:

bool tabKeyNavigation() const
void setTabKeyNavigation(bool enable)

pub unsafe fn set_text_elide_mode(&self, mode: TextElideMode)[src]

This property holds the position of the "..." in elided text.

Calls C++ function: void QAbstractItemView::setTextElideMode(Qt::TextElideMode mode).

C++ documentation:

This property holds the position of the "..." in elided text.

The default value for all item views is Qt::ElideRight.

Access functions:

Qt::TextElideMode textElideMode() const
void setTextElideMode(Qt::TextElideMode mode)

pub unsafe fn set_vertical_scroll_mode(&self, mode: ScrollMode)[src]

how the view scrolls its contents in the vertical direction

Calls C++ function: void QAbstractItemView::setVerticalScrollMode(QAbstractItemView::ScrollMode mode).

C++ documentation:

how the view scrolls its contents in the vertical direction

This property controls how the view scroll its contents vertically. Scrolling can be done either per pixel or per item. Its default value comes from the style via the QStyle::SH_ItemView_ScrollMode style hint.

This property was introduced in Qt 4.2.

Access functions:

ScrollMode verticalScrollMode() const
void setVerticalScrollMode(ScrollMode mode)
void resetVerticalScrollMode()

pub unsafe fn show_drop_indicator(&self) -> bool[src]

This property holds whether the drop indicator is shown when dragging items and dropping.

Calls C++ function: bool QAbstractItemView::showDropIndicator() const.

C++ documentation:

This property holds whether the drop indicator is shown when dragging items and dropping.

Access functions:

bool showDropIndicator() const
void setDropIndicatorShown(bool enable)

See also dragEnabled, DragDropMode, dragDropOverwriteMode, and acceptDrops.

pub unsafe fn size_hint_for_column(&self, column: c_int) -> c_int[src]

Returns the width size hint for the specified column or -1 if there is no model.

Calls C++ function: virtual int QAbstractItemView::sizeHintForColumn(int column) const.

C++ documentation:

Returns the width size hint for the specified column or -1 if there is no model.

This function is used in views with a horizontal header to find the size hint for a header section based on the contents of the given column.

See also sizeHintForRow().

pub unsafe fn size_hint_for_index(
    &self,
    index: impl CastInto<Ref<QModelIndex>>
) -> CppBox<QSize>
[src]

Returns the size hint for the item with the specified index or an invalid size for invalid indexes.

Calls C++ function: QSize QAbstractItemView::sizeHintForIndex(const QModelIndex& index) const.

C++ documentation:

Returns the size hint for the item with the specified index or an invalid size for invalid indexes.

See also sizeHintForRow() and sizeHintForColumn().

pub unsafe fn size_hint_for_row(&self, row: c_int) -> c_int[src]

Returns the height size hint for the specified row or -1 if there is no model.

Calls C++ function: virtual int QAbstractItemView::sizeHintForRow(int row) const.

C++ documentation:

Returns the height size hint for the specified row or -1 if there is no model.

The returned height is calculated using the size hints of the given row's items, i.e. the returned value is the maximum height among the items. Note that to control the height of a row, you must reimplement the QAbstractItemDelegate::sizeHint() function.

This function is used in views with a vertical header to find the size hint for a header section based on the contents of the given row.

See also sizeHintForColumn().

pub unsafe fn tab_key_navigation(&self) -> bool[src]

This property holds whether item navigation with tab and backtab is enabled.

Calls C++ function: bool QAbstractItemView::tabKeyNavigation() const.

C++ documentation:

This property holds whether item navigation with tab and backtab is enabled.

Access functions:

bool tabKeyNavigation() const
void setTabKeyNavigation(bool enable)

pub unsafe fn text_elide_mode(&self) -> TextElideMode[src]

This property holds the position of the "..." in elided text.

Calls C++ function: Qt::TextElideMode QAbstractItemView::textElideMode() const.

C++ documentation:

This property holds the position of the "..." in elided text.

The default value for all item views is Qt::ElideRight.

Access functions:

Qt::TextElideMode textElideMode() const
void setTextElideMode(Qt::TextElideMode mode)

pub unsafe fn update(&self, index: impl CastInto<Ref<QModelIndex>>)[src]

Updates the area occupied by the given index.

Calls C++ function: [slot] void QAbstractItemView::update(const QModelIndex& index).

C++ documentation:

Updates the area occupied by the given index.

This function was introduced in Qt 4.3.

pub unsafe fn vertical_scroll_mode(&self) -> ScrollMode[src]

how the view scrolls its contents in the vertical direction

Calls C++ function: QAbstractItemView::ScrollMode QAbstractItemView::verticalScrollMode() const.

C++ documentation:

how the view scrolls its contents in the vertical direction

This property controls how the view scroll its contents vertically. Scrolling can be done either per pixel or per item. Its default value comes from the style via the QStyle::SH_ItemView_ScrollMode style hint.

This property was introduced in Qt 4.2.

Access functions:

ScrollMode verticalScrollMode() const
void setVerticalScrollMode(ScrollMode mode)
void resetVerticalScrollMode()

pub unsafe fn visual_rect(
    &self,
    index: impl CastInto<Ref<QModelIndex>>
) -> CppBox<QRect>
[src]

Returns the rectangle on the viewport occupied by the item at index.

Calls C++ function: pure virtual QRect QAbstractItemView::visualRect(const QModelIndex& index) const.

C++ documentation:

Returns the rectangle on the viewport occupied by the item at index.

If your item is displayed in several areas then visualRect should return the primary area that contains index and not the complete area that index might encompasses, touch or cause drawing.

In the base class this is a pure virtual function.

See also indexAt() and visualRegionForSelection().

Trait Implementations

impl CppDeletable for QTreeView[src]

unsafe fn delete(&self)[src]

Destroys the tree view.

Calls C++ function: virtual [destructor] void QTreeView::~QTreeView().

C++ documentation:

Destroys the tree view.

impl Deref for QTreeView[src]

type Target = QAbstractItemView

The resulting type after dereferencing.

fn deref(&self) -> &QAbstractItemView[src]

Calls C++ function: QAbstractItemView* static_cast<QAbstractItemView*>(QTreeView* ptr).

impl DynamicCast<QTreeView> for QAbstractItemView[src]

unsafe fn dynamic_cast(ptr: Ptr<QAbstractItemView>) -> Ptr<QTreeView>[src]

Calls C++ function: QTreeView* dynamic_cast<QTreeView*>(QAbstractItemView* ptr).

impl DynamicCast<QTreeView> for QAbstractScrollArea[src]

unsafe fn dynamic_cast(ptr: Ptr<QAbstractScrollArea>) -> Ptr<QTreeView>[src]

Calls C++ function: QTreeView* dynamic_cast<QTreeView*>(QAbstractScrollArea* ptr).

impl DynamicCast<QTreeView> for QFrame[src]

unsafe fn dynamic_cast(ptr: Ptr<QFrame>) -> Ptr<QTreeView>[src]

Calls C++ function: QTreeView* dynamic_cast<QTreeView*>(QFrame* ptr).

impl DynamicCast<QTreeView> for QWidget[src]

unsafe fn dynamic_cast(ptr: Ptr<QWidget>) -> Ptr<QTreeView>[src]

Calls C++ function: QTreeView* dynamic_cast<QTreeView*>(QWidget* ptr).

impl DynamicCast<QTreeView> for QObject[src]

unsafe fn dynamic_cast(ptr: Ptr<QObject>) -> Ptr<QTreeView>[src]

Calls C++ function: QTreeView* dynamic_cast<QTreeView*>(QObject* ptr).

impl DynamicCast<QTreeView> for QPaintDevice[src]

unsafe fn dynamic_cast(ptr: Ptr<QPaintDevice>) -> Ptr<QTreeView>[src]

Calls C++ function: QTreeView* dynamic_cast<QTreeView*>(QPaintDevice* ptr).

impl DynamicCast<QTreeWidget> for QTreeView[src]

unsafe fn dynamic_cast(ptr: Ptr<QTreeView>) -> Ptr<QTreeWidget>[src]

Calls C++ function: QTreeWidget* dynamic_cast<QTreeWidget*>(QTreeView* ptr).

impl StaticDowncast<QTreeView> for QAbstractItemView[src]

unsafe fn static_downcast(ptr: Ptr<QAbstractItemView>) -> Ptr<QTreeView>[src]

Calls C++ function: QTreeView* static_cast<QTreeView*>(QAbstractItemView* ptr).

impl StaticDowncast<QTreeView> for QAbstractScrollArea[src]

unsafe fn static_downcast(ptr: Ptr<QAbstractScrollArea>) -> Ptr<QTreeView>[src]

Calls C++ function: QTreeView* static_cast<QTreeView*>(QAbstractScrollArea* ptr).

impl StaticDowncast<QTreeView> for QFrame[src]

unsafe fn static_downcast(ptr: Ptr<QFrame>) -> Ptr<QTreeView>[src]

Calls C++ function: QTreeView* static_cast<QTreeView*>(QFrame* ptr).

impl StaticDowncast<QTreeView> for QWidget[src]

unsafe fn static_downcast(ptr: Ptr<QWidget>) -> Ptr<QTreeView>[src]

Calls C++ function: QTreeView* static_cast<QTreeView*>(QWidget* ptr).

impl StaticDowncast<QTreeView> for QObject[src]

unsafe fn static_downcast(ptr: Ptr<QObject>) -> Ptr<QTreeView>[src]

Calls C++ function: QTreeView* static_cast<QTreeView*>(QObject* ptr).

impl StaticDowncast<QTreeView> for QPaintDevice[src]

unsafe fn static_downcast(ptr: Ptr<QPaintDevice>) -> Ptr<QTreeView>[src]

Calls C++ function: QTreeView* static_cast<QTreeView*>(QPaintDevice* ptr).

impl StaticDowncast<QTreeWidget> for QTreeView[src]

unsafe fn static_downcast(ptr: Ptr<QTreeView>) -> Ptr<QTreeWidget>[src]

Calls C++ function: QTreeWidget* static_cast<QTreeWidget*>(QTreeView* ptr).

impl StaticUpcast<QAbstractItemView> for QTreeView[src]

unsafe fn static_upcast(ptr: Ptr<QTreeView>) -> Ptr<QAbstractItemView>[src]

Calls C++ function: QAbstractItemView* static_cast<QAbstractItemView*>(QTreeView* ptr).

impl StaticUpcast<QAbstractScrollArea> for QTreeView[src]

unsafe fn static_upcast(ptr: Ptr<QTreeView>) -> Ptr<QAbstractScrollArea>[src]

Calls C++ function: QAbstractScrollArea* static_cast<QAbstractScrollArea*>(QTreeView* ptr).

impl StaticUpcast<QFrame> for QTreeView[src]

unsafe fn static_upcast(ptr: Ptr<QTreeView>) -> Ptr<QFrame>[src]

Calls C++ function: QFrame* static_cast<QFrame*>(QTreeView* ptr).

impl StaticUpcast<QObject> for QTreeView[src]

unsafe fn static_upcast(ptr: Ptr<QTreeView>) -> Ptr<QObject>[src]

Calls C++ function: QObject* static_cast<QObject*>(QTreeView* ptr).

impl StaticUpcast<QPaintDevice> for QTreeView[src]

unsafe fn static_upcast(ptr: Ptr<QTreeView>) -> Ptr<QPaintDevice>[src]

Calls C++ function: QPaintDevice* static_cast<QPaintDevice*>(QTreeView* ptr).

impl StaticUpcast<QTreeView> for QTreeWidget[src]

unsafe fn static_upcast(ptr: Ptr<QTreeWidget>) -> Ptr<QTreeView>[src]

Calls C++ function: QTreeView* static_cast<QTreeView*>(QTreeWidget* ptr).

impl StaticUpcast<QWidget> for QTreeView[src]

unsafe fn static_upcast(ptr: Ptr<QTreeView>) -> Ptr<QWidget>[src]

Calls C++ function: QWidget* static_cast<QWidget*>(QTreeView* ptr).

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.