API reference - Class QTextLayout

Notation used in Ruby API documentation

Description: Binding of QTextLayout

Sub-classes: CursorMode, FormatRange

Public constructors

new QTextLayoutnewConstructor QTextLayout::QTextLayout()
new QTextLayoutnew(string text)Constructor QTextLayout::QTextLayout(const QString &text)
new QTextLayoutnew(string text,
const QFont font,
QPaintDevice ptr paintdevice = 0)
Constructor QTextLayout::QTextLayout(const QString &text, const QFont &font, QPaintDevice *paintdevice)
new QTextLayoutnew(const QTextBlock b)Constructor QTextLayout::QTextLayout(const QTextBlock &b)

Public methods

void_createEnsures the C++ object is created
void_destroyExplicitly destroys the object
[const]bool_destroyed?Returns a value indicating whether the object was already destroyed
[const]bool_is_const_object?Returns a value indicating whether the reference is a const reference
void_manageMarks the object as managed by the script side.
void_unmanageMarks the object as no longer owned by the script side.
[const]QTextLayout_FormatRange[]additionalFormatsMethod QList<QTextLayout::FormatRange> QTextLayout::additionalFormats()
voidadditionalFormats=(QTextLayout_FormatRange[] overrides)Method void QTextLayout::setAdditionalFormats(const QList<QTextLayout::FormatRange> &overrides)
voidbeginLayoutMethod void QTextLayout::beginLayout()
[const]QRectFboundingRectMethod QRectF QTextLayout::boundingRect()
[const]boolcacheEnabledMethod bool QTextLayout::cacheEnabled()
voidcacheEnabled=(bool enable)Method void QTextLayout::setCacheEnabled(bool enable)
voidclearAdditionalFormatsMethod void QTextLayout::clearAdditionalFormats()
voidclearLayoutMethod void QTextLayout::clearLayout()
QTextLinecreateLineMethod QTextLine QTextLayout::createLine()
[const]voiddraw(QPainter ptr p,
const QPointF pos,
QTextLayout_FormatRange[] selections = QVector<QTextLayout::FormatRange>(),
const QRectF clip = QRectF())
Method void QTextLayout::draw(QPainter *p, const QPointF &pos, const QVector<QTextLayout::FormatRange> &selections, const QRectF &clip)
[const]voiddrawCursor(QPainter ptr p,
const QPointF pos,
int cursorPosition)
Method void QTextLayout::drawCursor(QPainter *p, const QPointF &pos, int cursorPosition)
[const]voiddrawCursor(QPainter ptr p,
const QPointF pos,
int cursorPosition,
int width)
Method void QTextLayout::drawCursor(QPainter *p, const QPointF &pos, int cursorPosition, int width)
voidendLayoutMethod void QTextLayout::endLayout()
[const]QFontfontMethod QFont QTextLayout::font()
voidfont=(const QFont f)Method void QTextLayout::setFont(const QFont &f)
[const]boolisValidCursorPosition?(int pos)Method bool QTextLayout::isValidCursorPosition(int pos)
[const]QTextLinelineAt(int i)Method QTextLine QTextLayout::lineAt(int i)
[const]intlineCountMethod int QTextLayout::lineCount()
[const]QTextLinelineForTextPosition(int pos)Method QTextLine QTextLayout::lineForTextPosition(int pos)
[const]doublemaximumWidthMethod double QTextLayout::maximumWidth()
[const]doubleminimumWidthMethod double QTextLayout::minimumWidth()
[const]intnextCursorPosition(int oldPos,
const QTextLayout_CursorMode mode = QTextLayout::SkipCharacters)
Method int QTextLayout::nextCursorPosition(int oldPos, QTextLayout::CursorMode mode)
[const]QPointFpositionMethod QPointF QTextLayout::position()
voidposition=(const QPointF p)Method void QTextLayout::setPosition(const QPointF &p)
[const]intpreeditAreaPositionMethod int QTextLayout::preeditAreaPosition()
[const]stringpreeditAreaTextMethod QString QTextLayout::preeditAreaText()
[const]intpreviousCursorPosition(int oldPos,
const QTextLayout_CursorMode mode = QTextLayout::SkipCharacters)
Method int QTextLayout::previousCursorPosition(int oldPos, QTextLayout::CursorMode mode)
voidsetAdditionalFormats(QTextLayout_FormatRange[] overrides)Method void QTextLayout::setAdditionalFormats(const QList<QTextLayout::FormatRange> &overrides)
voidsetCacheEnabled(bool enable)Method void QTextLayout::setCacheEnabled(bool enable)
voidsetFlags(int flags)Method void QTextLayout::setFlags(int flags)
voidsetFont(const QFont f)Method void QTextLayout::setFont(const QFont &f)
voidsetPosition(const QPointF p)Method void QTextLayout::setPosition(const QPointF &p)
voidsetPreeditArea(int position,
string text)
Method void QTextLayout::setPreeditArea(int position, const QString &text)
voidsetText(string string)Method void QTextLayout::setText(const QString &string)
voidsetTextOption(const QTextOption option)Method void QTextLayout::setTextOption(const QTextOption &option)
[const]stringtextMethod QString QTextLayout::text()
voidtext=(string string)Method void QTextLayout::setText(const QString &string)
[const]QTextOptiontextOptionMethod QTextOption QTextLayout::textOption()
voidtextOption=(const QTextOption option)Method void QTextLayout::setTextOption(const QTextOption &option)

