KLayout 0.29.8 (2024-10-28 63dd591e5) [master]

API reference - Class QPen

Notation used in Ruby API documentation

Module: QtGui

Description: Binding of QPen

Public constructors

new QPennewConstructor QPen::QPen()
new QPennew(const Qt_PenStyle arg1)Constructor QPen::QPen(Qt::PenStyle)
new QPennew(const QColor color)Constructor QPen::QPen(const QColor &color)
new QPennew(const QBrush brush,
double width,
const Qt_PenStyle s = Qt::SolidLine,
const Qt_PenCapStyle c = Qt::SquareCap,
const Qt_PenJoinStyle j = Qt::BevelJoin)
Constructor QPen::QPen(const QBrush &brush, double width, Qt::PenStyle s, Qt::PenCapStyle c, Qt::PenJoinStyle j)
new QPennew(const QPen pen)Constructor QPen::QPen(const QPen &pen)

Public methods

[const]bool!=(const QPen p)Method bool QPen::operator!=(const QPen &p)
[const]bool==(const QPen p)Method bool QPen::operator==(const QPen &p)
void_assign(const QPen other)Assigns another object to self
[const]QPen ptr_const_castReturns a non-const reference 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.
QPenassign(const QPen pen)Method QPen &QPen::operator=(const QPen &pen)
[const]QBrushbrushMethod QBrush QPen::brush()
voidbrush=(const QBrush brush)Method void QPen::setBrush(const QBrush &brush)
[const]Qt_PenCapStylecapStyleMethod Qt::PenCapStyle QPen::capStyle()
voidcapStyle=(const Qt_PenCapStyle pcs)Method void QPen::setCapStyle(Qt::PenCapStyle pcs)
[const]QColorcolorMethod QColor QPen::color()
voidcolor=(const QColor color)Method void QPen::setColor(const QColor &color)
[const]boolcosmeticMethod bool QPen::isCosmetic()
voidcosmetic=(bool cosmetic)Method void QPen::setCosmetic(bool cosmetic)
[const]doubledashOffsetMethod double QPen::dashOffset()
voiddashOffset=(double doffset)Method void QPen::setDashOffset(double doffset)
[const]double[]dashPatternMethod QVector<qreal> QPen::dashPattern()
voiddashPattern=(double[] pattern)Method void QPen::setDashPattern(const QVector<qreal> &pattern)
[const]new QPen ptrdupCreates a copy of self
[const]boolisCosmetic?Method bool QPen::isCosmetic()
boolisDetached?Method bool QPen::isDetached()
[const]boolisSolid?Method bool QPen::isSolid()
[const]Qt_PenJoinStylejoinStyleMethod Qt::PenJoinStyle QPen::joinStyle()
voidjoinStyle=(const Qt_PenJoinStyle pcs)Method void QPen::setJoinStyle(Qt::PenJoinStyle pcs)
[const]doublemiterLimitMethod double QPen::miterLimit()
voidmiterLimit=(double limit)Method void QPen::setMiterLimit(double limit)
voidsetBrush(const QBrush brush)Method void QPen::setBrush(const QBrush &brush)
voidsetCapStyle(const Qt_PenCapStyle pcs)Method void QPen::setCapStyle(Qt::PenCapStyle pcs)
voidsetColor(const QColor color)Method void QPen::setColor(const QColor &color)
voidsetCosmetic(bool cosmetic)Method void QPen::setCosmetic(bool cosmetic)
voidsetDashOffset(double doffset)Method void QPen::setDashOffset(double doffset)
voidsetDashPattern(double[] pattern)Method void QPen::setDashPattern(const QVector<qreal> &pattern)
voidsetJoinStyle(const Qt_PenJoinStyle pcs)Method void QPen::setJoinStyle(Qt::PenJoinStyle pcs)
voidsetMiterLimit(double limit)Method void QPen::setMiterLimit(double limit)
voidsetStyle(const Qt_PenStyle arg1)Method void QPen::setStyle(Qt::PenStyle)
voidsetWidth(int width)Method void QPen::setWidth(int width)
voidsetWidthF(double width)Method void QPen::setWidthF(double width)
[const]Qt_PenStylestyleMethod Qt::PenStyle QPen::style()
voidstyle=(const Qt_PenStyle arg1)Method void QPen::setStyle(Qt::PenStyle)
[const]intwidthMethod int QPen::width()
voidwidth=(int width)Method void QPen::setWidth(int width)
[const]doublewidthFMethod double QPen::widthF()
voidwidthF=(double width)Method void QPen::setWidthF(double width)

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 QPen p)

Description: Method bool QPen::operator!=(const QPen &p)

==

Signature: [const] bool == (const QPen p)

Description: Method bool QPen::operator==(const QPen &p)

_assign

Signature: void _assign (const QPen other)

Description: Assigns another object to self

_const_cast

Signature: [const] QPen ptr _const_cast

Description: Returns a non-const reference to self.

Basically, this method allows turning a const object reference to a non-const one. This method is provided as last resort to remove the constness from an object. Usually there is a good reason for a const object reference, so using this method may have undesired side effects.

This method has been introduced in version 0.29.6.

_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: QPen assign (const QPen pen)

Description: Method QPen &QPen::operator=(const QPen &pen)

brush

Signature: [const] QBrush brush

Description: Method QBrush QPen::brush()

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

brush=

Signature: void brush= (const QBrush brush)

