[−][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 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 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<MutPtr<QTextDocument>>
) -> CppBox<QTextFrame>
[src]
doc: impl CastInto<MutPtr<QTextDocument>>
) -> CppBox<QTextFrame>
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) -> MutPtr<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(
&mut self,
arg1: Call,
arg2: c_int,
arg3: impl CastInto<MutPtr<*mut c_void>>
) -> c_int
[src]
&mut self,
arg1: Call,
arg2: c_int,
arg3: impl CastInto<MutPtr<*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(
&mut self,
arg1: impl CastInto<Ptr<c_char>>
) -> MutPtr<c_void>
[src]
&mut self,
arg1: impl CastInto<Ptr<c_char>>
) -> MutPtr<c_void>
Calls C++ function: virtual void* QTextFrame::qt_metacast(const char* arg1)
.
pub unsafe fn set_frame_format(
&mut self,
format: impl CastInto<Ref<QTextFrameFormat>>
)
[src]
&mut 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: impl CastInto<Ptr<c_char>>,
c: impl CastInto<Ptr<c_char>>,
n: c_int
) -> CppBox<QString>
[src]
s: impl CastInto<Ptr<c_char>>,
c: impl CastInto<Ptr<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: impl CastInto<Ptr<c_char>>,
c: impl CastInto<Ptr<c_char>>,
n: c_int
) -> CppBox<QString>
[src]
s: impl CastInto<Ptr<c_char>>,
c: impl CastInto<Ptr<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) -> MutPtr<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(
&mut self,
arg1: Call,
arg2: c_int,
arg3: impl CastInto<MutPtr<*mut c_void>>
) -> c_int
[src]
&mut self,
arg1: Call,
arg2: c_int,
arg3: impl CastInto<MutPtr<*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(
&mut self,
arg1: impl CastInto<Ptr<c_char>>
) -> MutPtr<c_void>
[src]
&mut self,
arg1: impl CastInto<Ptr<c_char>>
) -> MutPtr<c_void>
Calls C++ function: virtual void* QTextObject::qt_metacast(const char* arg1)
.
Trait Implementations
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 DerefMut for QTextFrame
[src]
fn deref_mut(&mut self) -> &mut QTextObject
[src]
Calls C++ function: QTextObject* static_cast<QTextObject*>(QTextFrame* 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)
.
unsafe fn static_upcast_mut(ptr: MutPtr<QTextFrame>) -> MutPtr<QTextObject>
[src]
Calls C++ function: QTextObject* static_cast<QTextObject*>(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)
.
unsafe fn static_upcast_mut(ptr: MutPtr<QTextFrame>) -> MutPtr<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)
.
unsafe fn static_upcast_mut(ptr: MutPtr<QTextTable>) -> MutPtr<QTextFrame>
[src]
Calls C++ function: QTextFrame* static_cast<QTextFrame*>(QTextTable* ptr)
.
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)
.
unsafe fn static_downcast_mut(ptr: MutPtr<QTextObject>) -> MutPtr<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)
.
unsafe fn static_downcast_mut(ptr: MutPtr<QObject>) -> MutPtr<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)
.
unsafe fn static_downcast_mut(ptr: MutPtr<QTextFrame>) -> MutPtr<QTextTable>
[src]
Calls C++ function: QTextTable* static_cast<QTextTable*>(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)
.
unsafe fn dynamic_cast_mut(ptr: MutPtr<QTextObject>) -> MutPtr<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)
.
unsafe fn dynamic_cast_mut(ptr: MutPtr<QObject>) -> MutPtr<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)
.
unsafe fn dynamic_cast_mut(ptr: MutPtr<QTextFrame>) -> MutPtr<QTextTable>
[src]
Calls C++ function: QTextTable* dynamic_cast<QTextTable*>(QTextFrame* ptr)
.
impl CppDeletable for QTextFrame
[src]
unsafe fn delete(&mut 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<'_> Begin for &'_ QTextFrame
[src]
type Output = CppBox<Iterator>
Output type.
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<'_> End for &'_ QTextFrame
[src]
type Output = CppBox<Iterator>
Output type.
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().
Auto Trait Implementations
impl Send for QTextFrame
impl Unpin for QTextFrame
impl Sync for QTextFrame
impl UnwindSafe for QTextFrame
impl RefUnwindSafe for QTextFrame
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> StaticUpcast<T> for T
[src]
unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
[src]
unsafe fn static_upcast_mut(ptr: MutPtr<T>) -> MutPtr<T>
[src]
impl<T, U> CastInto<U> for T where
U: CastFrom<T>,
[src]
U: CastFrom<T>,