Public static methods and constants

[static,const]new QTextLayout_CursorMode ptrSkipCharactersEnum constant QTextLayout::SkipCharacters
[static,const]new QTextLayout_CursorMode ptrSkipWordsEnum constant QTextLayout::SkipWords

Deprecated methods (protected, public, static, non-static and constructors)

voidcreateUse of this method is deprecated. Use _create instead
voiddestroyUse of this method is deprecated. Use _destroy instead
[const]booldestroyed?Use of this method is deprecated. Use _destroyed? instead
[const]boolis_const_object?Use of this method is deprecated. Use _is_const_object? instead

Detailed description

[static,const] new QTextLayout_CursorMode ptr SkipCharacters

Description: Enum constant QTextLayout::SkipCharacters

[static,const] new QTextLayout_CursorMode ptr SkipWords

Description: Enum constant QTextLayout::SkipWords

void _create

Description: Ensures the C++ object is created

Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

void _destroy

Description: Explicitly destroys the object

Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing.

[const] bool _destroyed?

Description: Returns a value indicating whether the object was already destroyed

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

[const] bool _is_const_object?

Description: Returns a value indicating whether the reference is a const reference

This method returns true, if self is a const reference. In that case, only const methods may be called on self.

void _manage

Description: Marks the object as managed by the script side.

After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required.

Usually it's not required to call this method. It has been introduced in version 0.24.

void _unmanage

Description: Marks the object as no longer owned by the script side.

Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur.

Usually it's not required to call this method. It has been introduced in version 0.24.

[const] QTextLayout_FormatRange[] additionalFormats

Description: Method QList<QTextLayout::FormatRange> QTextLayout::additionalFormats()

Python specific notes:

The object exposes a readable attribute 'additionalFormats'. This is the getter.

void additionalFormats=(QTextLayout_FormatRange[] overrides)

Description: Method void QTextLayout::setAdditionalFormats(const QList<QTextLayout::FormatRange> &overrides)

Python specific notes:

The object exposes a writable attribute 'additionalFormats'. This is the setter.

void beginLayout

Description: Method void QTextLayout::beginLayout()

[const] QRectF boundingRect

Description: Method QRectF QTextLayout::boundingRect()

[const] bool cacheEnabled

Description: Method bool QTextLayout::cacheEnabled()

Python specific notes:

The object exposes a readable attribute 'cacheEnabled'. This is the getter.

void cacheEnabled=(bool enable)

Description: Method void QTextLayout::setCacheEnabled(bool enable)

Python specific notes:

The object exposes a writable attribute 'cacheEnabled'. This is the setter.

void clearAdditionalFormats

Description: Method void QTextLayout::clearAdditionalFormats()

void clearLayout

Description: Method void QTextLayout::clearLayout()

void create

Description: Ensures the C++ object is created

Use of this method is deprecated. Use _create instead

QTextLine createLine

Description: Method QTextLine QTextLayout::createLine()

void destroy

Description: Explicitly destroys the object

Use of this method is deprecated. Use _destroy instead

[const] bool destroyed?

Description: Returns a value indicating whether the object was already destroyed

Use of this method is deprecated. Use _destroyed? instead

[const] void draw(QPainter ptr p,const QPointF pos,QTextLayout_FormatRange[] selections = QVector<QTextLayout::FormatRange>(),const QRectF clip = QRectF())

Description: Method void QTextLayout::draw(QPainter *p, const QPointF &pos, const QVector<QTextLayout::FormatRange> &selections, const QRectF &clip)

[const] void drawCursor(QPainter ptr p,const QPointF pos,int cursorPosition)

Description: Method void QTextLayout::drawCursor(QPainter *p, const QPointF &pos, int cursorPosition)

[const] void drawCursor(QPainter ptr p,const QPointF pos,int cursorPosition,int width)

Description: Method void QTextLayout::drawCursor(QPainter *p, const QPointF &pos, int cursorPosition, int width)

void endLayout

Description: Method void QTextLayout::endLayout()

[const] QFont font

Description: Method QFont QTextLayout::font()

Python specific notes:

The object exposes a readable attribute 'font'. This is the getter.

void font=(const QFont f)

