[][src]Struct qt_gui::QAbstractTextDocumentLayout

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

The QAbstractTextDocumentLayout class is an abstract base class used to implement custom layouts for QTextDocuments.

C++ class: QAbstractTextDocumentLayout.

C++ documentation:

The QAbstractTextDocumentLayout class is an abstract base class used to implement custom layouts for QTextDocuments.

The standard layout provided by Qt can handle simple word processing including inline images, lists and tables.

Some applications, e.g., a word processor or a DTP application might need more features than the ones provided by Qt's layout engine, in which case you can subclass QAbstractTextDocumentLayout to provide custom layout behavior for your text documents.

An instance of the QAbstractTextDocumentLayout subclass can be installed on a QTextDocument object with the setDocumentLayout() function.

You can insert custom objects into a QTextDocument; see the QTextObjectInterface class description for details.

Methods

impl QAbstractTextDocumentLayout[src]

pub fn update(&self) -> Signal<(*const QRectF,)>[src]

This signal is emitted when the rectangle rect has been updated.

Returns a built-in Qt signal QAbstractTextDocumentLayout::update that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted when the rectangle rect has been updated.

Subclasses of QAbstractTextDocumentLayout should emit this signal when the layout of the contents change in order to repaint.

pub fn update_block(&self) -> Signal<(*const QTextBlock,)>[src]

This signal is emitted when the specified block has been updated.

Returns a built-in Qt signal QAbstractTextDocumentLayout::updateBlock that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted when the specified block has been updated.

Subclasses of QAbstractTextDocumentLayout should emit this signal when the layout of block has changed in order to repaint.

This function was introduced in Qt 4.4.

pub fn document_size_changed(&self) -> Signal<(*const QSizeF,)>[src]

This signal is emitted when the size of the document layout changes to newSize.

Returns a built-in Qt signal QAbstractTextDocumentLayout::documentSizeChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted when the size of the document layout changes to newSize.

Subclasses of QAbstractTextDocumentLayout should emit this signal when the document's entire layout size changes. This signal is useful for widgets that display text documents since it enables them to update their scroll bars correctly.

See also documentSize().

pub fn page_count_changed(&self) -> Signal<(c_int,)>[src]

This signal is emitted when the number of pages in the layout changes; newPages is the updated page count.

Returns a built-in Qt signal QAbstractTextDocumentLayout::pageCountChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted when the number of pages in the layout changes; newPages is the updated page count.

Subclasses of QAbstractTextDocumentLayout should emit this signal when the number of pages in the layout has changed. Changes to the page count are caused by changes to the layout or the document content itself.

See also pageCount().

pub unsafe fn anchor_at(
    &self,
    pos: impl CastInto<Ref<QPointF>>
) -> CppBox<QString>
[src]

Returns the reference of the anchor the given position, or an empty string if no anchor exists at that point.

Calls C++ function: QString QAbstractTextDocumentLayout::anchorAt(const QPointF& pos) const.

C++ documentation:

Returns the reference of the anchor the given position, or an empty string if no anchor exists at that point.

pub unsafe fn block_bounding_rect(
    &self,
    block: impl CastInto<Ref<QTextBlock>>
) -> CppBox<QRectF>
[src]

Returns the bounding rectangle of block.

Calls C++ function: pure virtual QRectF QAbstractTextDocumentLayout::blockBoundingRect(const QTextBlock& block) const.

C++ documentation:

Returns the bounding rectangle of block.

pub unsafe fn block_with_marker_at(
    &self,
    pos: impl CastInto<Ref<QPointF>>
) -> CppBox<QTextBlock>
[src]

This is supported on cpp_lib_version="5.14.0" only.

Returns the block (probably a list item) whose marker is found at the given position pos.

Calls C++ function: QTextBlock QAbstractTextDocumentLayout::blockWithMarkerAt(const QPointF& pos) const.

C++ documentation:

Returns the block (probably a list item) whose marker is found at the given position pos.

This function was introduced in Qt 5.14.

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

Returns the text document that this layout is operating on.

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

C++ documentation:

Returns the text document that this layout is operating on.

pub unsafe fn document_size(&self) -> CppBox<QSizeF>[src]

Returns the total size of the document's layout.

Calls C++ function: pure virtual QSizeF QAbstractTextDocumentLayout::documentSize() const.

C++ documentation:

Returns the total size of the document's layout.

This information can be used by display widgets to update their scroll bars correctly.

See also documentSizeChanged() and QTextDocument::pageSize.

pub unsafe fn draw(
    &self,
    painter: impl CastInto<Ptr<QPainter>>,
    context: impl CastInto<Ref<PaintContext>>
)
[src]

Draws the layout with the given painter using the given context.

Calls C++ function: pure virtual void QAbstractTextDocumentLayout::draw(QPainter* painter, const QAbstractTextDocumentLayout::PaintContext& context).

C++ documentation:

Draws the layout with the given painter using the given context.

pub unsafe fn format_at(
    &self,
    pos: impl CastInto<Ref<QPointF>>
) -> CppBox<QTextFormat>
[src]

Returns the text format at the given position pos.

Calls C++ function: QTextFormat QAbstractTextDocumentLayout::formatAt(const QPointF& pos) const.

