[][src]Struct qt_gui::QTextFrame

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

The QTextFrame class represents a frame in a QTextDocument.

C++ class: QTextFrame.

C++ documentation:

The QTextFrame class represents a frame in a QTextDocument.

Text frames provide structure for the text in a document. They are used as generic containers for other document elements. Frames are usually created by using QTextCursor::insertFrame().

Frames can be used to create hierarchical structures in rich text documents. Each document has a root frame (QTextDocument::rootFrame()), and each frame beneath the root frame has a parent frame and a (possibly empty) list of child frames. The parent frame can be found with parentFrame(), and the childFrames() function provides a list of child frames.

Each frame contains at least one text block to enable text cursors to insert new document elements within. As a result, the QTextFrame::iterator class is used to traverse both the blocks and child frames within a given frame. The first and last child elements in the frame can be found with begin() and end().

A frame also has a format (specified using QTextFrameFormat) which can be set with setFormat() and read with format().

Text cursors can be obtained that point to the first and last valid cursor positions within a frame; use the firstCursorPosition() and lastCursorPosition() functions for this. The frame's extent in the document can be found with firstPosition() and lastPosition().

You can iterate over a frame's contents using the QTextFrame::iterator class: this provides read-only access to its internal list of text blocks and child frames.

Methods

impl QTextFrame[src]

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

Returns an iterator pointing to the first document element inside the frame. Please see the document STL-style-Iterators for more information.

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

C++ documentation:

Returns an iterator pointing to the first document element inside the frame. Please see the document STL-style-Iterators for more information.

See also end().

pub unsafe fn child_frames(&self) -> CppBox<QListOfQTextFrame>[src]

Returns a (possibly empty) list of the frame's child frames.

Calls C++ function: QList<QTextFrame*> QTextFrame::childFrames() const.

C++ documentation:

Returns a (possibly empty) list of the frame's child frames.

See also parentFrame().

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

Returns an iterator pointing to the position past the last document element inside the frame. Please see the document STL-Style Iterators for more information.

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

C++ documentation:

Returns an iterator pointing to the position past the last document element inside the frame. Please see the document STL-Style Iterators for more information.

See also begin().

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

Returns the first cursor position inside the frame.

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

C++ documentation:

Returns the first cursor position inside the frame.

See also lastCursorPosition(), firstPosition(), and lastPosition().

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

Returns the first document position inside the frame.

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

C++ documentation:

Returns the first document position inside the frame.

See also lastPosition(), firstCursorPosition(), and lastCursorPosition().

pub unsafe fn frame_format(&self) -> CppBox<QTextFrameFormat>[src]

Returns the frame's format.

Calls C++ function: QTextFrameFormat QTextFrame::frameFormat() const.

C++ documentation:

Returns the frame's format.

See also setFrameFormat().

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

Returns the last cursor position inside the frame.

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

C++ documentation:

Returns the last cursor position inside the frame.

See also firstCursorPosition(), firstPosition(), and lastPosition().

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

Returns the last document position inside the frame.

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

C++ documentation:

Returns the last document position inside the frame.

See also firstPosition(), firstCursorPosition(), and lastCursorPosition().

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

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

pub unsafe fn new(doc: impl CastInto<Ptr<QTextDocument>>) -> QBox<QTextFrame>[src]

Creates a new empty frame for the text document.

Calls C++ function: [constructor] void QTextFrame::QTextFrame(QTextDocument* doc).

C++ documentation:

Creates a new empty frame for the text document.

pub unsafe fn parent_frame(&self) -> QPtr<QTextFrame>[src]

Returns the frame's parent frame. If the frame is the root frame of a document, this will return 0.

Calls C++ function: QTextFrame* QTextFrame::parentFrame() const.

C++ documentation:

Returns the frame's parent frame. If the frame is the root frame of a document, this will return 0.

See also childFrames() and QTextDocument::rootFrame().

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

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

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

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

pub unsafe fn set_frame_format(
    &self,
    format: impl CastInto<Ref<QTextFrameFormat>>
)
[src]

Sets the frame's format.

Calls C++ function: void QTextFrame::setFrameFormat(const QTextFrameFormat& format).

C++ documentation:

Sets the frame's format.

