Skip to content

PythonQt.QtGui.QPen · declarations 001

Back to PythonQt.QtGui.QPen

brush

brush() -> Any

X.brush() -> PythonQt.QtGui.QBrush

Supplemental documentation: Qt 5 reference:

QBrush QPen::brush() const

Returns the brush used to fill strokes generated with this pen.

See also setBrush().

Upstream PySide2 reference signatures (binding differences may apply):

brush(self) -> PySide2.QtGui.QBrush

Source: https://doc.qt.io/archives/qt-5.15/qpen.html#brush

capStyle

capStyle() -> Any

X.capStyle()

Supplemental documentation: Qt 5 reference:

Qt::PenCapStyle QPen::capStyle() const

Returns the pen's cap style.

See also setCapStyle() and Cap Style.

Upstream PySide2 reference signatures (binding differences may apply):

capStyle(self) -> PySide2.QtCore.Qt.PenCapStyle

Source: https://doc.qt.io/archives/qt-5.15/qpen.html#capStyle

color

color() -> Any

X.color() -> PythonQt.QtGui.QColor

Supplemental documentation: Qt 5 reference:

QColor QPen::color() const

Returns the color of this pen's brush.

See also brush() and setColor().

Upstream PySide2 reference signatures (binding differences may apply):

color(self) -> PySide2.QtGui.QColor

Source: https://doc.qt.io/archives/qt-5.15/qpen.html#color

dashOffset

dashOffset() -> float

X.dashOffset() -> float

Supplemental documentation: Qt 5 reference:

qreal QPen::dashOffset() const

Returns the dash offset for the pen.

See also setDashOffset().

Upstream PySide2 reference signatures (binding differences may apply):

