[][src]Struct qt_widgets::QTreeWidgetItem

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

The QTreeWidgetItem class provides an item for use with the QTreeWidget convenience class.

C++ class: QTreeWidgetItem.

C++ documentation:

The QTreeWidgetItem class provides an item for use with the QTreeWidget convenience class.

Tree widget items are used to hold rows of information for tree widgets. Rows usually contain several columns of data, each of which can contain a text label and an icon.

The QTreeWidgetItem class is a convenience class that replaces the QListViewItem class in Qt 3. It provides an item for use with the QTreeWidget class.

Items are usually constructed with a parent that is either a QTreeWidget (for top-level items) or a QTreeWidgetItem (for items on lower levels of the tree). For example, the following code constructs a top-level item to represent cities of the world, and adds a entry for Oslo as a child item:

QTreeWidgetItem cities = new QTreeWidgetItem(treeWidget); cities->setText(0, tr("Cities")); QTreeWidgetItem osloItem = new QTreeWidgetItem(cities); osloItem->setText(0, tr("Oslo")); osloItem->setText(1, tr("Yes"));

Items can be added in a particular order by specifying the item they follow when they are constructed:

QTreeWidgetItem *planets = new QTreeWidgetItem(treeWidget, cities); planets->setText(0, tr("Planets"));

Each column in an item can have its own background brush which is set with the setBackground() function. The current background brush can be found with background(). The text label for each column can be rendered with its own font and brush. These are specified with the setFont() and setForeground() functions, and read with font() and foreground().

The main difference between top-level items and those in lower levels of the tree is that a top-level item has no parent(). This information can be used to tell the difference between items, and is useful to know when inserting and removing items from the tree. Children of an item can be removed with takeChild() and inserted at a given index in the list of children with the insertChild() function.

By default, items are enabled, selectable, checkable, and can be the source of a drag and drop operation. Each item's flags can be changed by calling setFlags() with the appropriate value (see Qt::ItemFlags). Checkable items can be checked and unchecked with the setCheckState() function. The corresponding checkState() function indicates whether the item is currently checked.

Methods

impl QTreeWidgetItem[src]

pub unsafe fn add_child(&self, child: impl CastInto<Ptr<QTreeWidgetItem>>)[src]

Appends the child item to the list of children.

Calls C++ function: void QTreeWidgetItem::addChild(QTreeWidgetItem* child).

C++ documentation:

Appends the child item to the list of children.

See also insertChild() and takeChild().

pub unsafe fn add_children(
    &self,
    children: impl CastInto<Ref<QListOfQTreeWidgetItem>>
)
[src]

Appends the given list of children to the item.

Calls C++ function: void QTreeWidgetItem::addChildren(const QList<QTreeWidgetItem*>& children).

C++ documentation:

Appends the given list of children to the item.

This function was introduced in Qt 4.1.

See also insertChildren() and takeChildren().

pub unsafe fn background(&self, column: c_int) -> CppBox<QBrush>[src]

Returns the brush used to render the background of the specified column.

Calls C++ function: QBrush QTreeWidgetItem::background(int column) const.

C++ documentation:

Returns the brush used to render the background of the specified column.

This function was introduced in Qt 4.2.

See also setBackground() and foreground().

pub unsafe fn background_color(&self, column: c_int) -> CppBox<QColor>[src]

This function is deprecated. Use background() instead.

Calls C++ function: QColor QTreeWidgetItem::backgroundColor(int column) const.

C++ documentation:

This function is deprecated. Use background() instead.

See also setBackgroundColor().

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

Returns the check state of the label in the given column.

Calls C++ function: Qt::CheckState QTreeWidgetItem::checkState(int column) const.

C++ documentation:

Returns the check state of the label in the given column.

See also setCheckState() and Qt::CheckState.

pub unsafe fn child(&self, index: c_int) -> Ptr<QTreeWidgetItem>[src]

Returns the item at the given index in the list of the item's children.

Calls C++ function: QTreeWidgetItem* QTreeWidgetItem::child(int index) const.

C++ documentation:

Returns the item at the given index in the list of the item's children.

See also parent().

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

Returns the number of child items.

Calls C++ function: int QTreeWidgetItem::childCount() const.

C++ documentation:

Returns the number of child items.

pub unsafe fn child_indicator_policy(&self) -> ChildIndicatorPolicy[src]

Returns the item indicator policy. This policy decides when the tree branch expand/collapse indicator is shown.

