[][src]Struct qt_widgets::QTableWidgetItem

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

The QTableWidgetItem class provides an item for use with the QTableWidget class.

C++ class: QTableWidgetItem.

C++ documentation:

The QTableWidgetItem class provides an item for use with the QTableWidget class.

Table items are used to hold pieces of information for table widgets. Items usually contain text, icons, or checkboxes

The QTableWidgetItem class is a convenience class that replaces the QTableItem class in Qt 3. It provides an item for use with the QTableWidget class.

Top-level items are constructed without a parent then inserted at the position specified by a pair of row and column numbers:

QTableWidgetItem *newItem = new QTableWidgetItem(tr("%1").arg( pow(row, column+1))); tableWidget->setItem(row, column, newItem);

Each 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 item can be rendered with its own font and brush. These are specified with the setFont() and setForeground() functions, and read with font() and foreground().

By default, items are enabled, editable, selectable, checkable, and can be used both as the source of a drag and drop operation and as a drop target. 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 QTableWidgetItem[src]

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

Returns the brush used to render the item's background.

Calls C++ function: QBrush QTableWidgetItem::background() const.

C++ documentation:

Returns the brush used to render the item's background.

This function was introduced in Qt 4.2.

See also setBackground() and foreground().

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

This function is deprecated. Use background() instead.

Calls C++ function: QColor QTableWidgetItem::backgroundColor() const.

C++ documentation:

This function is deprecated. Use background() instead.

See also setBackgroundColor().

pub unsafe fn check_state(&self) -> CheckState[src]

Returns the checked state of the table item.

Calls C++ function: Qt::CheckState QTableWidgetItem::checkState() const.

C++ documentation:

Returns the checked state of the table item.

See also setCheckState() and flags().

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

Creates a copy of the item.

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

C++ documentation:

Creates a copy of the item.

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

Returns the column of the item in the table. If the item is not in a table, this function will return -1.

Calls C++ function: int QTableWidgetItem::column() const.

C++ documentation:

Returns the column of the item in the table. If the item is not in a table, this function will return -1.

This function was introduced in Qt 4.2.

See also row().

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

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

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

C++ documentation:

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

This function is useful when reimplementing clone().

See also data() and flags().

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

Returns the item's data for the given role.

Calls C++ function: virtual QVariant QTableWidgetItem::data(int role) const.

C++ documentation:

Returns the item's data for the given 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> QTableWidgetItem::flags() const.

C++ documentation:

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

See also setFlags().

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

Returns the font used to render the item's text.

Calls C++ function: QFont QTableWidgetItem::font() const.

C++ documentation:

Returns the font used to render the item's text.

See also setFont().

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

Returns the brush used to render the item's foreground (e.g. text).

Calls C++ function: QBrush QTableWidgetItem::foreground() const.

C++ documentation:

Returns the brush used to render the item's foreground (e.g. text).

This function was introduced in Qt 4.2.

See also setForeground() and background().

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

Returns the item's icon.

Calls C++ function: QIcon QTableWidgetItem::icon() const.

C++ documentation:

Returns the item's icon.

See also setIcon() and iconSize.

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

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

Calls C++ function: bool QTableWidgetItem::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<QTableWidgetItem>[src]

Constructs a table item of the specified type that does not belong to any table.

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

C++ documentation:

Constructs a table item of the specified type that does not belong to any table.

See also type().

pub unsafe fn from_q_string_int(
    text: impl CastInto<Ref<QString>>,
    type_: c_int
) -> CppBox<QTableWidgetItem>
[src]

Constructs a table item with the given text.

Calls C++ function: [constructor] void QTableWidgetItem::QTableWidgetItem(const QString& text, int type = …).

C++ documentation:

Constructs a table item with the given text.

See also type().

pub unsafe fn from_q_icon_q_string_int(
    icon: impl CastInto<Ref<QIcon>>,
    text: impl CastInto<Ref<QString>>,
    type_: c_int
) -> CppBox<QTableWidgetItem>
[src]

Constructs a table item with the given icon and text.