dashOffset(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qpen.html#dashOffset

dashPattern

dashPattern() -> tuple

X.dashPattern() -> tuple

Supplemental documentation: Qt 5 reference:

QVector\<qreal> QPen::dashPattern() const

Returns the dash pattern of this pen.

See also setDashPattern(), style(), and isSolid().

Upstream PySide2 reference signatures (binding differences may apply):

dashPattern(self) -> typing.List[float]

Source: https://doc.qt.io/archives/qt-5.15/qpen.html#dashPattern

isCosmetic

isCosmetic() -> bool

X.isCosmetic() -> bool

Supplemental documentation: Qt 5 reference:

bool QPen::isCosmetic() const

Returns true if the pen is cosmetic; otherwise returns false.

Cosmetic pens are used to draw strokes that have a constant width regardless of any transformations applied to the QPainter they are used with. Drawing a shape with a cosmetic pen ensures that its outline will have the same thickness at different scale factors.

A zero width pen is cosmetic by default.

See also setCosmetic() and widthF().

Upstream PySide2 reference signatures (binding differences may apply):

isCosmetic(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qpen.html#isCosmetic

isSolid

isSolid() -> bool

X.isSolid() -> bool

Supplemental documentation: Qt 5 reference:

bool QPen::isSolid() const

Returns true if the pen has a solid fill, otherwise false.

See also style() and dashPattern().

Upstream PySide2 reference signatures (binding differences may apply):

isSolid(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qpen.html#isSolid

joinStyle

joinStyle() -> Any

X.joinStyle()

Supplemental documentation: Qt 5 reference:

Qt::PenJoinStyle QPen::joinStyle() const

Returns the pen's join style.

See also setJoinStyle() and Join Style.

Upstream PySide2 reference signatures (binding differences may apply):

joinStyle(self) -> PySide2.QtCore.Qt.PenJoinStyle

Source: https://doc.qt.io/archives/qt-5.15/qpen.html#joinStyle

miterLimit

miterLimit() -> float

X.miterLimit() -> float

Supplemental documentation: Qt 5 reference:

qreal QPen::miterLimit() const

Returns the miter limit of the pen. The miter limit is only relevant when the join style is set to Qt::MiterJoin.

See also setMiterLimit() and Join Style.

Upstream PySide2 reference signatures (binding differences may apply):

miterLimit(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qpen.html#miterLimit

setBrush

setBrush(brush: Any) -> None

X.setBrush(brush)

Supplemental documentation: Qt 5 reference:

void QPen::setBrush(const QBrush \&brush)

Sets the brush used to fill strokes generated with this pen to the given brush.

See also brush() and setColor().

Upstream PySide2 reference signatures (binding differences may apply):

setBrush(self, brush: PySide2.QtGui.QBrush) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpen.html#setBrush

setCapStyle

setCapStyle(pcs: Any) -> None

X.setCapStyle(pcs)

Supplemental documentation: Qt 5 reference:

void QPen::setCapStyle(Qt::PenCapStyle style)

Sets the pen's cap style to the given style. The default value is Qt::SquareCap.

See also capStyle() and Cap Style.

Upstream PySide2 reference signatures (binding differences may apply):

setCapStyle(self, pcs: PySide2.QtCore.Qt.PenCapStyle) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpen.html#setCapStyle

setColor

setColor(color: Any) -> None

X.setColor(color)

Supplemental documentation: Qt 5 reference:

void QPen::setColor(const QColor \&color)

Sets the color of this pen's brush to the given color.

See also setBrush() and color().

Upstream PySide2 reference signatures (binding differences may apply):

setColor(self, color: PySide2.QtGui.QColor) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpen.html#setColor

setCosmetic

setCosmetic(cosmetic: bool) -> None

X.setCosmetic(cosmetic)

Supplemental documentation: Qt 5 reference:

void QPen::setCosmetic(bool cosmetic)

Sets this pen to cosmetic or non-cosmetic, depending on the value of cosmetic.

See also isCosmetic().

Upstream PySide2 reference signatures (binding differences may apply):

setCosmetic(self, cosmetic: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpen.html#setCosmetic

setDashOffset

setDashOffset(doffset: float) -> None

X.setDashOffset(doffset)

Supplemental documentation: Qt 5 reference:

void QPen::setDashOffset(qreal offset)

Sets the dash offset (the starting point on the dash pattern) for this pen to the offset specified. The offset is measured in terms of the units used to specify the dash pattern.

For example, a pattern where each stroke is four units long, followed by a gap of two units, will begin with the stroke when drawn as a line. However, if the dash offset is set to 4.0, any line drawn will begin with the gap. Values of the offset up to 4.0 will cause part of the stroke to be drawn first, and values of the offset between 4.0 and 6.0 will cause the line to begin with part of the gap.

Note: This implicitly converts the style of the pen to Qt::CustomDashLine.

See also dashOffset().

Upstream PySide2 reference signatures (binding differences may apply):

setDashOffset(self, doffset: float) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpen.html#setDashOffset

setDashPattern

setDashPattern(pattern: Any) -> None

X.setDashPattern(pattern)

Supplemental documentation: Qt 5 reference:

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

Sets the dash pattern for this pen to the given pattern. This implicitly converts the style of the pen to Qt::CustomDashLine.

The pattern must be specified as an even number of positive entries where the entries 1, 3, 5... are the dashes and 2, 4, 6... are the spaces. For example:

QPen pen; QVector<qreal> dashes; qreal space = 4; dashes << 1 << space << 3 << space << 9 << space << 27 << space << 9 << space; pen.setDashPattern(dashes);

The dash pattern is specified in units of the pens width; e.g. a dash of length 5 in width 10 is 50 pixels long. Note that a pen with zero width is equivalent to a cosmetic pen with a width of 1 pixel.

Each dash is also subject to cap styles so a dash of 1 with square cap set will extend 0.5 pixels out in each direction resulting in a total width of 2.

Note that the default cap style is Qt::SquareCap, meaning that a square line end covers the end point and extends beyond it by half the line width.

See also setStyle(), dashPattern(), setCapStyle(), and setCosmetic().

Upstream PySide2 reference signatures (binding differences may apply):

setDashPattern(self, pattern: typing.List[float]) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpen.html#setDashPattern

setJoinStyle

setJoinStyle(pcs: Any) -> None

X.setJoinStyle(pcs)

Supplemental documentation: Qt 5 reference:

void QPen::setJoinStyle(Qt::PenJoinStyle style)

Sets the pen's join style to the given style. The default value is Qt::BevelJoin.

See also joinStyle() and Join Style.

Upstream PySide2 reference signatures (binding differences may apply):

setJoinStyle(self, pcs: PySide2.QtCore.Qt.PenJoinStyle) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpen.html#setJoinStyle

setMiterLimit

setMiterLimit(limit: float) -> None

X.setMiterLimit(limit)

Supplemental documentation: Qt 5 reference:

void QPen::setMiterLimit(qreal limit)

Sets the miter limit of this pen to the given limit.

The miter limit describes how far a miter join can extend from the join point. This is used to reduce artifacts between line joins where the lines are close to parallel.

This value does only have effect when the pen style is set to Qt::MiterJoin. The value is specified in units of the pen's width, e.g. a miter limit of 5 in width 10 is 50 pixels long. The default miter limit is 2, i.e. twice the pen width in pixels.

See also miterLimit(), setJoinStyle(), and Join Style.

Upstream PySide2 reference signatures (binding differences may apply):

setMiterLimit(self, limit: float) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpen.html#setMiterLimit

setStyle

setStyle(arg__1: Any) -> None

X.setStyle(arg__1)

Supplemental documentation: Qt 5 reference:

void QPen::setStyle(Qt::PenStyle style)

Sets the pen style to the given style.

See the Qt::PenStyle documentation for a list of the available styles. Since Qt 4.1 it is also possible to specify a custom dash pattern using the setDashPattern() function which implicitly converts the style of the pen to Qt::CustomDashLine.

Note: This function resets the dash offset to zero.

See also style() and Pen Style.

Upstream PySide2 reference signatures (binding differences may apply):

setStyle(self, arg__1: PySide2.QtCore.Qt.PenStyle) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpen.html#setStyle

setWidth

setWidth(width: int) -> None

X.setWidth(width)

Supplemental documentation: Qt 5 reference:

void QPen::setWidth(int width)

Sets the pen width to the given width in pixels with integer precision.

A line width of zero indicates a cosmetic pen. This means that the pen width is always drawn one pixel wide, independent of the transformation set on the painter.

Setting a pen width with a negative value is not supported.

See also setWidthF() and width().

Upstream PySide2 reference signatures (binding differences may apply):

setWidth(self, width: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpen.html#setWidth

setWidthF

setWidthF(width: float) -> None

X.setWidthF(width)

Supplemental documentation: Qt 5 reference:

void QPen::setWidthF(qreal width)

Sets the pen width to the given width in pixels with floating point precision.

A line width of zero indicates a cosmetic pen. This means that the pen width is always drawn one pixel wide, independent of the transformation on the painter.

Setting a pen width with a negative value is not supported.

See also setWidth() and widthF().

Upstream PySide2 reference signatures (binding differences may apply):

setWidthF(self, width: float) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpen.html#setWidthF

style

style() -> Any

X.style()

Supplemental documentation: Qt 5 reference:

Qt::PenStyle QPen::style() const

Returns the pen style.

See also setStyle() and Pen Style.

Upstream PySide2 reference signatures (binding differences may apply):

style(self) -> PySide2.QtCore.Qt.PenStyle

Source: https://doc.qt.io/archives/qt-5.15/qpen.html#style

swap

swap(other: Any) -> None

X.swap(other)

Supplemental documentation: Qt 5 reference:

void QPen::swap(QPen \&other)

Swaps pen other with this pen. This operation is very fast and never fails.

This function was introduced in Qt 4.8.

Upstream PySide2 reference signatures (binding differences may apply):

swap(self, other: PySide2.QtGui.QPen) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpen.html#swap

width

width() -> int

X.width() -> int

Supplemental documentation: Qt 5 reference:

int QPen::width() const

Returns the pen width with integer precision.

See also setWidth() and widthF().

Upstream PySide2 reference signatures (binding differences may apply):

width(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qpen.html#width

widthF

widthF() -> float

X.widthF() -> float

Supplemental documentation: Qt 5 reference:

qreal QPen::widthF() const

Returns the pen width with floating point precision.

See also setWidthF() and width().

Upstream PySide2 reference signatures (binding differences may apply):

widthF(self) -> float

Source: https://doc.qt.io/archives/qt-5.15/qpen.html#widthF