Calls C++ function: QTreeWidgetItem::ChildIndicatorPolicy QTreeWidgetItem::childIndicatorPolicy() const.

C++ documentation:

Returns the item indicator policy. This policy decides when the tree branch expand/collapse indicator is shown.

See also setChildIndicatorPolicy().

pub unsafe fn clone(&self) -> Ptr<QTreeWidgetItem>[src]

Creates a deep copy of the item and of its children.

Calls C++ function: virtual QTreeWidgetItem* QTreeWidgetItem::clone() const.

C++ documentation:

Creates a deep copy of the item and of its children.

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

Returns the number of columns in the item.

Calls C++ function: int QTreeWidgetItem::columnCount() const.

C++ documentation:

Returns the number of columns in the item.

pub unsafe fn copy_from(
    &self,
    other: impl CastInto<Ref<QTreeWidgetItem>>
) -> Ref<QTreeWidgetItem>
[src]

Assigns other's data and flags to this item. Note that type() and treeWidget() are not copied.

Calls C++ function: QTreeWidgetItem& QTreeWidgetItem::operator=(const QTreeWidgetItem& other).

C++ documentation:

Assigns other's data and flags to this item. Note that type() and treeWidget() are not copied.

This function is useful when reimplementing clone().

See also data() and flags().

pub unsafe fn data(&self, column: c_int, role: c_int) -> CppBox<QVariant>[src]

Returns the value for the item's column and role.

Calls C++ function: virtual QVariant QTreeWidgetItem::data(int column, int role) const.

C++ documentation:

Returns the value for the item's column and role.

See also setData().

pub unsafe fn flags(&self) -> QFlags<ItemFlag>[src]

Returns the flags used to describe the item. These determine whether the item can be checked, edited, and selected.

Calls C++ function: QFlags<Qt::ItemFlag> QTreeWidgetItem::flags() const.

C++ documentation:

Returns the flags used to describe the item. These determine whether the item can be checked, edited, and selected.

The default value for flags is Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled.

See also setFlags().

pub unsafe fn font(&self, column: c_int) -> CppBox<QFont>[src]

Returns the font used to render the text in the specified column.

Calls C++ function: QFont QTreeWidgetItem::font(int column) const.

C++ documentation:

Returns the font used to render the text in the specified column.

See also setFont().

pub unsafe fn foreground(&self, column: c_int) -> CppBox<QBrush>[src]

Returns the brush used to render the foreground (e.g. text) of the specified column.

Calls C++ function: QBrush QTreeWidgetItem::foreground(int column) const.

C++ documentation:

Returns the brush used to render the foreground (e.g. text) of the specified column.

This function was introduced in Qt 4.2.

See also setForeground() and background().

pub unsafe fn icon(&self, column: c_int) -> CppBox<QIcon>[src]

Returns the icon that is displayed in the specified column.

Calls C++ function: QIcon QTreeWidgetItem::icon(int column) const.

C++ documentation:

Returns the icon that is displayed in the specified column.

See also setIcon() and iconSize.

pub unsafe fn index_of_child(
    &self,
    child: impl CastInto<Ptr<QTreeWidgetItem>>
) -> c_int
[src]

Returns the index of the given child in the item's list of children.

Calls C++ function: int QTreeWidgetItem::indexOfChild(QTreeWidgetItem* child) const.

C++ documentation:

Returns the index of the given child in the item's list of children.

pub unsafe fn insert_child(
    &self,
    index: c_int,
    child: impl CastInto<Ptr<QTreeWidgetItem>>
)
[src]

Inserts the child item at index in the list of children.

Calls C++ function: void QTreeWidgetItem::insertChild(int index, QTreeWidgetItem* child).

C++ documentation:

Inserts the child item at index in the list of children.

If the child has already been inserted somewhere else it won't be inserted again.

pub unsafe fn insert_children(
    &self,
    index: c_int,
    children: impl CastInto<Ref<QListOfQTreeWidgetItem>>
)
[src]

Inserts the given list of children into the list of the item children at index .

Calls C++ function: void QTreeWidgetItem::insertChildren(int index, const QList<QTreeWidgetItem*>& children).

C++ documentation:

Inserts the given list of children into the list of the item children at index .

Children that have already been inserted somewhere else won't be inserted.

This function was introduced in Qt 4.1.

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

Returns true if the item is disabled; otherwise returns false.

Calls C++ function: bool QTreeWidgetItem::isDisabled() const.

C++ documentation:

Returns true if the item is disabled; otherwise returns false.

This function was introduced in Qt 4.3.

