[][src]Struct qt_widgets::QPlainTextDocumentLayout

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

The QPlainTextDocumentLayout class implements a plain text layout for QTextDocument

C++ class: QPlainTextDocumentLayout.

C++ documentation:

The QPlainTextDocumentLayout class implements a plain text layout for QTextDocument

A QPlainTextDocumentLayout is required for text documents that can be display or edited in a QPlainTextEdit. See QTextDocument::setDocumentLayout().

QPlainTextDocumentLayout uses the QAbstractTextDocumentLayout API that QTextDocument requires, but redefines it partially in order to support plain text better. For instances, it does not operate on vertical pixels, but on paragraphs (called blocks) instead. The height of a document is identical to the number of paragraphs it contains. The layout also doesn't support tables or nested frames, or any sort of advanced text layout that goes beyond a list of paragraphs with syntax highlighting.

Methods

impl QPlainTextDocumentLayout[src]

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

Reimplemented from QAbstractTextDocumentLayout::blockBoundingRect().

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

C++ documentation:

Reimplemented from QAbstractTextDocumentLayout::blockBoundingRect().

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

This property specifies the width of the cursor in pixels. The default value is 1.

Calls C++ function: int QPlainTextDocumentLayout::cursorWidth() const.

C++ documentation:

This property specifies the width of the cursor in pixels. The default value is 1.

Access functions:

int cursorWidth() const
void setCursorWidth(int width)

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

Reimplemented from QAbstractTextDocumentLayout::documentSize().

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

C++ documentation:

Reimplemented from QAbstractTextDocumentLayout::documentSize().

pub unsafe fn draw(
    &mut self,
    arg1: impl CastInto<MutPtr<QPainter>>,
    arg2: impl CastInto<Ref<PaintContext>>
)
[src]

Reimplemented from QAbstractTextDocumentLayout::draw().

Calls C++ function: virtual void QPlainTextDocumentLayout::draw(QPainter* arg1, const QAbstractTextDocumentLayout::PaintContext& arg2).

C++ documentation:

Reimplemented from QAbstractTextDocumentLayout::draw().

pub unsafe fn ensure_block_layout(&self, block: impl CastInto<Ref<QTextBlock>>)[src]

Ensures that block has a valid layout

Calls C++ function: void QPlainTextDocumentLayout::ensureBlockLayout(const QTextBlock& block) const.

C++ documentation:

Ensures that block has a valid layout

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

Reimplemented from QAbstractTextDocumentLayout::frameBoundingRect().

Calls C++ function: virtual QRectF QPlainTextDocumentLayout::frameBoundingRect(QTextFrame* arg1) const.

C++ documentation:

Reimplemented from QAbstractTextDocumentLayout::frameBoundingRect().

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

Reimplemented from QAbstractTextDocumentLayout::hitTest().

Calls C++ function: virtual int QPlainTextDocumentLayout::hitTest(const QPointF& arg1, Qt::HitTestAccuracy arg2) const.

C++ documentation:

Reimplemented from QAbstractTextDocumentLayout::hitTest().

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

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

pub unsafe fn new(
    document: impl CastInto<MutPtr<QTextDocument>>
) -> CppBox<QPlainTextDocumentLayout>
[src]

Constructs a plain text document layout for the text document.

Calls C++ function: [constructor] void QPlainTextDocumentLayout::QPlainTextDocumentLayout(QTextDocument* document).

C++ documentation:

Constructs a plain text document layout for the text document.

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

Reimplemented from QAbstractTextDocumentLayout::pageCount().

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

C++ documentation:

Reimplemented from QAbstractTextDocumentLayout::pageCount().

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

Calls C++ function: virtual int QPlainTextDocumentLayout::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]

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

pub unsafe fn request_update(&mut self)[src]

Requests a complete update on all views.

Calls C++ function: void QPlainTextDocumentLayout::requestUpdate().

C++ documentation:

Requests a complete update on all views.

pub unsafe fn set_cursor_width(&mut self, width: c_int)[src]

This property specifies the width of the cursor in pixels. The default value is 1.

Calls C++ function: void QPlainTextDocumentLayout::setCursorWidth(int width).

C++ documentation:

This property specifies the width of the cursor in pixels. The default value is 1.

Access functions:

int cursorWidth() const
void setCursorWidth(int width)

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]

Calls C++ function: static QString QPlainTextDocumentLayout::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]

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

Methods from Deref<Target = QAbstractTextDocumentLayout>

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<(i32,)>[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 document(&self) -> MutPtr<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(
    &mut self,
    painter: impl CastInto<MutPtr<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<MutPtr<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: i32
) -> MutPtr<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
) -> i32
[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) -> i32[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) -> MutPtr<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(
    &mut self,
    arg1: Call,
    arg2: i32,
    arg3: impl CastInto<MutPtr<*mut c_void>>
) -> i32
[src]

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

pub unsafe fn qt_metacast(
    &mut self,
    arg1: impl CastInto<Ptr<i8>>
) -> MutPtr<c_void>
[src]

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

pub unsafe fn register_handler(
    &mut self,
    object_type: i32,
    component: impl CastInto<MutPtr<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(
    &mut self,
    device: impl CastInto<MutPtr<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 unregister_handler_2a(
    &mut self,
    object_type: i32,
    component: impl CastInto<MutPtr<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(&mut self, object_type: i32)[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 Deref for QPlainTextDocumentLayout[src]

type Target = QAbstractTextDocumentLayout

The resulting type after dereferencing.

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

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

impl DerefMut for QPlainTextDocumentLayout[src]

fn deref_mut(&mut self) -> &mut QAbstractTextDocumentLayout[src]

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

impl StaticUpcast<QAbstractTextDocumentLayout> for QPlainTextDocumentLayout[src]

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

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

unsafe fn static_upcast_mut(
    ptr: MutPtr<QPlainTextDocumentLayout>
) -> MutPtr<QAbstractTextDocumentLayout>
[src]

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

impl StaticUpcast<QObject> for QPlainTextDocumentLayout[src]

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

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

unsafe fn static_upcast_mut(
    ptr: MutPtr<QPlainTextDocumentLayout>
) -> MutPtr<QObject>
[src]

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

impl StaticDowncast<QPlainTextDocumentLayout> for QAbstractTextDocumentLayout[src]

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

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

unsafe fn static_downcast_mut(
    ptr: MutPtr<QAbstractTextDocumentLayout>
) -> MutPtr<QPlainTextDocumentLayout>
[src]

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

impl StaticDowncast<QPlainTextDocumentLayout> for QObject[src]

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

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

unsafe fn static_downcast_mut(
    ptr: MutPtr<QObject>
) -> MutPtr<QPlainTextDocumentLayout>
[src]

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

impl DynamicCast<QPlainTextDocumentLayout> for QAbstractTextDocumentLayout[src]

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

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

unsafe fn dynamic_cast_mut(
    ptr: MutPtr<QAbstractTextDocumentLayout>
) -> MutPtr<QPlainTextDocumentLayout>
[src]

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

impl DynamicCast<QPlainTextDocumentLayout> for QObject[src]

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

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

unsafe fn dynamic_cast_mut(
    ptr: MutPtr<QObject>
) -> MutPtr<QPlainTextDocumentLayout>
[src]

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

impl CppDeletable for QPlainTextDocumentLayout[src]

unsafe fn delete(&mut self)[src]

Destructs a plain text document layout.

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

C++ documentation:

Destructs a plain text document layout.

Auto Trait Implementations

Blanket Implementations

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

impl<T> From<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.

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

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

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

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

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