See also frameFormat().

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

Returns a reference to the staticMetaObject field.

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

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

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

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

Methods from Deref<Target = QTextObject>

pub unsafe fn document(&self) -> QPtr<QTextDocument>[src]

Returns the document this object belongs to.

Calls C++ function: QTextDocument* QTextObject::document() const.

C++ documentation:

Returns the document this object belongs to.

See also format().

pub unsafe fn format(&self) -> CppBox<QTextFormat>[src]

Returns the text object's format.

Calls C++ function: QTextFormat QTextObject::format() const.

C++ documentation:

Returns the text object's format.

See also setFormat() and document().

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

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

Calls C++ function: int QTextObject::formatIndex() const.

C++ documentation:

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

See also QTextDocument::allFormats().

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

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

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

Returns the object index of this object. This can be used together with QTextFormat::setObjectIndex().

Calls C++ function: int QTextObject::objectIndex() const.

C++ documentation:

Returns the object index of this object. This can be used together with QTextFormat::setObjectIndex().

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

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

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

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

Trait Implementations

impl Begin for QTextFrame[src]

type Output = CppBox<Iterator>

Output type.

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

Returns an iterator pointing to the first document element inside the frame. Please see the document STL-style-Iterators for more information.

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

C++ documentation:

Returns an iterator pointing to the first document element inside the frame. Please see the document STL-style-Iterators for more information.

See also end().

impl CppDeletable for QTextFrame[src]

unsafe fn delete(&self)[src]

Destroys the text frame.

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

C++ documentation:

Destroys the text frame.

Warning: Text frames are owned by the document, so you should never destroy them yourself. In order to remove a frame from its document, remove its contents using a QTextCursor.

impl Deref for QTextFrame[src]

type Target = QTextObject

The resulting type after dereferencing.

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

Calls C++ function: QTextObject* static_cast<QTextObject*>(QTextFrame* ptr).

impl DynamicCast<QTextFrame> for QTextObject[src]

unsafe fn dynamic_cast(ptr: Ptr<QTextObject>) -> Ptr<QTextFrame>[src]

Calls C++ function: QTextFrame* dynamic_cast<QTextFrame*>(QTextObject* ptr).

impl DynamicCast<QTextFrame> for QObject[src]

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

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

impl DynamicCast<QTextTable> for QTextFrame[src]

unsafe fn dynamic_cast(ptr: Ptr<QTextFrame>) -> Ptr<QTextTable>[src]

Calls C++ function: QTextTable* dynamic_cast<QTextTable*>(QTextFrame* ptr).

impl End for QTextFrame[src]

type Output = CppBox<Iterator>

Output type.

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

Returns an iterator pointing to the position past the last document element inside the frame. Please see the document STL-Style Iterators for more information.

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

C++ documentation:

Returns an iterator pointing to the position past the last document element inside the frame. Please see the document STL-Style Iterators for more information.

See also begin().

impl StaticDowncast<QTextFrame> for QTextObject[src]

unsafe fn static_downcast(ptr: Ptr<QTextObject>) -> Ptr<QTextFrame>[src]

Calls C++ function: QTextFrame* static_cast<QTextFrame*>(QTextObject* ptr).

impl StaticDowncast<QTextFrame> for QObject[src]

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

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

impl StaticDowncast<QTextTable> for QTextFrame[src]

unsafe fn static_downcast(ptr: Ptr<QTextFrame>) -> Ptr<QTextTable>[src]

Calls C++ function: QTextTable* static_cast<QTextTable*>(QTextFrame* ptr).

impl StaticUpcast<QObject> for QTextFrame[src]

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

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

impl StaticUpcast<QTextFrame> for QTextTable[src]

unsafe fn static_upcast(ptr: Ptr<QTextTable>) -> Ptr<QTextFrame>[src]

Calls C++ function: QTextFrame* static_cast<QTextFrame*>(QTextTable* ptr).

impl StaticUpcast<QTextObject> for QTextFrame[src]

unsafe fn static_upcast(ptr: Ptr<QTextFrame>) -> Ptr<QTextObject>[src]

Calls C++ function: QTextObject* static_cast<QTextObject*>(QTextFrame* ptr).

Auto Trait Implementations

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.