See also setFlags().

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

Returns true if the item is expanded, otherwise returns false.

Calls C++ function: bool QTreeWidgetItem::isExpanded() const.

C++ documentation:

Returns true if the item is expanded, otherwise returns false.

This function was introduced in Qt 4.2.

See also setExpanded().

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

Returns true if the item is spanning all the columns in a row; otherwise returns false.

Calls C++ function: bool QTreeWidgetItem::isFirstColumnSpanned() const.

C++ documentation:

Returns true if the item is spanning all the columns in a row; otherwise returns false.

This function was introduced in Qt 4.3.

See also setFirstColumnSpanned().

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

Returns true if the item is hidden, otherwise returns false.

Calls C++ function: bool QTreeWidgetItem::isHidden() const.

C++ documentation:

Returns true if the item is hidden, otherwise returns false.

This function was introduced in Qt 4.2.

See also setHidden().

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

Returns true if the item is selected, otherwise returns false.

Calls C++ function: bool QTreeWidgetItem::isSelected() const.

C++ documentation:

Returns true if the item is selected, otherwise returns false.

This function was introduced in Qt 4.2.

See also setSelected().

pub unsafe fn from_int(type_: c_int) -> CppBox<QTreeWidgetItem>[src]

Constructs a tree widget item of the specified type. The item must be inserted into a tree widget.

Calls C++ function: [constructor] void QTreeWidgetItem::QTreeWidgetItem(int type = …).

C++ documentation:

Constructs a tree widget item of the specified type. The item must be inserted into a tree widget.

See also type().

pub unsafe fn from_q_string_list_int(
    strings: impl CastInto<Ref<QStringList>>,
    type_: c_int
) -> CppBox<QTreeWidgetItem>
[src]

Constructs a tree widget item of the specified type. The item must be inserted into a tree widget. The given list of strings will be set as the item text for each column in the item.

Calls C++ function: [constructor] void QTreeWidgetItem::QTreeWidgetItem(const QStringList& strings, int type = …).

C++ documentation:

Constructs a tree widget item of the specified type. The item must be inserted into a tree widget. The given list of strings will be set as the item text for each column in the item.

See also type().

pub unsafe fn from_q_tree_widget_int(
    view: impl CastInto<Ptr<QTreeWidget>>,
    type_: c_int
) -> CppBox<QTreeWidgetItem>
[src]

Constructs a tree widget item of the specified type and appends it to the items in the given parent.

Calls C++ function: [constructor] void QTreeWidgetItem::QTreeWidgetItem(QTreeWidget* view, int type = …).

C++ documentation:

Constructs a tree widget item of the specified type and appends it to the items in the given parent.

See also type().

pub unsafe fn from_q_tree_widget_q_string_list_int(
    view: impl CastInto<Ptr<QTreeWidget>>,
    strings: impl CastInto<Ref<QStringList>>,
    type_: c_int
) -> CppBox<QTreeWidgetItem>
[src]

Constructs a tree widget item of the specified type and appends it to the items in the given parent. The given list of strings will be set as the item text for each column in the item.

Calls C++ function: [constructor] void QTreeWidgetItem::QTreeWidgetItem(QTreeWidget* view, const QStringList& strings, int type = …).

C++ documentation:

Constructs a tree widget item of the specified type and appends it to the items in the given parent. The given list of strings will be set as the item text for each column in the item.

See also type().

pub unsafe fn from_q_tree_widget_q_tree_widget_item_int(
    view: impl CastInto<Ptr<QTreeWidget>>,
    after: impl CastInto<Ptr<QTreeWidgetItem>>,
    type_: c_int
) -> CppBox<QTreeWidgetItem>
[src]

Constructs a tree widget item of the specified type and inserts it into the given parent after the preceding item.

Calls C++ function: [constructor] void QTreeWidgetItem::QTreeWidgetItem(QTreeWidget* view, QTreeWidgetItem* after, int type = …).

C++ documentation:

Constructs a tree widget item of the specified type and inserts it into the given parent after the preceding item.

See also type().

pub unsafe fn from_q_tree_widget_item_int(
    parent: impl CastInto<Ptr<QTreeWidgetItem>>,
    type_: c_int
) -> CppBox<QTreeWidgetItem>
[src]

Constructs a tree widget item and append it to the given parent.

Calls C++ function: [constructor] void QTreeWidgetItem::QTreeWidgetItem(QTreeWidgetItem* parent, int type = …).

C++ documentation:

Constructs a tree widget item and append it to the given parent.

