IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QTextInlineObject Class

The QTextInlineObject class represents an inline object in a QAbstractTextDocumentLayout and its implementations.

All functions in this class are reentrant.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QTextInlineObject Class

  • Header: QTextInlineObject

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS Gui)

    target_link_libraries(mytarget PRIVATE Qt6::Gui)

  • qmake: QT += gui

  • Group: QTextInlineObject is part of Rich Text Processing APIs

Detailed Description

Normally, you do not need to create a QTextInlineObject. It is used by QAbstractTextDocumentLayout to handle inline objects when implementing a custom layout.

The inline object has various attributes that can be set, for example using, setWidth(), setAscent(), and setDescent(). The rectangle it occupies is given by rect(), and its direction by textDirection(). Its position in the text layout is given by textPosition(), and its format is given by format().

Member Function Documentation

 

qreal QTextInlineObject::ascent() const

Returns the inline object's ascent.

See Also

See also setAscent(), descent(), width(), rect()

qreal QTextInlineObject::descent() const

Returns the inline object's descent.

See Also

See also setDescent(), ascent(), width(), rect()

QTextFormat QTextInlineObject::format() const

Returns format of the inline object within the text layout.

int QTextInlineObject::formatIndex() const

Returns an integer describing the format of the inline object within the text layout.

qreal QTextInlineObject::height() const

Returns the inline object's total height. This is equal to ascent() + descent() + 1.

See Also

See also ascent(), descent(), width(), rect()

bool QTextInlineObject::isValid() const

Returns true if this inline object is valid; otherwise returns false.

QRectF QTextInlineObject::rect() const

Returns the inline object's rectangle.

See Also

See also ascent(), descent(), width()

void QTextInlineObject::setAscent(qreal a)

Sets the inline object's ascent to a.

See Also

See also ascent(), setDescent(), width(), rect()

void QTextInlineObject::setDescent(qreal d)

Sets the inline object's descent to d.

See Also

See also descent(), setAscent(), width(), rect()

void QTextInlineObject::setWidth(qreal w)

Sets the inline object's width to w.

See Also

See also width(), ascent(), descent(), rect()

Qt::LayoutDirection QTextInlineObject::textDirection() const

Returns if the object should be laid out right-to-left or left-to-right.

int QTextInlineObject::textPosition() const

The position of the inline object within the text layout.

qreal QTextInlineObject::width() const

Returns the inline object's width.

See Also

See also setWidth(), ascent(), descent(), rect()

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+