API reference - Class QTextFormat

Notation used in Ruby API documentation

Module: QtGui

Description: Binding of QTextFormat

Sub-classes: PageBreakFlag, QFlags_PageBreakFlag

Public constructors

new QTextFormatnewConstructor QTextFormat::QTextFormat()
new QTextFormatnew(int type)Constructor QTextFormat::QTextFormat(int type)
new QTextFormatnew(const QTextFormat rhs)Constructor QTextFormat::QTextFormat(const QTextFormat &rhs)

Public methods

[const]bool!=(const QTextFormat rhs)Method bool QTextFormat::operator!=(const QTextFormat &rhs)
[const]bool==(const QTextFormat rhs)Method bool QTextFormat::operator==(const QTextFormat &rhs)
void_assign(const QTextFormat other)Assigns another object to self
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.
QTextFormatassign(const QTextFormat rhs)Method QTextFormat &QTextFormat::operator=(const QTextFormat &rhs)
[const]QBrushbackgroundMethod QBrush QTextFormat::background()
voidbackground=(const QBrush brush)Method void QTextFormat::setBackground(const QBrush &brush)
[const]boolboolProperty(int propertyId)Method bool QTextFormat::boolProperty(int propertyId)
[const]QBrushbrushProperty(int propertyId)Method QBrush QTextFormat::brushProperty(int propertyId)
voidclearBackgroundMethod void QTextFormat::clearBackground()
voidclearForegroundMethod void QTextFormat::clearForeground()
voidclearProperty(int propertyId)Method void QTextFormat::clearProperty(int propertyId)
[const]QColorcolorProperty(int propertyId)Method QColor QTextFormat::colorProperty(int propertyId)
[const]doubledoubleProperty(int propertyId)Method double QTextFormat::doubleProperty(int propertyId)
[const]new QTextFormat ptrdupCreates a copy of self
[const]QBrushforegroundMethod QBrush QTextFormat::foreground()
voidforeground=(const QBrush brush)Method void QTextFormat::setForeground(const QBrush &brush)
[const]boolhasProperty(int propertyId)Method bool QTextFormat::hasProperty(int propertyId)
[const]intintProperty(int propertyId)Method int QTextFormat::intProperty(int propertyId)
[const]boolisBlockFormat?Method bool QTextFormat::isBlockFormat()
[const]boolisCharFormat?Method bool QTextFormat::isCharFormat()
[const]boolisEmpty?Method bool QTextFormat::isEmpty()
[const]boolisFrameFormat?Method bool QTextFormat::isFrameFormat()
[const]boolisImageFormat?Method bool QTextFormat::isImageFormat()
[const]boolisListFormat?Method bool QTextFormat::isListFormat()
[const]boolisTableCellFormat?Method bool QTextFormat::isTableCellFormat()
[const]boolisTableFormat?Method bool QTextFormat::isTableFormat()
[const]boolisValid?Method bool QTextFormat::isValid()
[const]Qt_LayoutDirectionlayoutDirectionMethod Qt::LayoutDirection QTextFormat::layoutDirection()
voidlayoutDirection=(const Qt_LayoutDirection direction)Method void QTextFormat::setLayoutDirection(Qt::LayoutDirection direction)
[const]QTextLengthlengthProperty(int propertyId)Method QTextLength QTextFormat::lengthProperty(int propertyId)
[const]QTextLength[]lengthVectorProperty(int propertyId)Method QVector<QTextLength> QTextFormat::lengthVectorProperty(int propertyId)
voidmerge(const QTextFormat other)Method void QTextFormat::merge(const QTextFormat &other)
[const]intobjectIndexMethod int QTextFormat::objectIndex()
voidobjectIndex=(int object)Method void QTextFormat::setObjectIndex(int object)
[const]intobjectTypeMethod int QTextFormat::objectType()
voidobjectType=(int type)Method void QTextFormat::setObjectType(int type)
[const]QPenpenProperty(int propertyId)Method QPen QTextFormat::penProperty(int propertyId)
[const]map<int,variant>propertiesMethod QMap<int, QVariant> QTextFormat::properties()
[const]variantproperty(int propertyId)Method QVariant QTextFormat::property(int propertyId)
[const]intpropertyCountMethod int QTextFormat::propertyCount()
voidsetBackground(const QBrush brush)Method void QTextFormat::setBackground(const QBrush &brush)
voidsetForeground(const QBrush brush)Method void QTextFormat::setForeground(const QBrush &brush)
voidsetLayoutDirection(const Qt_LayoutDirection direction)Method void QTextFormat::setLayoutDirection(Qt::LayoutDirection direction)
voidsetObjectIndex(int object)Method void QTextFormat::setObjectIndex(int object)
voidsetObjectType(int type)Method void QTextFormat::setObjectType(int type)
voidsetProperty(int propertyId,
variant value)
Method void QTextFormat::setProperty(int propertyId, const QVariant &value)
voidsetProperty(int propertyId,
QTextLength[] lengths)
Method void QTextFormat::setProperty(int propertyId, const QVector<QTextLength> &lengths)
[const]stringstringProperty(int propertyId)Method QString QTextFormat::stringProperty(int propertyId)
voidswap(QTextFormat other)Method void QTextFormat::swap(QTextFormat &other)
[const]QTextBlockFormattoBlockFormatMethod QTextBlockFormat QTextFormat::toBlockFormat()
[const]QTextCharFormattoCharFormatMethod QTextCharFormat QTextFormat::toCharFormat()
[const]QTextFrameFormattoFrameFormatMethod QTextFrameFormat QTextFormat::toFrameFormat()
[const]QTextImageFormattoImageFormatMethod QTextImageFormat QTextFormat::toImageFormat()
[const]QTextListFormattoListFormatMethod QTextListFormat QTextFormat::toListFormat()
[const]QTextTableCellFormattoTableCellFormatMethod QTextTableCellFormat QTextFormat::toTableCellFormat()
[const]QTextTableFormattoTableFormatMethod QTextTableFormat QTextFormat::toTableFormat()
[const]inttypeMethod int QTextFormat::type()