See also type().

pub unsafe fn from_q_tree_widget_item_q_string_list_int(
    parent: impl CastInto<Ptr<QTreeWidgetItem>>,
    strings: impl CastInto<Ref<QStringList>>,
    type_: c_int
) -> CppBox<QTreeWidgetItem>
[src]

Constructs a tree widget item and append it to the given parent. The given list of strings will be set as the item text for each column in the item.

Calls C++ function: [constructor] void QTreeWidgetItem::QTreeWidgetItem(QTreeWidgetItem* parent, const QStringList& strings, int type = …).

C++ documentation:

Constructs a tree widget item and append it to the given parent. The given list of strings will be set as the item text for each column in the item.

See also type().

pub unsafe fn from_2_q_tree_widget_item_int(
    parent: impl CastInto<Ptr<QTreeWidgetItem>>,
    after: impl CastInto<Ptr<QTreeWidgetItem>>,
    type_: c_int
) -> CppBox<QTreeWidgetItem>
[src]

Constructs a tree widget item of the specified type that is inserted into the parent after the preceding child item.

Calls C++ function: [constructor] void QTreeWidgetItem::QTreeWidgetItem(QTreeWidgetItem* parent, QTreeWidgetItem* after, int type = …).

C++ documentation:

Constructs a tree widget item of the specified type that is inserted into the parent after the preceding child item.

See also type().

pub unsafe fn new() -> CppBox<QTreeWidgetItem>[src]

The QTreeWidgetItem class provides an item for use with the QTreeWidget convenience class.

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

C++ documentation:

The QTreeWidgetItem class provides an item for use with the QTreeWidget convenience class.

Tree widget items are used to hold rows of information for tree widgets. Rows usually contain several columns of data, each of which can contain a text label and an icon.

The QTreeWidgetItem class is a convenience class that replaces the QListViewItem class in Qt 3. It provides an item for use with the QTreeWidget class.

Items are usually constructed with a parent that is either a QTreeWidget (for top-level items) or a QTreeWidgetItem (for items on lower levels of the tree). For example, the following code constructs a top-level item to represent cities of the world, and adds a entry for Oslo as a child item:

QTreeWidgetItem cities = new QTreeWidgetItem(treeWidget); cities->setText(0, tr("Cities")); QTreeWidgetItem osloItem = new QTreeWidgetItem(cities); osloItem->setText(0, tr("Oslo")); osloItem->setText(1, tr("Yes"));

Items can be added in a particular order by specifying the item they follow when they are constructed:

QTreeWidgetItem *planets = new QTreeWidgetItem(treeWidget, cities); planets->setText(0, tr("Planets"));

Each column in an item can have its own background brush which is set with the setBackground() function. The current background brush can be found with background(). The text label for each column can be rendered with its own font and brush. These are specified with the setFont() and setForeground() functions, and read with font() and foreground().

The main difference between top-level items and those in lower levels of the tree is that a top-level item has no parent(). This information can be used to tell the difference between items, and is useful to know when inserting and removing items from the tree. Children of an item can be removed with takeChild() and inserted at a given index in the list of children with the insertChild() function.

By default, items are enabled, selectable, checkable, and can be the source of a drag and drop operation. Each item's flags can be changed by calling setFlags() with the appropriate value (see Qt::ItemFlags). Checkable items can be checked and unchecked with the setCheckState() function. The corresponding checkState() function indicates whether the item is currently checked.

pub unsafe fn from_q_string_list(
    strings: impl CastInto<Ref<QStringList>>
) -> CppBox<QTreeWidgetItem>
[src]

Constructs a tree widget item of the specified type. The item must be inserted into a tree widget. The given list of strings will be set as the item text for each column in the item.

Calls C++ function: [constructor] void QTreeWidgetItem::QTreeWidgetItem(const QStringList& strings).

C++ documentation:

Constructs a tree widget item of the specified type. The item must be inserted into a tree widget. The given list of strings will be set as the item text for each column in the item.

See also type().

pub unsafe fn from_q_tree_widget(
    view: impl CastInto<Ptr<QTreeWidget>>
) -> CppBox<QTreeWidgetItem>
[src]

Constructs a tree widget item of the specified type and appends it to the items in the given parent.

Calls C++ function: [constructor] void QTreeWidgetItem::QTreeWidgetItem(QTreeWidget* view).

C++ documentation:

Constructs a tree widget item of the specified type and appends it to the items in the given parent.

See also type().