Description: Method void QPen::setBrush(const QBrush &brush)

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

capStyle

Signature: [const] Qt_PenCapStyle capStyle

Description: Method Qt::PenCapStyle QPen::capStyle()

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

capStyle=

Signature: void capStyle= (const Qt_PenCapStyle pcs)

Description: Method void QPen::setCapStyle(Qt::PenCapStyle pcs)

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

color

Signature: [const] QColor color

Description: Method QColor QPen::color()

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

color=

Signature: void color= (const QColor color)

Description: Method void QPen::setColor(const QColor &color)

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

cosmetic

Signature: [const] bool cosmetic

Description: Method bool QPen::isCosmetic()

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

cosmetic=

Signature: void cosmetic= (bool cosmetic)

Description: Method void QPen::setCosmetic(bool cosmetic)

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

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.

dashOffset

Signature: [const] double dashOffset

Description: Method double QPen::dashOffset()

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

dashOffset=

Signature: void dashOffset= (double doffset)

Description: Method void QPen::setDashOffset(double doffset)

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

dashPattern

Signature: [const] double[] dashPattern

Description: Method QVector<qreal> QPen::dashPattern()

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

dashPattern=

Signature: void dashPattern= (double[] pattern)

Description: Method void QPen::setDashPattern(const QVector<qreal> &pattern)

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

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.

dup

Signature: [const] new QPen ptr dup

Description: Creates a copy of self

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

isCosmetic?

Signature: [const] bool isCosmetic?

Description: Method bool QPen::isCosmetic()

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

isDetached?

Signature: bool isDetached?

Description: Method bool QPen::isDetached()

isSolid?

Signature: [const] bool isSolid?

Description: Method bool QPen::isSolid()

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.

joinStyle

Signature: [const] Qt_PenJoinStyle joinStyle

Description: Method Qt::PenJoinStyle QPen::joinStyle()

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

joinStyle=

Signature: void joinStyle= (const Qt_PenJoinStyle pcs)

Description: Method void QPen::setJoinStyle(Qt::PenJoinStyle pcs)

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

miterLimit

Signature: [const] double miterLimit

Description: Method double QPen::miterLimit()

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

miterLimit=

Signature: void miterLimit= (double limit)

Description: Method void QPen::setMiterLimit(double limit)

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

new

(1) Signature: [static] new QPen new

Description: Constructor QPen::QPen()

This method creates an object of class QPen.

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

(2) Signature: [static] new QPen new (const Qt_PenStyle arg1)

Description: Constructor QPen::QPen(Qt::PenStyle)

This method creates an object of class QPen.

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

(3) Signature: [static] new QPen new (const QColor color)

Description: Constructor QPen::QPen(const QColor &color)

This method creates an object of class QPen.

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

(4) Signature: [static] new QPen new (const QBrush brush, double width, const Qt_PenStyle s = Qt::SolidLine, const Qt_PenCapStyle c = Qt::SquareCap, const Qt_PenJoinStyle j = Qt::BevelJoin)

Description: Constructor QPen::QPen(const QBrush &brush, double width, Qt::PenStyle s, Qt::PenCapStyle c, Qt::PenJoinStyle j)

This method creates an object of class QPen.

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

(5) Signature: [static] new QPen new (const QPen pen)

Description: Constructor QPen::QPen(const QPen &pen)

This method creates an object of class QPen.

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

setBrush

Signature: void setBrush (const QBrush brush)

Description: Method void QPen::setBrush(const QBrush &brush)

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

setCapStyle

Signature: void setCapStyle (const Qt_PenCapStyle pcs)

Description: Method void QPen::setCapStyle(Qt::PenCapStyle pcs)

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

setColor

Signature: void setColor (const QColor color)

Description: Method void QPen::setColor(const QColor &color)

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

setCosmetic

Signature: void setCosmetic (bool cosmetic)

Description: Method void QPen::setCosmetic(bool cosmetic)

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

setDashOffset

Signature: void setDashOffset (double doffset)

Description: Method void QPen::setDashOffset(double doffset)

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

setDashPattern

Signature: void setDashPattern (double[] pattern)

Description: Method void QPen::setDashPattern(const QVector<qreal> &pattern)

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

setJoinStyle

Signature: void setJoinStyle (const Qt_PenJoinStyle pcs)

Description: Method void QPen::setJoinStyle(Qt::PenJoinStyle pcs)

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

setMiterLimit

Signature: void setMiterLimit (double limit)

Description: Method void QPen::setMiterLimit(double limit)

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

setStyle

Signature: void setStyle (const Qt_PenStyle arg1)

Description: Method void QPen::setStyle(Qt::PenStyle)

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

setWidth

Signature: void setWidth (int width)

Description: Method void QPen::setWidth(int width)

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

setWidthF

Signature: void setWidthF (double width)

Description: Method void QPen::setWidthF(double width)

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

style

Signature: [const] Qt_PenStyle style

Description: Method Qt::PenStyle QPen::style()

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

style=

Signature: void style= (const Qt_PenStyle arg1)

Description: Method void QPen::setStyle(Qt::PenStyle)

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

width

Signature: [const] int width

Description: Method int QPen::width()

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

width=

Signature: void width= (int width)

Description: Method void QPen::setWidth(int width)

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

widthF

Signature: [const] double widthF

Description: Method double QPen::widthF()

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

widthF=

Signature: void widthF= (double width)

Description: Method void QPen::setWidthF(double width)

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