Description: Method void QTextLayout::setFont(const QFont &f)

Python specific notes:

The object exposes a writable attribute 'font'. This is the setter.

[const] bool isValidCursorPosition?(int pos)

Description: Method bool QTextLayout::isValidCursorPosition(int pos)

[const] bool is_const_object?

Description: Returns a value indicating whether the reference is a const reference

Use of this method is deprecated. Use _is_const_object? instead

[const] QTextLine lineAt(int i)

Description: Method QTextLine QTextLayout::lineAt(int i)

[const] int lineCount

Description: Method int QTextLayout::lineCount()

[const] QTextLine lineForTextPosition(int pos)

Description: Method QTextLine QTextLayout::lineForTextPosition(int pos)

[const] double maximumWidth

Description: Method double QTextLayout::maximumWidth()

[const] double minimumWidth

Description: Method double QTextLayout::minimumWidth()

[static] new QTextLayout new

Description: Constructor QTextLayout::QTextLayout()

This method creates an object of class QTextLayout.

Python specific notes:

This method is the default initializer of the object

[static] new QTextLayout new(string text)

Description: Constructor QTextLayout::QTextLayout(const QString &text)

This method creates an object of class QTextLayout.

Python specific notes:

This method is the default initializer of the object

[static] new QTextLayout new(string text,const QFont font,QPaintDevice ptr paintdevice = 0)

Description: Constructor QTextLayout::QTextLayout(const QString &text, const QFont &font, QPaintDevice *paintdevice)

This method creates an object of class QTextLayout.

Python specific notes:

This method is the default initializer of the object

[static] new QTextLayout new(const QTextBlock b)

Description: Constructor QTextLayout::QTextLayout(const QTextBlock &b)

This method creates an object of class QTextLayout.

Python specific notes:

This method is the default initializer of the object

[const] int nextCursorPosition(int oldPos,const QTextLayout_CursorMode mode = QTextLayout::SkipCharacters)

Description: Method int QTextLayout::nextCursorPosition(int oldPos, QTextLayout::CursorMode mode)

[const] QPointF position

Description: Method QPointF QTextLayout::position()

Python specific notes:

The object exposes a readable attribute 'position'. This is the getter.

void position=(const QPointF p)

Description: Method void QTextLayout::setPosition(const QPointF &p)

Python specific notes:

The object exposes a writable attribute 'position'. This is the setter.

[const] int preeditAreaPosition

Description: Method int QTextLayout::preeditAreaPosition()

[const] string preeditAreaText

Description: Method QString QTextLayout::preeditAreaText()

[const] int previousCursorPosition(int oldPos,const QTextLayout_CursorMode mode = QTextLayout::SkipCharacters)

Description: Method int QTextLayout::previousCursorPosition(int oldPos, QTextLayout::CursorMode mode)

void setAdditionalFormats(QTextLayout_FormatRange[] overrides)

Description: Method void QTextLayout::setAdditionalFormats(const QList<QTextLayout::FormatRange> &overrides)

Python specific notes:

The object exposes a writable attribute 'additionalFormats'. This is the setter.

void setCacheEnabled(bool enable)

Description: Method void QTextLayout::setCacheEnabled(bool enable)

Python specific notes:

The object exposes a writable attribute 'cacheEnabled'. This is the setter.

void setFlags(int flags)

Description: Method void QTextLayout::setFlags(int flags)

void setFont(const QFont f)

Description: Method void QTextLayout::setFont(const QFont &f)

Python specific notes:

The object exposes a writable attribute 'font'. This is the setter.

void setPosition(const QPointF p)

Description: Method void QTextLayout::setPosition(const QPointF &p)

Python specific notes:

The object exposes a writable attribute 'position'. This is the setter.

void setPreeditArea(int position,string text)

Description: Method void QTextLayout::setPreeditArea(int position, const QString &text)

void setText(string string)

Description: Method void QTextLayout::setText(const QString &string)

Python specific notes:

The object exposes a writable attribute 'text'. This is the setter.

void setTextOption(const QTextOption option)

Description: Method void QTextLayout::setTextOption(const QTextOption &option)

Python specific notes:

The object exposes a writable attribute 'textOption'. This is the setter.

[const] string text

Description: Method QString QTextLayout::text()

Python specific notes:

The object exposes a readable attribute 'text'. This is the getter.

void text=(string string)

Description: Method void QTextLayout::setText(const QString &string)

Python specific notes:

The object exposes a writable attribute 'text'. This is the setter.

[const] QTextOption textOption

Description: Method QTextOption QTextLayout::textOption()

Python specific notes:

The object exposes a readable attribute 'textOption'. This is the getter.

void textOption=(const QTextOption option)

Description: Method void QTextLayout::setTextOption(const QTextOption &option)

Python specific notes:

The object exposes a writable attribute 'textOption'. This is the setter.