[−][src]Struct qt_gui::QTextFrame
The QTextFrame class represents a frame in a QTextDocument.
C++ class: QTextFrame
.
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
.
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
.
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
.
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
.
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
.
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
.
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
.
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
.
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)
.
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
.
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]
&self,
arg1: Call,
arg2: c_int,
arg3: *mut *mut c_void
) -> c_int
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]
&self,
format: impl CastInto<Ref<QTextFrameFormat>>
)
Sets the frame's format.
Calls C++ function: void QTextFrame::setFrameFormat(const QTextFrameFormat& format)
.
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]
s: *const c_char,
c: *const c_char,
n: c_int
) -> CppBox<QString>
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]
s: *const c_char,
c: *const c_char,
n: c_int
) -> CppBox<QString>
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
.
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
.
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
.
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
.
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]
&self,
arg1: Call,
arg2: c_int,
arg3: *mut *mut c_void
) -> c_int
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
.
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()
.
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
.
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
impl RefUnwindSafe for QTextFrame
impl Send for QTextFrame
impl Sync for QTextFrame
impl Unpin for QTextFrame
impl UnwindSafe for QTextFrame
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> CastInto<U> for T where
U: CastFrom<T>,
[src]
U: CastFrom<T>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> StaticUpcast<T> for T
[src]
unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,