Public static methods and constants

[static,const]QTextFormat_PageBreakFlagPageBreak_AlwaysAfterEnum constant QTextFormat::PageBreak_AlwaysAfter
[static,const]QTextFormat_PageBreakFlagPageBreak_AlwaysBeforeEnum constant QTextFormat::PageBreak_AlwaysBefore
[static,const]QTextFormat_PageBreakFlagPageBreak_AutoEnum constant QTextFormat::PageBreak_Auto

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

!=

Signature: [const] bool != (const QTextFormat rhs)

Description: Method bool QTextFormat::operator!=(const QTextFormat &rhs)

==

Signature: [const] bool == (const QTextFormat rhs)

Description: Method bool QTextFormat::operator==(const QTextFormat &rhs)

PageBreak_AlwaysAfter

Signature: [static,const] QTextFormat_PageBreakFlag PageBreak_AlwaysAfter

Description: Enum constant QTextFormat::PageBreak_AlwaysAfter

Python specific notes:
The object exposes a readable attribute 'PageBreak_AlwaysAfter'. This is the getter.

PageBreak_AlwaysBefore

Signature: [static,const] QTextFormat_PageBreakFlag PageBreak_AlwaysBefore

Description: Enum constant QTextFormat::PageBreak_AlwaysBefore

Python specific notes:
The object exposes a readable attribute 'PageBreak_AlwaysBefore'. This is the getter.

PageBreak_Auto

Signature: [static,const] QTextFormat_PageBreakFlag PageBreak_Auto

Description: Enum constant QTextFormat::PageBreak_Auto

Python specific notes:
The object exposes a readable attribute 'PageBreak_Auto'. This is the getter.

_assign

Signature: void _assign (const QTextFormat other)

Description: Assigns another object to self

_create

Signature: 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.

_destroy

Signature: 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.

_destroyed?