pub unsafe fn from_q_tree_widget_q_string_list(
    view: impl CastInto<Ptr<QTreeWidget>>,
    strings: impl CastInto<Ref<QStringList>>
) -> CppBox<QTreeWidgetItem>
[src]

Constructs a tree widget item of the specified type and appends it to the items in the given parent. The given list of strings will be set as the item text for each column in the item.

Calls C++ function: [constructor] void QTreeWidgetItem::QTreeWidgetItem(QTreeWidget* view, const QStringList& strings).

C++ documentation:

Constructs a tree widget item of the specified type and appends it to the items in the given parent. The given list of strings will be set as the item text for each column in the item.

See also type().

pub unsafe fn from_q_tree_widget_q_tree_widget_item(
    view: impl CastInto<Ptr<QTreeWidget>>,
    after: impl CastInto<Ptr<QTreeWidgetItem>>
) -> CppBox<QTreeWidgetItem>
[src]

Constructs a tree widget item of the specified type and inserts it into the given parent after the preceding item.

Calls C++ function: [constructor] void QTreeWidgetItem::QTreeWidgetItem(QTreeWidget* view, QTreeWidgetItem* after).

C++ documentation:

Constructs a tree widget item of the specified type and inserts it into the given parent after the preceding item.

See also type().

pub unsafe fn from_q_tree_widget_item(
    parent: impl CastInto<Ptr<QTreeWidgetItem>>
) -> CppBox<QTreeWidgetItem>
[src]

Constructs a tree widget item and append it to the given parent.

Calls C++ function: [constructor] void QTreeWidgetItem::QTreeWidgetItem(QTreeWidgetItem* parent).

C++ documentation:

Constructs a tree widget item and append it to the given parent.

See also type().

pub unsafe fn from_q_tree_widget_item_q_string_list(
    parent: impl CastInto<Ptr<QTreeWidgetItem>>,
    strings: impl CastInto<Ref<QStringList>>
) -> CppBox<QTreeWidgetItem>
[src]

Constructs a tree widget item and append it to the given parent. The given list of strings will be set as the item text for each column in the item.

Calls C++ function: [constructor] void QTreeWidgetItem::QTreeWidgetItem(QTreeWidgetItem* parent, const QStringList& strings).

C++ documentation:

Constructs a tree widget item and append it to the given parent. The given list of strings will be set as the item text for each column in the item.

See also type().

pub unsafe fn from_2_q_tree_widget_item(
    parent: impl CastInto<Ptr<QTreeWidgetItem>>,
    after: impl CastInto<Ptr<QTreeWidgetItem>>
) -> CppBox<QTreeWidgetItem>
[src]

Constructs a tree widget item of the specified type that is inserted into the parent after the preceding child item.

Calls C++ function: [constructor] void QTreeWidgetItem::QTreeWidgetItem(QTreeWidgetItem* parent, QTreeWidgetItem* after).

C++ documentation:

Constructs a tree widget item of the specified type that is inserted into the parent after the preceding child item.

See also type().

pub unsafe fn new_copy(
    other: impl CastInto<Ref<QTreeWidgetItem>>
) -> CppBox<QTreeWidgetItem>
[src]

Constructs a copy of other. Note that type() and treeWidget() are not copied.

Calls C++ function: [constructor] void QTreeWidgetItem::QTreeWidgetItem(const QTreeWidgetItem& other).

C++ documentation:

Constructs a copy of other. Note that type() and treeWidget() are not copied.

This function is useful when reimplementing clone().

This function was introduced in Qt 4.1.

See also data() and flags().

pub unsafe fn parent(&self) -> Ptr<QTreeWidgetItem>[src]

Returns the item's parent.

Calls C++ function: QTreeWidgetItem* QTreeWidgetItem::parent() const.

C++ documentation:

Returns the item's parent.

See also child().

pub unsafe fn read(&self, in_: impl CastInto<Ref<QDataStream>>)[src]

Reads the item from stream in. This only reads data into a single item.

Calls C++ function: virtual void QTreeWidgetItem::read(QDataStream& in).

C++ documentation:

Reads the item from stream in. This only reads data into a single item.

See also write().

pub unsafe fn remove_child(&self, child: impl CastInto<Ptr<QTreeWidgetItem>>)[src]

Removes the given item indicated by child. The removed item will not be deleted.

Calls C++ function: void QTreeWidgetItem::removeChild(QTreeWidgetItem* child).

C++ documentation:

Removes the given item indicated by child. The removed item will not be deleted.