C++ documentation:

Returns the text format at the given position pos.

This function was introduced in Qt 5.8.

pub unsafe fn frame_bounding_rect(
    &self,
    frame: impl CastInto<Ptr<QTextFrame>>
) -> CppBox<QRectF>
[src]

Returns the bounding rectangle of frame.

Calls C++ function: pure virtual QRectF QAbstractTextDocumentLayout::frameBoundingRect(QTextFrame* frame) const.

C++ documentation:

Returns the bounding rectangle of frame.

pub unsafe fn handler_for_object(
    &self,
    object_type: c_int
) -> Ptr<QTextObjectInterface>
[src]

Returns a handler for objects of the given objectType.

Calls C++ function: QTextObjectInterface* QAbstractTextDocumentLayout::handlerForObject(int objectType) const.

C++ documentation:

Returns a handler for objects of the given objectType.

pub unsafe fn hit_test(
    &self,
    point: impl CastInto<Ref<QPointF>>,
    accuracy: HitTestAccuracy
) -> c_int
[src]

Returns the cursor position for the given point with the specified accuracy. Returns -1 if no valid cursor position was found.

Calls C++ function: pure virtual int QAbstractTextDocumentLayout::hitTest(const QPointF& point, Qt::HitTestAccuracy accuracy) const.

C++ documentation:

Returns the cursor position for the given point with the specified accuracy. Returns -1 if no valid cursor position was found.

pub unsafe fn image_at(
    &self,
    pos: impl CastInto<Ref<QPointF>>
) -> CppBox<QString>
[src]

Returns the source of the image at the given position pos, or an empty string if no image exists at that point.

Calls C++ function: QString QAbstractTextDocumentLayout::imageAt(const QPointF& pos) const.

C++ documentation:

Returns the source of the image at the given position pos, or an empty string if no image exists at that point.

This function was introduced in Qt 5.8.

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

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

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

Returns the number of pages contained in the layout.

Calls C++ function: pure virtual int QAbstractTextDocumentLayout::pageCount() const.

C++ documentation:

Returns the number of pages contained in the layout.

See also pageCountChanged().

pub unsafe fn paint_device(&self) -> Ptr<QPaintDevice>[src]

Returns the paint device used to render the document's layout.

Calls C++ function: QPaintDevice* QAbstractTextDocumentLayout::paintDevice() const.

C++ documentation:

Returns the paint device used to render the document's layout.

See also setPaintDevice().

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

Calls C++ function: virtual int QAbstractTextDocumentLayout::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* QAbstractTextDocumentLayout::qt_metacast(const char* arg1).

pub unsafe fn register_handler(
    &self,
    object_type: c_int,
    component: impl CastInto<Ptr<QObject>>
)
[src]

Registers the given component as a handler for items of the given objectType.

Calls C++ function: void QAbstractTextDocumentLayout::registerHandler(int objectType, QObject* component).

C++ documentation:

Registers the given component as a handler for items of the given objectType.

Note: registerHandler() has to be called once for each object type. This means that there is only one handler for multiple replacement characters of the same object type.

The text document layout does not take ownership of component.

pub unsafe fn set_paint_device(&self, device: impl CastInto<Ptr<QPaintDevice>>)[src]

Sets the paint device used for rendering the document's layout to the given device.

Calls C++ function: void QAbstractTextDocumentLayout::setPaintDevice(QPaintDevice* device).

C++ documentation:

Sets the paint device used for rendering the document's layout to the given device.

See also paintDevice().

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 QAbstractTextDocumentLayout::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 QAbstractTextDocumentLayout::trUtf8(const char* s, const char* c, int n).

pub unsafe fn unregister_handler_2a(
    &self,
    object_type: c_int,
    component: impl CastInto<Ptr<QObject>>
)
[src]

Unregisters the given component as a handler for items of the given objectType, or any handler if the component is not specified.

Calls C++ function: void QAbstractTextDocumentLayout::unregisterHandler(int objectType, QObject* component = …).

C++ documentation:

Unregisters the given component as a handler for items of the given objectType, or any handler if the component is not specified.

This function was introduced in Qt 5.2.

pub unsafe fn unregister_handler_1a(&self, object_type: c_int)[src]

Unregisters the given component as a handler for items of the given objectType, or any handler if the component is not specified.

Calls C++ function: void QAbstractTextDocumentLayout::unregisterHandler(int objectType).

C++ documentation:

Unregisters the given component as a handler for items of the given objectType, or any handler if the component is not specified.

This function was introduced in Qt 5.2.

Trait Implementations

impl CppDeletable for QAbstractTextDocumentLayout[src]

unsafe fn delete(&self)[src]

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

impl Deref for QAbstractTextDocumentLayout[src]

type Target = QObject

The resulting type after dereferencing.

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

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

impl DynamicCast<QAbstractTextDocumentLayout> for QObject[src]

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

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

impl StaticDowncast<QAbstractTextDocumentLayout> for QObject[src]

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

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

impl StaticUpcast<QObject> for QAbstractTextDocumentLayout[src]

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

Calls C++ function: QObject* static_cast<QObject*>(QAbstractTextDocumentLayout* 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.