Signature: [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.

_is_const_object?

Signature: [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.

_manage

Signature: 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.

_unmanage

Signature: 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.

assign

Signature: QTextFormat assign (const QTextFormat rhs)

Description: Method QTextFormat &QTextFormat::operator=(const QTextFormat &rhs)

background

Signature: [const] QBrush background

Description: Method QBrush QTextFormat::background()

Python specific notes:
The object exposes a readable attribute 'background'. This is the getter.

background=

Signature: void background= (const QBrush brush)

Description: Method void QTextFormat::setBackground(const QBrush &brush)

Python specific notes:
The object exposes a writable attribute 'background'. This is the setter.

boolProperty

Signature: [const] bool boolProperty (int propertyId)

Description: Method bool QTextFormat::boolProperty(int propertyId)

brushProperty

Signature: [const] QBrush brushProperty (int propertyId)

Description: Method QBrush QTextFormat::brushProperty(int propertyId)

clearBackground

Signature: void clearBackground

Description: Method void QTextFormat::clearBackground()

clearForeground

Signature: void clearForeground

Description: Method void QTextFormat::clearForeground()

clearProperty

Signature: void clearProperty (int propertyId)

Description: Method void QTextFormat::clearProperty(int propertyId)

colorProperty

Signature: [const] QColor colorProperty (int propertyId)

Description: Method QColor QTextFormat::colorProperty(int propertyId)

create

Signature: void create

Description: Ensures the C++ object is created

Use of this method is deprecated. Use _create instead

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.

destroy

Signature: void destroy

Description: Explicitly destroys the object

Use of this method is deprecated. Use _destroy instead

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.

destroyed?

Signature: [const] bool destroyed?

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

Use of this method is deprecated. Use _destroyed? instead

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.

doubleProperty

Signature: [const] double doubleProperty (int propertyId)

Description: Method double QTextFormat::doubleProperty(int propertyId)

dup

Signature: [const] new QTextFormat ptr dup

Description: Creates a copy of self

Python specific notes:
This method also implements '__copy__' and '__deepcopy__'.

foreground

Signature: [const] QBrush foreground

Description: Method QBrush QTextFormat::foreground()

Python specific notes:
The object exposes a readable attribute 'foreground'. This is the getter.

foreground=

Signature: void foreground= (const QBrush brush)

Description: Method void QTextFormat::setForeground(const QBrush &brush)

Python specific notes:
The object exposes a writable attribute 'foreground'. This is the setter.

hasProperty

Signature: [const] bool hasProperty (int propertyId)

Description: Method bool QTextFormat::hasProperty(int propertyId)

intProperty

Signature: [const] int intProperty (int propertyId)

Description: Method int QTextFormat::intProperty(int propertyId)

isBlockFormat?

Signature: [const] bool isBlockFormat?

Description: Method bool QTextFormat::isBlockFormat()

isCharFormat?

Signature: [const] bool isCharFormat?

Description: Method bool QTextFormat::isCharFormat()

isEmpty?

Signature: [const] bool isEmpty?

Description: Method bool QTextFormat::isEmpty()

isFrameFormat?

Signature: [const] bool isFrameFormat?

Description: Method bool QTextFormat::isFrameFormat()

isImageFormat?

Signature: [const] bool isImageFormat?

Description: Method bool QTextFormat::isImageFormat()

isListFormat?

Signature: [const] bool isListFormat?

Description: Method bool QTextFormat::isListFormat()

isTableCellFormat?

Signature: [const] bool isTableCellFormat?

Description: Method bool QTextFormat::isTableCellFormat()

isTableFormat?

Signature: [const] bool isTableFormat?

Description: Method bool QTextFormat::isTableFormat()

isValid?

Signature: [const] bool isValid?

Description: Method bool QTextFormat::isValid()

is_const_object?

Signature: [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

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

layoutDirection

Signature: [const] Qt_LayoutDirection layoutDirection

Description: Method Qt::LayoutDirection QTextFormat::layoutDirection()

Python specific notes:
The object exposes a readable attribute 'layoutDirection'. This is the getter.

layoutDirection=

Signature: void layoutDirection= (const Qt_LayoutDirection direction)

Description: Method void QTextFormat::setLayoutDirection(Qt::LayoutDirection direction)

Python specific notes:
The object exposes a writable attribute 'layoutDirection'. This is the setter.

lengthProperty

Signature: [const] QTextLength lengthProperty (int propertyId)

Description: Method QTextLength QTextFormat::lengthProperty(int propertyId)

lengthVectorProperty

Signature: [const] QTextLength[] lengthVectorProperty (int propertyId)

Description: Method QVector<QTextLength> QTextFormat::lengthVectorProperty(int propertyId)

merge

Signature: void merge (const QTextFormat other)

Description: Method void QTextFormat::merge(const QTextFormat &other)

new

(1) Signature: [static] new QTextFormat new

Description: Constructor QTextFormat::QTextFormat()

This method creates an object of class QTextFormat.

Python specific notes:
This method is the default initializer of the object.

(2) Signature: [static] new QTextFormat new (int type)

Description: Constructor QTextFormat::QTextFormat(int type)

This method creates an object of class QTextFormat.

Python specific notes:
This method is the default initializer of the object.

(3) Signature: [static] new QTextFormat new (const QTextFormat rhs)

Description: Constructor QTextFormat::QTextFormat(const QTextFormat &rhs)

This method creates an object of class QTextFormat.

Python specific notes:
This method is the default initializer of the object.

objectIndex

Signature: [const] int objectIndex

Description: Method int QTextFormat::objectIndex()

Python specific notes:
The object exposes a readable attribute 'objectIndex'. This is the getter.

objectIndex=

Signature: void objectIndex= (int object)

Description: Method void QTextFormat::setObjectIndex(int object)

Python specific notes:
The object exposes a writable attribute 'objectIndex'. This is the setter.

objectType

Signature: [const] int objectType

Description: Method int QTextFormat::objectType()

Python specific notes:
The object exposes a readable attribute 'objectType'. This is the getter.

objectType=

Signature: void objectType= (int type)

Description: Method void QTextFormat::setObjectType(int type)

Python specific notes:
The object exposes a writable attribute 'objectType'. This is the setter.

penProperty

Signature: [const] QPen penProperty (int propertyId)

Description: Method QPen QTextFormat::penProperty(int propertyId)

properties

Signature: [const] map<int,variant> properties

Description: Method QMap<int, QVariant> QTextFormat::properties()

property

Signature: [const] variant property (int propertyId)

Description: Method QVariant QTextFormat::property(int propertyId)

propertyCount

Signature: [const] int propertyCount

Description: Method int QTextFormat::propertyCount()

setBackground

Signature: void setBackground (const QBrush brush)

Description: Method void QTextFormat::setBackground(const QBrush &brush)

Python specific notes:
The object exposes a writable attribute 'background'. This is the setter.

setForeground

Signature: void setForeground (const QBrush brush)

Description: Method void QTextFormat::setForeground(const QBrush &brush)

Python specific notes:
The object exposes a writable attribute 'foreground'. This is the setter.

setLayoutDirection

Signature: void setLayoutDirection (const Qt_LayoutDirection direction)

Description: Method void QTextFormat::setLayoutDirection(Qt::LayoutDirection direction)

Python specific notes:
The object exposes a writable attribute 'layoutDirection'. This is the setter.

setObjectIndex

Signature: void setObjectIndex (int object)

Description: Method void QTextFormat::setObjectIndex(int object)

Python specific notes:
The object exposes a writable attribute 'objectIndex'. This is the setter.

setObjectType

Signature: void setObjectType (int type)

Description: Method void QTextFormat::setObjectType(int type)

Python specific notes:
The object exposes a writable attribute 'objectType'. This is the setter.

setProperty

(1) Signature: void setProperty (int propertyId, variant value)

Description: Method void QTextFormat::setProperty(int propertyId, const QVariant &value)

(2) Signature: void setProperty (int propertyId, QTextLength[] lengths)

Description: Method void QTextFormat::setProperty(int propertyId, const QVector<QTextLength> &lengths)

stringProperty

Signature: [const] string stringProperty (int propertyId)

Description: Method QString QTextFormat::stringProperty(int propertyId)

swap

Signature: void swap (QTextFormat other)

Description: Method void QTextFormat::swap(QTextFormat &other)

toBlockFormat

Signature: [const] QTextBlockFormat toBlockFormat

Description: Method QTextBlockFormat QTextFormat::toBlockFormat()

toCharFormat

Signature: [const] QTextCharFormat toCharFormat

Description: Method QTextCharFormat QTextFormat::toCharFormat()

toFrameFormat

Signature: [const] QTextFrameFormat toFrameFormat

Description: Method QTextFrameFormat QTextFormat::toFrameFormat()

toImageFormat

Signature: [const] QTextImageFormat toImageFormat

Description: Method QTextImageFormat QTextFormat::toImageFormat()

toListFormat

Signature: [const] QTextListFormat toListFormat

Description: Method QTextListFormat QTextFormat::toListFormat()

toTableCellFormat

Signature: [const] QTextTableCellFormat toTableCellFormat

Description: Method QTextTableCellFormat QTextFormat::toTableCellFormat()

toTableFormat

Signature: [const] QTextTableFormat toTableFormat

Description: Method QTextTableFormat QTextFormat::toTableFormat()

type

Signature: [const] int type

Description: Method int QTextFormat::type()