pub unsafe fn set_background(
    &self,
    column: c_int,
    brush: impl CastInto<Ref<QBrush>>
)
[src]

Sets the background brush of the label in the given column to the specified brush.

Calls C++ function: void QTreeWidgetItem::setBackground(int column, const QBrush& brush).

C++ documentation:

Sets the background brush of the label in the given column to the specified brush.

This function was introduced in Qt 4.2.

See also background() and setForeground().

pub unsafe fn set_background_color(
    &self,
    column: c_int,
    color: impl CastInto<Ref<QColor>>
)
[src]

This function is deprecated. Use setBackground() instead.

Calls C++ function: void QTreeWidgetItem::setBackgroundColor(int column, const QColor& color).

C++ documentation:

This function is deprecated. Use setBackground() instead.

See also backgroundColor().

pub unsafe fn set_check_state(&self, column: c_int, state: CheckState)[src]

Sets the item in the given column check state to be state.

Calls C++ function: void QTreeWidgetItem::setCheckState(int column, Qt::CheckState state).

C++ documentation:

Sets the item in the given column check state to be state.

See also checkState().

pub unsafe fn set_child_indicator_policy(&self, policy: ChildIndicatorPolicy)[src]

Sets the item indicator policy. This policy decides when the tree branch expand/collapse indicator is shown. The default value is ShowForChildren.

Calls C++ function: void QTreeWidgetItem::setChildIndicatorPolicy(QTreeWidgetItem::ChildIndicatorPolicy policy).

C++ documentation:

Sets the item indicator policy. This policy decides when the tree branch expand/collapse indicator is shown. The default value is ShowForChildren.

See also childIndicatorPolicy().

pub unsafe fn set_data(
    &self,
    column: c_int,
    role: c_int,
    value: impl CastInto<Ref<QVariant>>
)
[src]

Sets the value for the item's column and role to the given value.

Calls C++ function: virtual void QTreeWidgetItem::setData(int column, int role, const QVariant& value).

C++ documentation:

Sets the value for the item's column and role to the given value.

The role describes the type of data specified by value, and is defined by the Qt::ItemDataRole enum.

Note: The default implementation treats Qt::EditRole and Qt::DisplayRole as referring to the same data.

See also data().

pub unsafe fn set_disabled(&self, disabled: bool)[src]

Disables the item if disabled is true; otherwise enables the item.

Calls C++ function: void QTreeWidgetItem::setDisabled(bool disabled).

C++ documentation:

Disables the item if disabled is true; otherwise enables the item.

This function was introduced in Qt 4.3.

See also isDisabled() and setFlags().

pub unsafe fn set_expanded(&self, expand: bool)[src]

Expands the item if expand is true, otherwise collapses the item.

Calls C++ function: void QTreeWidgetItem::setExpanded(bool expand).

C++ documentation:

Expands the item if expand is true, otherwise collapses the item.

Warning: The QTreeWidgetItem must be added to the QTreeWidget before calling this function.

This function was introduced in Qt 4.2.

See also isExpanded().

pub unsafe fn set_first_column_spanned(&self, span: bool)[src]

Sets the first section to span all columns if span is true; otherwise all item sections are shown.

Calls C++ function: void QTreeWidgetItem::setFirstColumnSpanned(bool span).

C++ documentation:

Sets the first section to span all columns if span is true; otherwise all item sections are shown.

This function was introduced in Qt 4.3.

See also isFirstColumnSpanned().

pub unsafe fn set_flags(&self, flags: QFlags<ItemFlag>)[src]

Sets the flags for the item to the given flags. These determine whether the item can be selected or modified. This is often used to disable an item.

Calls C++ function: void QTreeWidgetItem::setFlags(QFlags<Qt::ItemFlag> flags).

C++ documentation:

Sets the flags for the item to the given flags. These determine whether the item can be selected or modified. This is often used to disable an item.

See also flags().

pub unsafe fn set_font(&self, column: c_int, font: impl CastInto<Ref<QFont>>)[src]

Sets the font used to display the text in the given column to the given font.

Calls C++ function: void QTreeWidgetItem::setFont(int column, const QFont& font).

C++ documentation:

Sets the font used to display the text in the given column to the given font.

See also font(), setText(), and setForeground().

pub unsafe fn set_foreground(
    &self,
    column: c_int,
    brush: impl CastInto<Ref<QBrush>>
)
[src]

Sets the foreground brush of the label in the given column to the specified brush.

Calls C++ function: void QTreeWidgetItem::setForeground(int column, const QBrush& brush).