Calls C++ function: [constructor] void QTableWidgetItem::QTableWidgetItem(const QIcon& icon, const QString& text, int type = …).

C++ documentation:

Constructs a table item with the given icon and text.

See also type().

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

The QTableWidgetItem class provides an item for use with the QTableWidget class.

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

C++ documentation:

The QTableWidgetItem class provides an item for use with the QTableWidget class.

Table items are used to hold pieces of information for table widgets. Items usually contain text, icons, or checkboxes

The QTableWidgetItem class is a convenience class that replaces the QTableItem class in Qt 3. It provides an item for use with the QTableWidget class.

Top-level items are constructed without a parent then inserted at the position specified by a pair of row and column numbers:

QTableWidgetItem *newItem = new QTableWidgetItem(tr("%1").arg( pow(row, column+1))); tableWidget->setItem(row, column, newItem);

Each 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 item can be rendered with its own font and brush. These are specified with the setFont() and setForeground() functions, and read with font() and foreground().

By default, items are enabled, editable, selectable, checkable, and can be used both as the source of a drag and drop operation and as a drop target. 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(
    text: impl CastInto<Ref<QString>>
) -> CppBox<QTableWidgetItem>
[src]

Constructs a table item with the given text.

Calls C++ function: [constructor] void QTableWidgetItem::QTableWidgetItem(const QString& text).

C++ documentation:

Constructs a table item with the given text.

See also type().

pub unsafe fn from_q_icon_q_string(
    icon: impl CastInto<Ref<QIcon>>,
    text: impl CastInto<Ref<QString>>
) -> CppBox<QTableWidgetItem>
[src]

Constructs a table item with the given icon and text.

Calls C++ function: [constructor] void QTableWidgetItem::QTableWidgetItem(const QIcon& icon, const QString& text).

C++ documentation:

Constructs a table item with the given icon and text.

See also type().

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

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

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

C++ documentation:

Constructs a copy of other. Note that type() and tableWidget() 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 read(&self, in_: impl CastInto<Ref<QDataStream>>)[src]

Reads the item from stream in.

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

C++ documentation:

Reads the item from stream in.

See also write().

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

Returns the row of the item in the table. If the item is not in a table, this function will return -1.

Calls C++ function: int QTableWidgetItem::row() const.

C++ documentation:

Returns the row of the item in the table. If the item is not in a table, this function will return -1.

This function was introduced in Qt 4.2.

See also column().

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

Sets the item's background brush to the specified brush.

Calls C++ function: void QTableWidgetItem::setBackground(const QBrush& brush).

C++ documentation:

Sets the item's background brush to the specified brush.

This function was introduced in Qt 4.2.

See also background() and setForeground().

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

This function is deprecated. Use setBackground() instead.

Calls C++ function: void QTableWidgetItem::setBackgroundColor(const QColor& color).

C++ documentation:

This function is deprecated. Use setBackground() instead.

See also backgroundColor().

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

Sets the check state of the table item to be state.

Calls C++ function: void QTableWidgetItem::setCheckState(Qt::CheckState state).

C++ documentation:

Sets the check state of the table item to be state.

See also checkState().

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

Sets the item's data for the given role to the specified value.

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

C++ documentation:

Sets the item's data for the given role to the specified value.

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

See also Qt::ItemDataRole and data().

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.

Calls C++ function: void QTableWidgetItem::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.

See also flags().

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

Sets the font used to display the item's text to the given font.

Calls C++ function: void QTableWidgetItem::setFont(const QFont& font).

C++ documentation:

Sets the font used to display the item's text to the given font.

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

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

Sets the item's foreground brush to the specified brush.

Calls C++ function: void QTableWidgetItem::setForeground(const QBrush& brush).

C++ documentation:

Sets the item's foreground brush to the specified brush.

This function was introduced in Qt 4.2.

See also foreground() and setBackground().

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

Sets the item's icon to the icon specified.

Calls C++ function: void QTableWidgetItem::setIcon(const QIcon& icon).

C++ documentation:

Sets the item's icon to the icon specified.

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 QTableWidgetItem::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, size: impl CastInto<Ref<QSize>>)[src]

Sets the size hint for the table item 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 QTableWidgetItem::setSizeHint(const QSize& size).

C++ documentation:

Sets the size hint for the table item 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, status_tip: impl CastInto<Ref<QString>>)[src]

Sets the status tip for the table item to the text specified by statusTip. QTableWidget mouse tracking needs to be enabled for this feature to work.

Calls C++ function: void QTableWidgetItem::setStatusTip(const QString& statusTip).

C++ documentation:

Sets the status tip for the table item to the text specified by statusTip. QTableWidget mouse tracking needs to be enabled for this feature to work.

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

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

Sets the item's text to the text specified.

Calls C++ function: void QTableWidgetItem::setText(const QString& text).

C++ documentation:

Sets the item's text to the text specified.

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

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

Sets the text alignment for the item's text to the alignment specified.

Calls C++ function: void QTableWidgetItem::setTextAlignment(int alignment).

C++ documentation:

Sets the text alignment for the item's text to the alignment specified.

See also textAlignment() and Qt::Alignment.

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

This function is deprecated. Use setForeground() instead.

Calls C++ function: void QTableWidgetItem::setTextColor(const QColor& color).

C++ documentation:

This function is deprecated. Use setForeground() instead.

See also textColor().

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

Sets the item's tooltip to the string specified by toolTip.

Calls C++ function: void QTableWidgetItem::setToolTip(const QString& toolTip).

C++ documentation:

Sets the item's tooltip to the string specified by toolTip.

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

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

Sets the item's "What's This?" help to the string specified by whatsThis.

Calls C++ function: void QTableWidgetItem::setWhatsThis(const QString& whatsThis).

C++ documentation:

Sets the item's "What's This?" help to the string specified by whatsThis.

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

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

Returns the size hint set for the table item.

Calls C++ function: QSize QTableWidgetItem::sizeHint() const.

C++ documentation:

Returns the size hint set for the table item.

This function was introduced in Qt 4.1.

See also setSizeHint().

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

Returns the item's status tip.

Calls C++ function: QString QTableWidgetItem::statusTip() const.

C++ documentation:

Returns the item's status tip.

See also setStatusTip().

pub unsafe fn table_widget(&self) -> QPtr<QTableWidget>[src]

Returns the table widget that contains the item.

Calls C++ function: QTableWidget* QTableWidgetItem::tableWidget() const.

C++ documentation:

Returns the table widget that contains the item.

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

Returns the item's text.

Calls C++ function: QString QTableWidgetItem::text() const.

C++ documentation:

Returns the item's text.

See also setText().

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

Returns the text alignment for the item's text.

Calls C++ function: int QTableWidgetItem::textAlignment() const.

C++ documentation:

Returns the text alignment for the item's text.

See also setTextAlignment() and Qt::Alignment.

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

This function is deprecated. Use foreground() instead.

Calls C++ function: QColor QTableWidgetItem::textColor() const.

C++ documentation:

This function is deprecated. Use foreground() instead.

See also setTextColor().

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

Returns the item's tooltip.

Calls C++ function: QString QTableWidgetItem::toolTip() const.

C++ documentation:

Returns the item's tooltip.

See also setToolTip().

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

Returns the type passed to the QTableWidgetItem constructor.

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

C++ documentation:

Returns the type passed to the QTableWidgetItem constructor.

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

Returns the item's "What's This?" help.

Calls C++ function: QString QTableWidgetItem::whatsThis() const.

C++ documentation:

Returns the item's "What's This?" help.

See also setWhatsThis().

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

Writes the item to stream out.

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

C++ documentation:

Writes the item to stream out.

See also read().

Trait Implementations

impl CppDeletable for QTableWidgetItem[src]

unsafe fn delete(&self)[src]

Destroys the table item.

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

C++ documentation:

Destroys the table item.

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

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

Returns true if the item is less than the other item; otherwise returns false.

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

C++ documentation:

Returns true if the item is less than 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.