Struct qt_gui::QTextTableCell

source ·
#[repr(C)]
pub struct QTextTableCell { /* private fields */ }
Expand description

The QTextTableCell class represents the properties of a cell in a QTextTable.

C++ class: QTextTableCell.

C++ documentation:

The QTextTableCell class represents the properties of a cell in a QTextTable.

Table cells are pieces of document structure that belong to a table. The table orders cells into particular rows and columns; cells can also span multiple columns and rows.

Cells are usually created when a table is inserted into a document with QTextCursor::insertTable(), but they are also created and destroyed when a table is resized.

Cells contain information about their location in a table; you can obtain the row() and column() numbers of a cell, and its rowSpan() and columnSpan().

The format() of a cell describes the default character format of its contents. The firstCursorPosition() and lastCursorPosition() functions are used to obtain the extent of the cell in the document.

Implementations§

source§

impl QTextTableCell

source

pub unsafe fn begin(&self) -> CppBox<Iterator>

Returns a frame iterator pointing to the beginning of the table's cell.

Calls C++ function: QTextFrame::iterator QTextTableCell::begin() const.

C++ documentation:

Returns a frame iterator pointing to the beginning of the table’s cell.

See also end().

source

pub unsafe fn column(&self) -> c_int

Returns the number of the column in the table that contains this cell.

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

C++ documentation:

Returns the number of the column in the table that contains this cell.

See also row().

source

pub unsafe fn column_span(&self) -> c_int

Returns the number of columns this cell spans. The default is 1.

Calls C++ function: int QTextTableCell::columnSpan() const.

C++ documentation:

Returns the number of columns this cell spans. The default is 1.

See also rowSpan().

source

pub unsafe fn copy_from( &self, o: impl CastInto<Ref<QTextTableCell>> ) -> Ref<QTextTableCell>

Assigns the other table cell to this table cell.

Calls C++ function: QTextTableCell& QTextTableCell::operator=(const QTextTableCell& o).

C++ documentation:

Assigns the other table cell to this table cell.

source

pub unsafe fn end(&self) -> CppBox<Iterator>

Returns a frame iterator pointing to the end of the table's cell.

Calls C++ function: QTextFrame::iterator QTextTableCell::end() const.

C++ documentation:

Returns a frame iterator pointing to the end of the table’s cell.

See also begin().

source

pub unsafe fn first_cursor_position(&self) -> CppBox<QTextCursor>

Returns the first valid cursor position in this cell.

Calls C++ function: QTextCursor QTextTableCell::firstCursorPosition() const.

C++ documentation:

Returns the first valid cursor position in this cell.

See also lastCursorPosition().

source

pub unsafe fn first_position(&self) -> c_int

Calls C++ function: int QTextTableCell::firstPosition() const.

source

pub unsafe fn format(&self) -> CppBox<QTextCharFormat>

Returns the cell's character format.

Calls C++ function: QTextCharFormat QTextTableCell::format() const.

C++ documentation:

Returns the cell’s character format.

See also setFormat().

source

pub unsafe fn is_valid(&self) -> bool

Returns true if this is a valid table cell; otherwise returns false.

Calls C++ function: bool QTextTableCell::isValid() const.

C++ documentation:

Returns true if this is a valid table cell; otherwise returns false.

source

pub unsafe fn last_cursor_position(&self) -> CppBox<QTextCursor>

Returns the last valid cursor position in this cell.

Calls C++ function: QTextCursor QTextTableCell::lastCursorPosition() const.

C++ documentation:

Returns the last valid cursor position in this cell.

See also firstCursorPosition().

source

pub unsafe fn last_position(&self) -> c_int

Calls C++ function: int QTextTableCell::lastPosition() const.

source

pub unsafe fn new() -> CppBox<QTextTableCell>

Constructs an invalid table cell.

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

C++ documentation:

Constructs an invalid table cell.

See also isValid().

source

pub unsafe fn new_copy( o: impl CastInto<Ref<QTextTableCell>> ) -> CppBox<QTextTableCell>

Copy constructor. Creates a new QTextTableCell object based on the other cell.

Calls C++ function: [constructor] void QTextTableCell::QTextTableCell(const QTextTableCell& o).

C++ documentation:

Copy constructor. Creates a new QTextTableCell object based on the other cell.

source

pub unsafe fn row(&self) -> c_int

Returns the number of the row in the table that contains this cell.

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

C++ documentation:

Returns the number of the row in the table that contains this cell.

See also column().

source

pub unsafe fn row_span(&self) -> c_int

Returns the number of rows this cell spans. The default is 1.

Calls C++ function: int QTextTableCell::rowSpan() const.

C++ documentation:

Returns the number of rows this cell spans. The default is 1.

See also columnSpan().

source

pub unsafe fn set_format(&self, format: impl CastInto<Ref<QTextCharFormat>>)

Sets the cell's character format to format. This can for example be used to change the background color of the entire cell:

Calls C++ function: void QTextTableCell::setFormat(const QTextCharFormat& format).

C++ documentation:

Sets the cell’s character format to format. This can for example be used to change the background color of the entire cell:

QTextTableCell cell = table->cellAt(2, 3); QTextCharFormat format = cell.format(); format.setBackground(Qt::blue); cell.setFormat(format);

Note that the cell's row or column span cannot be changed through this function. You have to use QTextTable::mergeCells and QTextTable::splitCell instead.

This function was introduced in Qt 4.2.

See also format().

source

pub unsafe fn table_cell_format_index(&self) -> c_int

Returns the index of the tableCell's format in the document's internal list of formats.

Calls C++ function: int QTextTableCell::tableCellFormatIndex() const.

C++ documentation:

Returns the index of the tableCell’s format in the document’s internal list of formats.

This function was introduced in Qt 4.5.

See also QTextDocument::allFormats().

Trait Implementations§

source§

impl Begin for QTextTableCell

source§

unsafe fn begin(&self) -> CppBox<Iterator>

Returns a frame iterator pointing to the beginning of the table's cell.

Calls C++ function: QTextFrame::iterator QTextTableCell::begin() const.

C++ documentation:

Returns a frame iterator pointing to the beginning of the table’s cell.

See also end().

§

type Output = CppBox<Iterator>

Output type.
source§

impl CppDeletable for QTextTableCell

source§

unsafe fn delete(&self)

Destroys the table cell.

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

C++ documentation:

Destroys the table cell.

source§

impl End for QTextTableCell

source§

unsafe fn end(&self) -> CppBox<Iterator>

Returns a frame iterator pointing to the end of the table's cell.

Calls C++ function: QTextFrame::iterator QTextTableCell::end() const.

C++ documentation:

Returns a frame iterator pointing to the end of the table’s cell.

See also begin().

§

type Output = CppBox<Iterator>

Output type.
source§

impl PartialEq<Ref<QTextTableCell>> for QTextTableCell

source§

fn eq(&self, other: &Ref<QTextTableCell>) -> bool

Returns true if this cell object and the other cell object describe the same cell; otherwise returns false.

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

C++ documentation:

Returns true if this cell object and the other cell object describe the same cell; otherwise returns false.

1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, U> CastInto<U> for T
where U: CastFrom<T>,

source§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> StaticUpcast<T> for T

source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.