C++ documentation:

Sets the foreground brush of the label in the given column to the specified brush.

This function was introduced in Qt 4.2.

See also foreground() and setBackground().

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

Hides the item if hide is true, otherwise shows the item.

Calls C++ function: void QTreeWidgetItem::setHidden(bool hide).

C++ documentation:

Hides the item if hide is true, otherwise shows the item.

Note: A call to this function has no effect if the item is not currently in a view. In particular, calling setHidden(true) on an item and only then adding it to a view will result in a visible item.

This function was introduced in Qt 4.2.

See also isHidden().

pub unsafe fn set_icon(&self, column: c_int, icon: impl CastInto<Ref<QIcon>>)[src]

Sets the icon to be displayed in the given column to icon.

Calls C++ function: void QTreeWidgetItem::setIcon(int column, const QIcon& icon).

C++ documentation:

Sets the icon to be displayed in the given column to icon.

See also icon(), setText(), and iconSize.

pub unsafe fn set_selected(&self, select: bool)[src]

Sets the selected state of the item to select.

Calls C++ function: void QTreeWidgetItem::setSelected(bool select).

C++ documentation:

Sets the selected state of the item to select.

This function was introduced in Qt 4.2.

See also isSelected().

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

Sets the size hint for the tree item in the given column to be size. If no size hint is set, the item delegate will compute the size hint based on the item data.

Calls C++ function: void QTreeWidgetItem::setSizeHint(int column, const QSize& size).

C++ documentation:

Sets the size hint for the tree item in the given column to be size. If no size hint is set, the item delegate will compute the size hint based on the item data.

This function was introduced in Qt 4.1.

See also sizeHint().

pub unsafe fn set_status_tip(
    &self,
    column: c_int,
    status_tip: impl CastInto<Ref<QString>>
)
[src]

Sets the status tip for the given column to the given statusTip. QTreeWidget mouse tracking needs to be enabled for this feature to work.

Calls C++ function: void QTreeWidgetItem::setStatusTip(int column, const QString& statusTip).

C++ documentation:

Sets the status tip for the given column to the given statusTip. QTreeWidget mouse tracking needs to be enabled for this feature to work.

See also statusTip(), setToolTip(), and setWhatsThis().

pub unsafe fn set_text(&self, column: c_int, text: impl CastInto<Ref<QString>>)[src]

Sets the text to be displayed in the given column to the given text.

Calls C++ function: void QTreeWidgetItem::setText(int column, const QString& text).

C++ documentation:

Sets the text to be displayed in the given column to the given text.

See also text(), setFont(), and setForeground().

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

Sets the text alignment for the label in the given column to the alignment specified (see Qt::AlignmentFlag).

Calls C++ function: void QTreeWidgetItem::setTextAlignment(int column, int alignment).

C++ documentation:

Sets the text alignment for the label in the given column to the alignment specified (see Qt::AlignmentFlag).

See also textAlignment().

pub unsafe fn set_text_color(
    &self,
    column: c_int,
    color: impl CastInto<Ref<QColor>>
)
[src]

This function is deprecated. Use setForeground() instead.

Calls C++ function: void QTreeWidgetItem::setTextColor(int column, const QColor& color).

C++ documentation:

This function is deprecated. Use setForeground() instead.

See also textColor().

pub unsafe fn set_tool_tip(
    &self,
    column: c_int,
    tool_tip: impl CastInto<Ref<QString>>
)
[src]

Sets the tooltip for the given column to toolTip.

Calls C++ function: void QTreeWidgetItem::setToolTip(int column, const QString& toolTip).

C++ documentation:

Sets the tooltip for the given column to toolTip.

See also toolTip(), setStatusTip(), and setWhatsThis().

pub unsafe fn set_whats_this(
    &self,
    column: c_int,
    whats_this: impl CastInto<Ref<QString>>
)
[src]

Sets the "What's This?" help for the given column to whatsThis.

Calls C++ function: void QTreeWidgetItem::setWhatsThis(int column, const QString& whatsThis).

C++ documentation:

Sets the "What's This?" help for the given column to whatsThis.

See also whatsThis(), setStatusTip(), and setToolTip().

pub unsafe fn size_hint(&self, column: c_int) -> CppBox<QSize>[src]

Returns the size hint set for the tree item in the given column (see QSize).

Calls C++ function: QSize QTreeWidgetItem::sizeHint(int column) const.

C++ documentation:

Returns the size hint set for the tree item in the given column (see QSize).

