#[repr(C)]pub struct QTreeWidgetItem { /* private fields */ }
Expand description
The QTreeWidgetItem class provides an item for use with the QTreeWidget convenience class.
C++ class: QTreeWidgetItem
.
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.
Implementations§
Source§impl QTreeWidgetItem
impl QTreeWidgetItem
Sourcepub unsafe fn add_child(&self, child: impl CastInto<Ptr<QTreeWidgetItem>>)
pub unsafe fn add_child(&self, child: impl CastInto<Ptr<QTreeWidgetItem>>)
Appends the child item to the list of children.
Calls C++ function: void QTreeWidgetItem::addChild(QTreeWidgetItem* child)
.
Appends the child item to the list of children.
See also insertChild() and takeChild().
Sourcepub unsafe fn add_children(
&self,
children: impl CastInto<Ref<QListOfQTreeWidgetItem>>,
)
pub unsafe fn add_children( &self, children: impl CastInto<Ref<QListOfQTreeWidgetItem>>, )
Appends the given list of children to the item.
Calls C++ function: void QTreeWidgetItem::addChildren(const QList<QTreeWidgetItem*>& children)
.
Appends the given list of children to the item.
This function was introduced in Qt 4.1.
See also insertChildren() and takeChildren().
Sourcepub unsafe fn background(&self, column: c_int) -> CppBox<QBrush>
pub unsafe fn background(&self, column: c_int) -> CppBox<QBrush>
Returns the brush used to render the background of the specified column.
Calls C++ function: QBrush QTreeWidgetItem::background(int column) const
.
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().
Sourcepub unsafe fn background_color(&self, column: c_int) -> CppBox<QColor>
pub unsafe fn background_color(&self, column: c_int) -> CppBox<QColor>
This function is deprecated. Use background() instead.
Calls C++ function: QColor QTreeWidgetItem::backgroundColor(int column) const
.
This function is deprecated. Use background() instead.
See also setBackgroundColor().
Sourcepub unsafe fn check_state(&self, column: c_int) -> CheckState
pub unsafe fn check_state(&self, column: c_int) -> CheckState
Returns the check state of the label in the given column.
Calls C++ function: Qt::CheckState QTreeWidgetItem::checkState(int column) const
.
Returns the check state of the label in the given column.
See also setCheckState() and Qt::CheckState.
Sourcepub unsafe fn child(&self, index: c_int) -> Ptr<QTreeWidgetItem>
pub unsafe fn child(&self, index: c_int) -> Ptr<QTreeWidgetItem>
Returns the item at the given index in the list of the item's children.
Calls C++ function: QTreeWidgetItem* QTreeWidgetItem::child(int index) const
.
Returns the item at the given index in the list of the item’s children.
See also parent().
Sourcepub unsafe fn child_count(&self) -> c_int
pub unsafe fn child_count(&self) -> c_int
Returns the number of child items.
Calls C++ function: int QTreeWidgetItem::childCount() const
.
Returns the number of child items.
Sourcepub unsafe fn child_indicator_policy(&self) -> ChildIndicatorPolicy
pub unsafe fn child_indicator_policy(&self) -> ChildIndicatorPolicy
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
.
Returns the item indicator policy. This policy decides when the tree branch expand/collapse indicator is shown.
See also setChildIndicatorPolicy().
Sourcepub unsafe fn clone(&self) -> Ptr<QTreeWidgetItem>
pub unsafe fn clone(&self) -> Ptr<QTreeWidgetItem>
Creates a deep copy of the item and of its children.
Calls C++ function: virtual QTreeWidgetItem* QTreeWidgetItem::clone() const
.
Creates a deep copy of the item and of its children.
Sourcepub unsafe fn column_count(&self) -> c_int
pub unsafe fn column_count(&self) -> c_int
Returns the number of columns in the item.
Calls C++ function: int QTreeWidgetItem::columnCount() const
.
Returns the number of columns in the item.
Sourcepub unsafe fn copy_from(
&self,
other: impl CastInto<Ref<QTreeWidgetItem>>,
) -> Ref<QTreeWidgetItem>
pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QTreeWidgetItem>>, ) -> Ref<QTreeWidgetItem>
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)
.
Assigns other’s data and flags to this item. Note that type() and treeWidget() are not copied.
This function is useful when reimplementing clone().
Sourcepub unsafe fn data(&self, column: c_int, role: c_int) -> CppBox<QVariant>
pub unsafe fn data(&self, column: c_int, role: c_int) -> CppBox<QVariant>
Returns the value for the item's column and role.
Calls C++ function: virtual QVariant QTreeWidgetItem::data(int column, int role) const
.
Returns the value for the item’s column and role.
See also setData().
Sourcepub unsafe fn flags(&self) -> QFlags<ItemFlag>
pub unsafe fn flags(&self) -> QFlags<ItemFlag>
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
.
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().
Sourcepub unsafe fn font(&self, column: c_int) -> CppBox<QFont>
pub unsafe fn font(&self, column: c_int) -> CppBox<QFont>
Returns the font used to render the text in the specified column.
Calls C++ function: QFont QTreeWidgetItem::font(int column) const
.
Returns the font used to render the text in the specified column.
See also setFont().
Sourcepub unsafe fn foreground(&self, column: c_int) -> CppBox<QBrush>
pub unsafe fn foreground(&self, column: c_int) -> CppBox<QBrush>
Returns the brush used to render the foreground (e.g. text) of the specified column.
Calls C++ function: QBrush QTreeWidgetItem::foreground(int column) const
.
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().
Sourcepub unsafe fn icon(&self, column: c_int) -> CppBox<QIcon>
pub unsafe fn icon(&self, column: c_int) -> CppBox<QIcon>
Returns the icon that is displayed in the specified column.
Calls C++ function: QIcon QTreeWidgetItem::icon(int column) const
.
Sourcepub unsafe fn index_of_child(
&self,
child: impl CastInto<Ptr<QTreeWidgetItem>>,
) -> c_int
pub unsafe fn index_of_child( &self, child: impl CastInto<Ptr<QTreeWidgetItem>>, ) -> c_int
Returns the index of the given child in the item's list of children.
Calls C++ function: int QTreeWidgetItem::indexOfChild(QTreeWidgetItem* child) const
.
Returns the index of the given child in the item’s list of children.
Sourcepub unsafe fn insert_child(
&self,
index: c_int,
child: impl CastInto<Ptr<QTreeWidgetItem>>,
)
pub unsafe fn insert_child( &self, index: c_int, child: impl CastInto<Ptr<QTreeWidgetItem>>, )
Inserts the child item at index in the list of children.
Calls C++ function: void QTreeWidgetItem::insertChild(int index, QTreeWidgetItem* child)
.
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.
Sourcepub unsafe fn insert_children(
&self,
index: c_int,
children: impl CastInto<Ref<QListOfQTreeWidgetItem>>,
)
pub unsafe fn insert_children( &self, index: c_int, children: impl CastInto<Ref<QListOfQTreeWidgetItem>>, )
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)
.
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.
Sourcepub unsafe fn is_disabled(&self) -> bool
pub unsafe fn is_disabled(&self) -> bool
Returns true
if the item is disabled; otherwise returns false
.
Calls C++ function: bool QTreeWidgetItem::isDisabled() const
.
Returns true
if the item is disabled; otherwise returns false
.
This function was introduced in Qt 4.3.
See also setFlags().
Sourcepub unsafe fn is_expanded(&self) -> bool
pub unsafe fn is_expanded(&self) -> bool
Returns true
if the item is expanded, otherwise returns false
.
Calls C++ function: bool QTreeWidgetItem::isExpanded() const
.
Returns true
if the item is expanded, otherwise returns false
.
This function was introduced in Qt 4.2.
See also setExpanded().
Sourcepub unsafe fn is_first_column_spanned(&self) -> bool
pub unsafe fn is_first_column_spanned(&self) -> bool
Returns true
if the item is spanning all the columns in a row; otherwise returns false
.
Calls C++ function: bool QTreeWidgetItem::isFirstColumnSpanned() const
.
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().
Returns true
if the item is hidden, otherwise returns false
.
Calls C++ function: bool QTreeWidgetItem::isHidden() const
.
Returns true
if the item is hidden, otherwise returns false
.
This function was introduced in Qt 4.2.
See also setHidden().
Sourcepub unsafe fn is_selected(&self) -> bool
pub unsafe fn is_selected(&self) -> bool
Returns true
if the item is selected, otherwise returns false
.
Calls C++ function: bool QTreeWidgetItem::isSelected() const
.
Returns true
if the item is selected, otherwise returns false
.
This function was introduced in Qt 4.2.
See also setSelected().
Sourcepub unsafe fn from_int(type_: c_int) -> CppBox<QTreeWidgetItem>
pub unsafe fn from_int(type_: c_int) -> CppBox<QTreeWidgetItem>
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 = …)
.
Constructs a tree widget item of the specified type. The item must be inserted into a tree widget.
See also type().
Sourcepub unsafe fn from_q_string_list_int(
strings: impl CastInto<Ref<QStringList>>,
type_: c_int,
) -> CppBox<QTreeWidgetItem>
pub unsafe fn from_q_string_list_int( strings: impl CastInto<Ref<QStringList>>, type_: c_int, ) -> CppBox<QTreeWidgetItem>
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 = …)
.
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().
Sourcepub unsafe fn from_q_tree_widget_int(
view: impl CastInto<Ptr<QTreeWidget>>,
type_: c_int,
) -> CppBox<QTreeWidgetItem>
pub unsafe fn from_q_tree_widget_int( view: impl CastInto<Ptr<QTreeWidget>>, type_: c_int, ) -> CppBox<QTreeWidgetItem>
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 = …)
.
Constructs a tree widget item of the specified type and appends it to the items in the given parent.
See also type().
Sourcepub 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>
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>
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 = …)
.
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().
Sourcepub 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>
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>
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 = …)
.
Constructs a tree widget item of the specified type and inserts it into the given parent after the preceding item.
See also type().
Sourcepub unsafe fn from_q_tree_widget_item_int(
parent: impl CastInto<Ptr<QTreeWidgetItem>>,
type_: c_int,
) -> CppBox<QTreeWidgetItem>
pub unsafe fn from_q_tree_widget_item_int( parent: impl CastInto<Ptr<QTreeWidgetItem>>, type_: c_int, ) -> CppBox<QTreeWidgetItem>
Constructs a tree widget item and append it to the given parent.
Calls C++ function: [constructor] void QTreeWidgetItem::QTreeWidgetItem(QTreeWidgetItem* parent, int type = …)
.
Constructs a tree widget item and append it to the given parent.
See also type().
Sourcepub 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>
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>
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 = …)
.
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().
Sourcepub unsafe fn from_2_q_tree_widget_item_int(
parent: impl CastInto<Ptr<QTreeWidgetItem>>,
after: impl CastInto<Ptr<QTreeWidgetItem>>,
type_: c_int,
) -> CppBox<QTreeWidgetItem>
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>
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 = …)
.
Constructs a tree widget item of the specified type that is inserted into the parent after the preceding child item.
See also type().
Sourcepub unsafe fn new() -> CppBox<QTreeWidgetItem>
pub unsafe fn new() -> CppBox<QTreeWidgetItem>
The QTreeWidgetItem class provides an item for use with the QTreeWidget convenience class.
Calls C++ function: [constructor] void QTreeWidgetItem::QTreeWidgetItem()
.
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.
Sourcepub unsafe fn from_q_string_list(
strings: impl CastInto<Ref<QStringList>>,
) -> CppBox<QTreeWidgetItem>
pub unsafe fn from_q_string_list( strings: impl CastInto<Ref<QStringList>>, ) -> CppBox<QTreeWidgetItem>
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)
.
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().
Sourcepub unsafe fn from_q_tree_widget(
view: impl CastInto<Ptr<QTreeWidget>>,
) -> CppBox<QTreeWidgetItem>
pub unsafe fn from_q_tree_widget( view: impl CastInto<Ptr<QTreeWidget>>, ) -> CppBox<QTreeWidgetItem>
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)
.
Constructs a tree widget item of the specified type and appends it to the items in the given parent.
See also type().
Sourcepub unsafe fn from_q_tree_widget_q_string_list(
view: impl CastInto<Ptr<QTreeWidget>>,
strings: impl CastInto<Ref<QStringList>>,
) -> CppBox<QTreeWidgetItem>
pub unsafe fn from_q_tree_widget_q_string_list( view: impl CastInto<Ptr<QTreeWidget>>, strings: impl CastInto<Ref<QStringList>>, ) -> CppBox<QTreeWidgetItem>
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)
.
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().
Sourcepub unsafe fn from_q_tree_widget_q_tree_widget_item(
view: impl CastInto<Ptr<QTreeWidget>>,
after: impl CastInto<Ptr<QTreeWidgetItem>>,
) -> CppBox<QTreeWidgetItem>
pub unsafe fn from_q_tree_widget_q_tree_widget_item( view: impl CastInto<Ptr<QTreeWidget>>, after: impl CastInto<Ptr<QTreeWidgetItem>>, ) -> CppBox<QTreeWidgetItem>
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)
.
Constructs a tree widget item of the specified type and inserts it into the given parent after the preceding item.
See also type().
Sourcepub unsafe fn from_q_tree_widget_item(
parent: impl CastInto<Ptr<QTreeWidgetItem>>,
) -> CppBox<QTreeWidgetItem>
pub unsafe fn from_q_tree_widget_item( parent: impl CastInto<Ptr<QTreeWidgetItem>>, ) -> CppBox<QTreeWidgetItem>
Constructs a tree widget item and append it to the given parent.
Calls C++ function: [constructor] void QTreeWidgetItem::QTreeWidgetItem(QTreeWidgetItem* parent)
.
Constructs a tree widget item and append it to the given parent.
See also type().
Sourcepub unsafe fn from_q_tree_widget_item_q_string_list(
parent: impl CastInto<Ptr<QTreeWidgetItem>>,
strings: impl CastInto<Ref<QStringList>>,
) -> CppBox<QTreeWidgetItem>
pub unsafe fn from_q_tree_widget_item_q_string_list( parent: impl CastInto<Ptr<QTreeWidgetItem>>, strings: impl CastInto<Ref<QStringList>>, ) -> CppBox<QTreeWidgetItem>
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)
.
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().
Sourcepub unsafe fn from_2_q_tree_widget_item(
parent: impl CastInto<Ptr<QTreeWidgetItem>>,
after: impl CastInto<Ptr<QTreeWidgetItem>>,
) -> CppBox<QTreeWidgetItem>
pub unsafe fn from_2_q_tree_widget_item( parent: impl CastInto<Ptr<QTreeWidgetItem>>, after: impl CastInto<Ptr<QTreeWidgetItem>>, ) -> CppBox<QTreeWidgetItem>
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)
.
Constructs a tree widget item of the specified type that is inserted into the parent after the preceding child item.
See also type().
Sourcepub unsafe fn new_copy(
other: impl CastInto<Ref<QTreeWidgetItem>>,
) -> CppBox<QTreeWidgetItem>
pub unsafe fn new_copy( other: impl CastInto<Ref<QTreeWidgetItem>>, ) -> CppBox<QTreeWidgetItem>
Constructs a copy of other. Note that type() and treeWidget() are not copied.
Calls C++ function: [constructor] void QTreeWidgetItem::QTreeWidgetItem(const QTreeWidgetItem& other)
.
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.
Sourcepub unsafe fn parent(&self) -> Ptr<QTreeWidgetItem>
pub unsafe fn parent(&self) -> Ptr<QTreeWidgetItem>
Returns the item's parent.
Calls C++ function: QTreeWidgetItem* QTreeWidgetItem::parent() const
.
Returns the item’s parent.
See also child().
Sourcepub unsafe fn read(&self, in_: impl CastInto<Ref<QDataStream>>)
pub unsafe fn read(&self, in_: impl CastInto<Ref<QDataStream>>)
Reads the item from stream in. This only reads data into a single item.
Calls C++ function: virtual void QTreeWidgetItem::read(QDataStream& in)
.
Reads the item from stream in. This only reads data into a single item.
See also write().
Sourcepub unsafe fn remove_child(&self, child: impl CastInto<Ptr<QTreeWidgetItem>>)
pub unsafe fn remove_child(&self, child: impl CastInto<Ptr<QTreeWidgetItem>>)
Removes the given item indicated by child. The removed item will not be deleted.
Calls C++ function: void QTreeWidgetItem::removeChild(QTreeWidgetItem* child)
.
Removes the given item indicated by child. The removed item will not be deleted.
Sourcepub unsafe fn set_background(
&self,
column: c_int,
brush: impl CastInto<Ref<QBrush>>,
)
pub unsafe fn set_background( &self, column: c_int, brush: impl CastInto<Ref<QBrush>>, )
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)
.
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().
Sourcepub unsafe fn set_background_color(
&self,
column: c_int,
color: impl CastInto<Ref<QColor>>,
)
pub unsafe fn set_background_color( &self, column: c_int, color: impl CastInto<Ref<QColor>>, )
This function is deprecated. Use setBackground() instead.
Calls C++ function: void QTreeWidgetItem::setBackgroundColor(int column, const QColor& color)
.
This function is deprecated. Use setBackground() instead.
See also backgroundColor().
Sourcepub unsafe fn set_check_state(&self, column: c_int, state: CheckState)
pub unsafe fn set_check_state(&self, column: c_int, state: CheckState)
Sets the item in the given column check state to be state.
Calls C++ function: void QTreeWidgetItem::setCheckState(int column, Qt::CheckState state)
.
Sets the item in the given column check state to be state.
See also checkState().
Sourcepub unsafe fn set_child_indicator_policy(&self, policy: ChildIndicatorPolicy)
pub unsafe fn set_child_indicator_policy(&self, policy: ChildIndicatorPolicy)
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)
.
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().
Sourcepub unsafe fn set_data(
&self,
column: c_int,
role: c_int,
value: impl CastInto<Ref<QVariant>>,
)
pub unsafe fn set_data( &self, column: c_int, role: c_int, value: impl CastInto<Ref<QVariant>>, )
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)
.
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().
Sourcepub unsafe fn set_disabled(&self, disabled: bool)
pub unsafe fn set_disabled(&self, disabled: bool)
Disables the item if disabled is true; otherwise enables the item.
Calls C++ function: void QTreeWidgetItem::setDisabled(bool disabled)
.
Disables the item if disabled is true; otherwise enables the item.
This function was introduced in Qt 4.3.
See also isDisabled() and setFlags().
Sourcepub unsafe fn set_expanded(&self, expand: bool)
pub unsafe fn set_expanded(&self, expand: bool)
Expands the item if expand is true, otherwise collapses the item.
Calls C++ function: void QTreeWidgetItem::setExpanded(bool expand)
.
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().
Sourcepub unsafe fn set_first_column_spanned(&self, span: bool)
pub unsafe fn set_first_column_spanned(&self, span: bool)
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)
.
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().
Sourcepub unsafe fn set_flags(&self, flags: QFlags<ItemFlag>)
pub unsafe fn set_flags(&self, flags: QFlags<ItemFlag>)
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)
.
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().
Sourcepub unsafe fn set_font(&self, column: c_int, font: impl CastInto<Ref<QFont>>)
pub unsafe fn set_font(&self, column: c_int, font: impl CastInto<Ref<QFont>>)
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)
.
Sets the font used to display the text in the given column to the given font.
See also font(), setText(), and setForeground().
Sourcepub unsafe fn set_foreground(
&self,
column: c_int,
brush: impl CastInto<Ref<QBrush>>,
)
pub unsafe fn set_foreground( &self, column: c_int, brush: impl CastInto<Ref<QBrush>>, )
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)
.
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().
Hides the item if hide is true, otherwise shows the item.
Calls C++ function: void QTreeWidgetItem::setHidden(bool hide)
.
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().
Sourcepub unsafe fn set_icon(&self, column: c_int, icon: impl CastInto<Ref<QIcon>>)
pub unsafe fn set_icon(&self, column: c_int, icon: impl CastInto<Ref<QIcon>>)
Sets the icon to be displayed in the given column to icon.
Calls C++ function: void QTreeWidgetItem::setIcon(int column, const QIcon& icon)
.
Sourcepub unsafe fn set_selected(&self, select: bool)
pub unsafe fn set_selected(&self, select: bool)
Sets the selected state of the item to select.
Calls C++ function: void QTreeWidgetItem::setSelected(bool select)
.
Sets the selected state of the item to select.
This function was introduced in Qt 4.2.
See also isSelected().
Sourcepub unsafe fn set_size_hint(
&self,
column: c_int,
size: impl CastInto<Ref<QSize>>,
)
pub unsafe fn set_size_hint( &self, column: c_int, size: impl CastInto<Ref<QSize>>, )
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)
.
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().
Sourcepub unsafe fn set_status_tip(
&self,
column: c_int,
status_tip: impl CastInto<Ref<QString>>,
)
pub unsafe fn set_status_tip( &self, column: c_int, status_tip: impl CastInto<Ref<QString>>, )
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)
.
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().
Sourcepub unsafe fn set_text(&self, column: c_int, text: impl CastInto<Ref<QString>>)
pub unsafe fn set_text(&self, column: c_int, text: impl CastInto<Ref<QString>>)
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)
.
Sets the text to be displayed in the given column to the given text.
See also text(), setFont(), and setForeground().
Sourcepub unsafe fn set_text_alignment(&self, column: c_int, alignment: c_int)
pub unsafe fn set_text_alignment(&self, column: c_int, alignment: c_int)
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)
.
Sets the text alignment for the label in the given column to the alignment specified (see Qt::AlignmentFlag).
See also textAlignment().
Sourcepub unsafe fn set_text_color(
&self,
column: c_int,
color: impl CastInto<Ref<QColor>>,
)
pub unsafe fn set_text_color( &self, column: c_int, color: impl CastInto<Ref<QColor>>, )
This function is deprecated. Use setForeground() instead.
Calls C++ function: void QTreeWidgetItem::setTextColor(int column, const QColor& color)
.
This function is deprecated. Use setForeground() instead.
See also textColor().
Sourcepub unsafe fn set_tool_tip(
&self,
column: c_int,
tool_tip: impl CastInto<Ref<QString>>,
)
pub unsafe fn set_tool_tip( &self, column: c_int, tool_tip: impl CastInto<Ref<QString>>, )
Sets the tooltip for the given column to toolTip.
Calls C++ function: void QTreeWidgetItem::setToolTip(int column, const QString& toolTip)
.
Sets the tooltip for the given column to toolTip.
See also toolTip(), setStatusTip(), and setWhatsThis().
Sourcepub unsafe fn set_whats_this(
&self,
column: c_int,
whats_this: impl CastInto<Ref<QString>>,
)
pub unsafe fn set_whats_this( &self, column: c_int, whats_this: impl CastInto<Ref<QString>>, )
Sets the "What's This?" help for the given column to whatsThis.
Calls C++ function: void QTreeWidgetItem::setWhatsThis(int column, const QString& whatsThis)
.
Sets the “What’s This?” help for the given column to whatsThis.
See also whatsThis(), setStatusTip(), and setToolTip().
Sourcepub unsafe fn size_hint(&self, column: c_int) -> CppBox<QSize>
pub unsafe fn size_hint(&self, column: c_int) -> CppBox<QSize>
Returns the size hint set for the tree item in the given column (see QSize).
Calls C++ function: QSize QTreeWidgetItem::sizeHint(int column) const
.
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().
Sourcepub unsafe fn sort_children(&self, column: c_int, order: SortOrder)
pub unsafe fn sort_children(&self, column: c_int, order: SortOrder)
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)
.
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.
Sourcepub unsafe fn status_tip(&self, column: c_int) -> CppBox<QString>
pub unsafe fn status_tip(&self, column: c_int) -> CppBox<QString>
Returns the status tip for the contents of the given column.
Calls C++ function: QString QTreeWidgetItem::statusTip(int column) const
.
Returns the status tip for the contents of the given column.
See also setStatusTip().
Sourcepub unsafe fn take_child(&self, index: c_int) -> Ptr<QTreeWidgetItem>
pub unsafe fn take_child(&self, index: c_int) -> Ptr<QTreeWidgetItem>
Removes the item at index and returns it, otherwise return 0.
Calls C++ function: QTreeWidgetItem* QTreeWidgetItem::takeChild(int index)
.
Removes the item at index and returns it, otherwise return 0.
Sourcepub unsafe fn take_children(&self) -> CppBox<QListOfQTreeWidgetItem>
pub unsafe fn take_children(&self) -> CppBox<QListOfQTreeWidgetItem>
Removes the list of children and returns it, otherwise returns an empty list.
Calls C++ function: QList<QTreeWidgetItem*> QTreeWidgetItem::takeChildren()
.
Removes the list of children and returns it, otherwise returns an empty list.
This function was introduced in Qt 4.1.
Sourcepub unsafe fn text(&self, column: c_int) -> CppBox<QString>
pub unsafe fn text(&self, column: c_int) -> CppBox<QString>
Returns the text in the specified column.
Calls C++ function: QString QTreeWidgetItem::text(int column) const
.
Returns the text in the specified column.
See also setText().
Sourcepub unsafe fn text_alignment(&self, column: c_int) -> c_int
pub unsafe fn text_alignment(&self, column: c_int) -> c_int
Returns the text alignment for the label in the given column (see Qt::AlignmentFlag).
Calls C++ function: int QTreeWidgetItem::textAlignment(int column) const
.
Returns the text alignment for the label in the given column (see Qt::AlignmentFlag).
See also setTextAlignment().
Sourcepub unsafe fn text_color(&self, column: c_int) -> CppBox<QColor>
pub unsafe fn text_color(&self, column: c_int) -> CppBox<QColor>
This function is deprecated. Use foreground() instead.
Calls C++ function: QColor QTreeWidgetItem::textColor(int column) const
.
This function is deprecated. Use foreground() instead.
See also setTextColor().
Sourcepub unsafe fn tool_tip(&self, column: c_int) -> CppBox<QString>
pub unsafe fn tool_tip(&self, column: c_int) -> CppBox<QString>
Returns the tool tip for the given column.
Calls C++ function: QString QTreeWidgetItem::toolTip(int column) const
.
Returns the tool tip for the given column.
See also setToolTip().
Sourcepub unsafe fn tree_widget(&self) -> QPtr<QTreeWidget>
pub unsafe fn tree_widget(&self) -> QPtr<QTreeWidget>
Returns the tree widget that contains the item.
Calls C++ function: QTreeWidget* QTreeWidgetItem::treeWidget() const
.
Returns the tree widget that contains the item.
Sourcepub unsafe fn type_(&self) -> c_int
pub unsafe fn type_(&self) -> c_int
Returns the type passed to the QTreeWidgetItem constructor.
Calls C++ function: int QTreeWidgetItem::type() const
.
Returns the type passed to the QTreeWidgetItem constructor.
Sourcepub unsafe fn whats_this(&self, column: c_int) -> CppBox<QString>
pub unsafe fn whats_this(&self, column: c_int) -> CppBox<QString>
Returns the "What's This?" help for the contents of the given column.
Calls C++ function: QString QTreeWidgetItem::whatsThis(int column) const
.
Returns the “What’s This?” help for the contents of the given column.
See also setWhatsThis().
Sourcepub unsafe fn write(&self, out: impl CastInto<Ref<QDataStream>>)
pub unsafe fn write(&self, out: impl CastInto<Ref<QDataStream>>)
Writes the item to stream out. This only writes data from one single item.
Calls C++ function: virtual void QTreeWidgetItem::write(QDataStream& out) const
.
Writes the item to stream out. This only writes data from one single item.
See also read().
Trait Implementations§
Source§impl CppDeletable for QTreeWidgetItem
impl CppDeletable for QTreeWidgetItem
Source§unsafe fn delete(&self)
unsafe fn delete(&self)
Destroys this tree widget item.
Calls C++ function: virtual [destructor] void QTreeWidgetItem::~QTreeWidgetItem()
.
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.
Source§impl Lt<Ref<QTreeWidgetItem>> for QTreeWidgetItem
impl Lt<Ref<QTreeWidgetItem>> for QTreeWidgetItem
Source§unsafe fn lt(&self, other: &Ref<QTreeWidgetItem>) -> bool
unsafe fn lt(&self, other: &Ref<QTreeWidgetItem>) -> bool
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
.
Returns true
if the text in the item is less than the text in the other item, otherwise returns false
.