This function was introduced in Qt 4.1.

See also setSizeHint().

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

Sorts the children of the item using the given order, by the values in the given column.

Calls C++ function: void QTreeWidgetItem::sortChildren(int column, Qt::SortOrder order).

C++ documentation:

Sorts the children of the item using the given order, by the values in the given column.

Note: This function does nothing if the item is not associated with a QTreeWidget.

This function was introduced in Qt 4.2.

pub unsafe fn status_tip(&self, column: c_int) -> CppBox<QString>[src]

Returns the status tip for the contents of the given column.

Calls C++ function: QString QTreeWidgetItem::statusTip(int column) const.

C++ documentation:

Returns the status tip for the contents of the given column.

See also setStatusTip().

pub unsafe fn take_child(&self, index: c_int) -> Ptr<QTreeWidgetItem>[src]

Removes the item at index and returns it, otherwise return 0.

Calls C++ function: QTreeWidgetItem* QTreeWidgetItem::takeChild(int index).

C++ documentation:

Removes the item at index and returns it, otherwise return 0.

pub unsafe fn take_children(&self) -> CppBox<QListOfQTreeWidgetItem>[src]

Removes the list of children and returns it, otherwise returns an empty list.

Calls C++ function: QList<QTreeWidgetItem*> QTreeWidgetItem::takeChildren().

C++ documentation:

Removes the list of children and returns it, otherwise returns an empty list.

This function was introduced in Qt 4.1.

pub unsafe fn text(&self, column: c_int) -> CppBox<QString>[src]

Returns the text in the specified column.

Calls C++ function: QString QTreeWidgetItem::text(int column) const.

C++ documentation:

Returns the text in the specified column.

See also setText().

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

Returns the text alignment for the label in the given column (see Qt::AlignmentFlag).

Calls C++ function: int QTreeWidgetItem::textAlignment(int column) const.

C++ documentation:

Returns the text alignment for the label in the given column (see Qt::AlignmentFlag).

See also setTextAlignment().

pub unsafe fn text_color(&self, column: c_int) -> CppBox<QColor>[src]

This function is deprecated. Use foreground() instead.

Calls C++ function: QColor QTreeWidgetItem::textColor(int column) const.

C++ documentation:

This function is deprecated. Use foreground() instead.

See also setTextColor().

pub unsafe fn tool_tip(&self, column: c_int) -> CppBox<QString>[src]

Returns the tool tip for the given column.

Calls C++ function: QString QTreeWidgetItem::toolTip(int column) const.

C++ documentation:

Returns the tool tip for the given column.

See also setToolTip().

pub unsafe fn tree_widget(&self) -> QPtr<QTreeWidget>[src]

Returns the tree widget that contains the item.

Calls C++ function: QTreeWidget* QTreeWidgetItem::treeWidget() const.

C++ documentation:

Returns the tree widget that contains the item.

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

Returns the type passed to the QTreeWidgetItem constructor.

Calls C++ function: int QTreeWidgetItem::type() const.

C++ documentation:

Returns the type passed to the QTreeWidgetItem constructor.

pub unsafe fn whats_this(&self, column: c_int) -> CppBox<QString>[src]

Returns the "What's This?" help for the contents of the given column.

Calls C++ function: QString QTreeWidgetItem::whatsThis(int column) const.

C++ documentation:

Returns the "What's This?" help for the contents of the given column.

See also setWhatsThis().

pub unsafe fn write(&self, out: impl CastInto<Ref<QDataStream>>)[src]

Writes the item to stream out. This only writes data from one single item.

Calls C++ function: virtual void QTreeWidgetItem::write(QDataStream& out) const.

C++ documentation:

Writes the item to stream out. This only writes data from one single item.

See also read().

Trait Implementations

impl CppDeletable for QTreeWidgetItem[src]

unsafe fn delete(&self)[src]

Destroys this tree widget item.

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

C++ documentation:

Destroys this tree widget item.

The item will be removed from QTreeWidgets to which it has been added. This makes it safe to delete an item at any time.

impl Lt<Ref<QTreeWidgetItem>> for QTreeWidgetItem[src]

unsafe fn lt(&self, other: &Ref<QTreeWidgetItem>) -> bool[src]

Returns true if the text in the item is less than the text in the other item, otherwise returns false.

Calls C++ function: virtual bool QTreeWidgetItem::operator<(const QTreeWidgetItem& other) const.

C++ documentation:

Returns true if the text in the item is less than the text in the other item, otherwise returns false.

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.