Qt 4.8
|
The QPen class defines how a QPainter should draw lines and outlines of shapes. More...
#include <qpen.h>
Public Types | |
typedef QPenPrivate * | DataPtr |
Public Functions | |
QBrush | brush () const |
Returns the brush used to fill strokes generated with this pen. More... | |
Qt::PenCapStyle | capStyle () const |
Returns the pen's cap style. More... | |
QColor | color () const |
Returns the color of this pen's brush. More... | |
qreal | dashOffset () const |
Returns the dash offset for the pen. More... | |
QVector< qreal > | dashPattern () const |
Returns the dash pattern of this pen. More... | |
DataPtr & | data_ptr () |
bool | isCosmetic () const |
Returns true if the pen is cosmetic; otherwise returns false. More... | |
bool | isDetached () |
bool | isSolid () const |
Returns true if the pen has a solid fill, otherwise false. More... | |
Qt::PenJoinStyle | joinStyle () const |
Returns the pen's join style. More... | |
qreal | miterLimit () const |
Returns the miter limit of the pen. More... | |
operator QVariant () const | |
Returns the pen as a QVariant. More... | |
bool | operator!= (const QPen &p) const |
Returns true if the pen is different from the given pen; otherwise false. More... | |
QPen & | operator= (const QPen &pen) |
Assigns the given pen to this pen and returns a reference to this pen. More... | |
bool | operator== (const QPen &p) const |
Returns true if the pen is equal to the given pen; otherwise false. More... | |
QPen () | |
Constructs a default black solid line pen with 0 width. More... | |
QPen (Qt::PenStyle) | |
Constructs a black pen with 0 width and the given style. More... | |
QPen (const QColor &color) | |
Constructs a solid line pen with 0 width and the given color. More... | |
QPen (const QBrush &brush, qreal width, Qt::PenStyle s=Qt::SolidLine, Qt::PenCapStyle c=Qt::SquareCap, Qt::PenJoinStyle j=Qt::BevelJoin) | |
Constructs a pen with the specified brush, width, pen style, cap style and join style. More... | |
QPen (const QPen &pen) | |
Constructs a pen that is a copy of the given pen. More... | |
void | setBrush (const QBrush &brush) |
Sets the brush used to fill strokes generated with this pen to the given brush. More... | |
void | setCapStyle (Qt::PenCapStyle pcs) |
Sets the pen's cap style to the given style. More... | |
void | setColor (const QColor &color) |
Sets the color of this pen's brush to the given color. More... | |
void | setCosmetic (bool cosmetic) |
Sets this pen to cosmetic or non-cosmetic, depending on the value of cosmetic. More... | |
void | setDashOffset (qreal doffset) |
Sets the dash offset (the starting point on the dash pattern) for this pen to the offset specified. More... | |
void | setDashPattern (const QVector< qreal > &pattern) |
Sets the dash pattern for this pen to the given pattern. More... | |
void | setJoinStyle (Qt::PenJoinStyle pcs) |
Sets the pen's join style to the given style. More... | |
void | setMiterLimit (qreal limit) |
Sets the miter limit of this pen to the given limit. More... | |
void | setStyle (Qt::PenStyle) |
Sets the pen style to the given style. More... | |
void | setWidth (int width) |
Sets the pen width to the given width in pixels with integer precision. More... | |
void | setWidthF (qreal width) |
Sets the pen width to the given width in pixels with floating point precision. More... | |
Qt::PenStyle | style () const |
Returns the pen style. More... | |
void | swap (QPen &other) |
Swaps pen other with this pen. More... | |
int | width () const |
Returns the pen width with integer precision. More... | |
qreal | widthF () const |
Returns the pen width with floating point precision. More... | |
~QPen () | |
Destroys the pen. More... | |
Private Functions | |
void | detach () |
Detaches from shared pen data to make sure that this pen is the only one referring the data. More... | |
Properties | |
class QPenPrivate * | d |
Friends | |
Q_GUI_EXPORT QDataStream & | operator<< (QDataStream &, const QPen &) |
Writes the given pen to the given stream and returns a reference to the stream. More... | |
Q_GUI_EXPORT QDataStream & | operator>> (QDataStream &, QPen &) |
Reads a pen from the given stream into the given pen and returns a reference to the stream. More... | |
The QPen class defines how a QPainter should draw lines and outlines of shapes.
A pen has a style(), width(), brush(), capStyle() and joinStyle().
The pen style defines the line type. The brush is used to fill strokes generated with the pen. Use the QBrush class to specify fill styles. The cap style determines the line end caps that can be drawn using QPainter, while the join style describes how joins between two lines are drawn. The pen width can be specified in both integer (width()) and floating point (widthF()) 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.
The various settings can easily be modified using the corresponding setStyle(), setWidth(), setBrush(), setCapStyle() and setJoinStyle() functions (note that the painter's pen must be reset when altering the pen's properties).
For example:
which is equivalent to
The default pen is a solid black brush with 0 width, square cap style (Qt::SquareCap), and bevel join style (Qt::BevelJoin).
In addition QPen provides the color() and setColor() convenience functions to extract and set the color of the pen's brush, respectively. Pens may also be compared and streamed.
For more information about painting in general, see the Paint System documentation.
Qt provides several built-in styles represented by the Qt::PenStyle enum:
Qt::SolidLine | Qt::DashLine | Qt::DotLine |
Qt::DashDotLine | Qt::DashDotDotLine | Qt::CustomDashLine |
Simply use the setStyle() function to convert the pen style to either of the built-in styles, except the Qt::CustomDashLine style which we will come back to shortly. Setting the style to Qt::NoPen tells the painter to not draw lines or outlines. The default pen style is Qt::SolidLine.
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. The pattern argument, a QVector, must be specified as an even number of qreal entries where the entries 1, 3, 5... are the dashes and 2, 4, 6... are the spaces. For example, the custom pattern shown above is created using the following code:
Note that 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.
The currently set dash pattern can be retrieved using the dashPattern() function. Use the isSolid() function to determine whether the pen has a solid fill, or not.
The cap style defines how the end points of lines are drawn using QPainter. The cap style only apply to wide lines, i.e. when the width is 1 or greater. The Qt::PenCapStyle enum provides the following styles:
Qt::SquareCap | Qt::FlatCap | Qt::RoundCap |
The Qt::SquareCap style is a square line end that covers the end point and extends beyond it by half the line width. The Qt::FlatCap style is a square line end that does not cover the end point of the line. And the Qt::RoundCap style is a rounded line end covering the end point.
The default is Qt::SquareCap.
Whether or not end points are drawn when the pen width is 0 or 1 depends on the cap style. Using Qt::SquareCap or Qt::RoundCap they are drawn, using Qt::FlatCap they are not drawn.
The join style defines how joins between two connected lines can be drawn using QPainter. The join style only apply to wide lines, i.e. when the width is 1 or greater. The Qt::PenJoinStyle enum provides the following styles:
Qt::BevelJoin | Qt::MiterJoin | Qt::RoundJoin |
The Qt::BevelJoin style fills the triangular notch between the two lines. The Qt::MiterJoin style extends the lines to meet at an angle. And the Qt::RoundJoin style fills a circular arc between the two lines.
The default is Qt::BevelJoin.
When the Qt::MiterJoin style is applied, it is possible to use the setMiterLimit() function to specify how far the miter join can extend from the join point. The miterLimit() is used to reduce artifacts between line joins where the lines are close to parallel.
The miterLimit() must be specified in units of the pens 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.
demos/pathstroke{The Path Stroking Demo} The Path Stroking demo shows Qt's built-in dash patterns and shows how custom patterns can be used to extend the range of available patterns. |
qpen_default_join QPen::QPen | ( | ) |
QPen::QPen | ( | Qt::PenStyle | style | ) |
Constructs a black pen with 0 width and the given style.
Definition at line 291 of file qpen.cpp.
QPen::QPen | ( | const QColor & | color | ) |
Constructs a solid line pen with 0 width and the given color.
Definition at line 308 of file qpen.cpp.
QPen::QPen | ( | const QBrush & | brush, |
qreal | width, | ||
Qt::PenStyle | style = Qt::SolidLine , |
||
Qt::PenCapStyle | cap = Qt::SquareCap , |
||
Qt::PenJoinStyle | join = Qt::BevelJoin |
||
) |
Constructs a pen with the specified brush, width, pen style, cap style and join style.
Definition at line 326 of file qpen.cpp.
QPen::QPen | ( | const QPen & | pen | ) |
QBrush QPen::brush | ( | ) | const |
Returns the brush used to fill strokes generated with this pen.
Definition at line 797 of file qpen.cpp.
Referenced by QSvgStrokeStyle::apply(), QRasterPaintEngine::begin(), QTextLine::draw(), QVGPaintEngine::drawCachedGlyphs(), QTextLayout::drawCursor(), QOpenGLPaintEnginePrivate::drawFastRect(), QPaintEngine::drawPoints(), QPaintEngineEx::drawPoints(), QPainterPrivate::drawStretchedGradient(), QEmulationPaintEngine::drawTextItem(), QWin32PrintEngine::drawTextItem(), QCoreGraphicsPaintEngine::drawTextItem(), QPaintEngine::drawTextItem(), QVGPaintEnginePrivate::ensurePen(), is_pen_transparent(), operator<<(), QVGPaintEngine::penChanged(), QPaintEngineState::penNeedsResolving(), QDirectFBPaintEnginePrivate::setPen(), QPainter::setPen(), QEmulationPaintEngine::stroke(), QVGPaintEngine::stroke(), QPaintEngineEx::stroke(), QOpenGLPaintEnginePrivate::strokeLines(), QOpenGLPaintEnginePrivate::strokePath(), QOpenGLPaintEnginePrivate::strokePathFastPen(), QSvgNode::strokeWidth(), QPainterPrivate::updateEmulationSpecifier(), QOpenGLPaintEngine::updatePen(), QRasterPaintEngine::updatePen(), and QOpenGLPaintEnginePrivate::updateUseEmulation().
Qt::PenCapStyle QPen::capStyle | ( | ) | const |
Returns the pen's cap style.
Definition at line 706 of file qpen.cpp.
Referenced by QAlphaPaintEnginePrivate::addPenWidth(), QSvgStrokeStyle::apply(), QPainterPrivate::draw_helper(), QPaintEngine::drawLines(), QVGPaintEngine::drawPoints(), QPaintEngine::drawPoints(), QPaintEngineEx::drawPoints(), QPainter::drawPoints(), QPainterPrivate::drawStretchedGradient(), operator<<(), QSvgPaintEngine::qpenToSvg(), QRasterPaintEnginePrivate::rasterizeLine_dashed(), QPdf::Stroker::setPen(), QPainter::setPen(), QVGPaintEnginePrivate::setPenParams(), QCoreGraphicsPaintEnginePrivate::setStrokePen(), QPaintEngineEx::stroke(), QRasterPaintEngine::stroke(), strokeForPath(), and QX11PaintEngine::updatePen().
QColor QPen::color | ( | ) | const |
Returns the color of this pen's brush.
Definition at line 771 of file qpen.cpp.
Referenced by QPdfEnginePrivate::addBrushPattern(), QDeclarativeTextLayout::draw(), QMacStyle::drawControl(), QDirectFBPaintEngine::drawLines(), QRasterPaintEngine::drawPixmap(), QDirectFBPaintEngine::drawPoints(), QDirectFBPaintEngine::drawRects(), QPainter::drawStaticText(), QPaintEngineEx::drawStaticTextItem(), drawTextItemDecoration(), QGL2PaintEngineExPrivate::drawTexture(), QVGPaintEngine::drawTiledPixmap(), QRasterPaintEngine::drawTiledPixmap(), generateWavyPixmap(), QStaticTextPrivate::get(), hash(), operator<<(), QStaticTextPrivate::paintText(), QSvgPaintEngine::qpenToSvg(), qt_render_bitmap(), QPainter::setPen(), QCoreGraphicsPaintEnginePrivate::setStrokePen(), QPicturePaintEngine::updatePen(), QX11PaintEngine::updatePen(), and QOpenGLPaintEngine::updatePen().
qreal QPen::dashOffset | ( | ) | const |
Returns the dash offset for the pen.
Definition at line 547 of file qpen.cpp.
Referenced by operator<<(), QDashedStrokeProcessor::process(), QSvgPaintEngine::qpenToSvg(), QPdf::Stroker::setPen(), QVGPaintEnginePrivate::setPenParams(), QCoreGraphicsPaintEnginePrivate::setStrokePen(), QPaintEngineEx::stroke(), QRasterPaintEngine::stroke(), strokeForPath(), and QRasterPaintEngine::updatePen().
Returns the dash pattern of this pen.
Definition at line 466 of file qpen.cpp.
Referenced by QSvgStrokeStyle::apply(), QPdf::generateDashes(), operator<<(), QDashedStrokeProcessor::process(), QSvgPaintEngine::qpenToSvg(), QRasterPaintEnginePrivate::rasterizeLine_dashed(), QPdf::Stroker::setPen(), QVGPaintEnginePrivate::setPenParams(), QCoreGraphicsPaintEnginePrivate::setStrokePen(), QPaintEngineEx::stroke(), QRasterPaintEngine::stroke(), strokeForPath(), and QRasterPaintEngine::updatePen().
|
inline |
|
private |
Detaches from shared pen data to make sure that this pen is the only one referring the data.
If multiple pens share common data, this pen dereferences the data and gets a copy of the data. Nothing is done if there is just a single reference.
Definition at line 370 of file qpen.cpp.
Referenced by operator>>().
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; pens with a non-zero width are non-cosmetic.
Definition at line 840 of file qpen.cpp.
Referenced by QAlphaPaintEnginePrivate::addPenWidth(), QPaintEngine::drawPoints(), QPaintBufferEngine::penChanged(), QTriangulatingStroker::process(), QDashedStrokeProcessor::process(), QDirectFBPaintEnginePrivate::setPen(), QPdf::Stroker::setPen(), QVGPaintEnginePrivate::setPenParams(), QGL2PaintEngineEx::stroke(), QPaintEngineEx::stroke(), QRasterPaintEngine::stroke(), QGL2PaintEngineExPrivate::stroke(), QOpenGLPaintEnginePrivate::strokePath(), QSvgNode::strokeWidth(), QOpenGLPaintEngine::updatePen(), and QRasterPaintEngine::updatePen().
bool QPen::isDetached | ( | ) |
bool QPen::isSolid | ( | ) | const |
Returns true if the pen has a solid fill, otherwise false.
Definition at line 820 of file qpen.cpp.
Referenced by QPainterPrivate::updateEmulationSpecifier().
Qt::PenJoinStyle QPen::joinStyle | ( | ) | const |
Returns the pen's join style.
Definition at line 736 of file qpen.cpp.
Referenced by QAlphaPaintEnginePrivate::addPenWidth(), QSvgStrokeStyle::apply(), QPainterPrivate::draw_helper(), QPainterPrivate::drawStretchedGradient(), operator<<(), QSvgPaintEngine::qpenToSvg(), QPdf::Stroker::setPen(), QPainter::setPen(), QVGPaintEnginePrivate::setPenParams(), QCoreGraphicsPaintEnginePrivate::setStrokePen(), QPaintEngineEx::stroke(), QGL2PaintEngineExPrivate::stroke(), strokeForPath(), and QX11PaintEngine::updatePen().
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.
Definition at line 589 of file qpen.cpp.
Referenced by QSvgStrokeStyle::apply(), QPainterPrivate::drawStretchedGradient(), operator<<(), QTriangulatingStroker::process(), QDashedStrokeProcessor::process(), QSvgPaintEngine::qpenToSvg(), QPdf::Stroker::setPen(), QVGPaintEnginePrivate::setPenParams(), QPaintEngineEx::stroke(), QGL2PaintEngineExPrivate::stroke(), strokeForPath(), and QRasterPaintEngine::updatePen().
QPen::operator QVariant | ( | ) | const |
Returns the pen as a QVariant.
Definition at line 413 of file qpen.cpp.
|
inline |
Returns true if the pen is different from the given pen; otherwise false.
Two pens are different if they have different styles, widths or colors.
Definition at line 119 of file qpen.h.
Assigns the given pen to this pen and returns a reference to this pen.
Definition at line 393 of file qpen.cpp.
bool QPen::operator== | ( | const QPen & | pen | ) | const |
Returns true if the pen is equal to the given pen; otherwise false.
Two pens are equal if they have equal styles, widths and colors.
Definition at line 889 of file qpen.cpp.
void QPen::setBrush | ( | const QBrush & | brush | ) |
Sets the brush used to fill strokes generated with this pen to the given brush.
Definition at line 808 of file qpen.cpp.
Referenced by QSvgStrokeStyle::apply(), QPainterPrivate::drawStretchedGradient(), QEmulationPaintEngine::drawTextItem(), QGraphicsSimpleTextItem::paint(), and QEmulationPaintEngine::stroke().
void QPen::setCapStyle | ( | Qt::PenCapStyle | style | ) |
Sets the pen's cap style to the given style.
The default value is Qt::SquareCap.
Definition at line 723 of file qpen.cpp.
Referenced by QSvgStrokeStyle::apply(), QWindowsMobileStyle::drawComplexControl(), QWindowsMobileStyle::drawControl(), QVGPaintEngine::drawPoints(), QPaintEngineEx::drawPoints(), QPainter::drawPoints(), QWindowsMobileStyle::drawPrimitive(), QWindowsMobileStylePrivate::drawTabBarTab(), drawTabCloseButton(), drawTextItemDecoration(), generateWavyPixmap(), and qDrawRoundedCorners().
void QPen::setColor | ( | const QColor & | color | ) |
Sets the color of this pen's brush to the given color.
Definition at line 787 of file qpen.cpp.
Referenced by QSvgAnimateColor::apply(), QmlJSDebugger::BoundingBoxPolygonItem::BoundingBoxPolygonItem(), drawTabCloseButton(), and drawTextItemDecoration().
void QPen::setCosmetic | ( | bool | cosmetic | ) |
Sets this pen to cosmetic or non-cosmetic, depending on the value of cosmetic.
Definition at line 854 of file qpen.cpp.
Referenced by QSvgStrokeStyle::apply(), and QPainterPrivate::updateState().
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. |
Definition at line 570 of file qpen.cpp.
Referenced by QSvgStrokeStyle::apply().
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.
Definition at line 525 of file qpen.cpp.
Referenced by QSvgStrokeStyle::apply(), and QSvgStrokeStyle::setDashArray().
void QPen::setJoinStyle | ( | Qt::PenJoinStyle | style | ) |
Sets the pen's join style to the given style.
The default value is Qt::BevelJoin.
Definition at line 753 of file qpen.cpp.
Referenced by QSvgStrokeStyle::apply(), QDeclarativeRectangle::drawRect(), and QDeclarativeRectangle::generateBorderedRect().
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.
Definition at line 611 of file qpen.cpp.
Referenced by QSvgStrokeStyle::apply(), QSvgTinyDocument::draw(), QSvgHandler::init(), and QSvgNode::transformedBounds().
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.
Definition at line 450 of file qpen.cpp.
Referenced by QSvgStrokeStyle::apply(), drawTextItemDecoration(), QEmulationPaintEngine::stroke(), and QRasterPaintEngine::updatePen().
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.
Definition at line 667 of file qpen.cpp.
Referenced by QmlJSDebugger::BoundingBoxPolygonItem::BoundingBoxPolygonItem(), QWindowsMobileStyle::drawComplexControl(), QCommonStyle::drawControl(), QWindowsMobileStyle::drawControl(), QMacStyle::drawControl(), QWindowsMobileStyle::drawPrimitive(), QWindowsMobileStylePrivate::drawTabBarTab(), generateWavyPixmap(), and QPainterPrivate::updateState().
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.
Definition at line 690 of file qpen.cpp.
Referenced by QSvgStrokeStyle::apply(), QFontEngineBox::boundingBox(), QSvgFont::draw(), QPaintEnginePrivate::drawBoxTextItem(), drawTabCloseButton(), drawTextItemDecoration(), and QOpenGLPaintEnginePrivate::strokePath().
Qt::PenStyle QPen::style | ( | ) | const |
Returns the pen style.
Definition at line 428 of file qpen.cpp.
Referenced by QAlphaPaintEnginePrivate::addPenWidth(), QSvgStrokeStyle::apply(), QTextLine::draw(), QPainterPrivate::draw_helper(), QDirectFBPaintEngine::drawLines(), QPainterPrivate::drawOpaqueBackground(), QDirectFBPaintEngine::drawPoints(), QVGPaintEngine::drawPoints(), QDirectFBPaintEngine::drawRects(), QPainter::drawStaticText(), QPainterPrivate::drawStretchedGradient(), QPainter::drawText(), QRasterPaintEngine::ensurePen(), is_pen_transparent(), operator<<(), QVGPaintEngine::penChanged(), QPaintBufferEngine::penChanged(), QSvgPaintEngine::qpenToSvg(), QPainterPrivate::rectSubtraction(), QDirectFBPaintEnginePrivate::setPen(), QPdf::Stroker::setPen(), QPainter::setPen(), QVGPaintEnginePrivate::setPenParams(), QCoreGraphicsPaintEnginePrivate::setStrokePen(), QEmulationPaintEngine::stroke(), QVGPaintEnginePrivate::stroke(), QPaintEngineEx::stroke(), strokeForPath(), QSvgNode::strokeWidth(), QPicturePaintEngine::updatePen(), QX11PaintEngine::updatePen(), and QOpenGLPaintEngine::updatePen().
|
inline |
int QPen::width | ( | ) | const |
Returns the pen width with integer precision.
Definition at line 630 of file qpen.cpp.
Referenced by QPainterPrivate::drawOpaqueBackground(), operator<<(), QSvgPaintEngine::qpenToSvg(), QPainterPrivate::rectSubtraction(), QPicturePaintEngine::updatePen(), and QPicturePaintEngine::writeCmdLength().
qreal QPen::widthF | ( | ) | const |
Returns the pen width with floating point precision.
Definition at line 645 of file qpen.cpp.
Referenced by QAlphaPaintEnginePrivate::addPenWidth(), QSvgStrokeStyle::apply(), QGraphicsPathItem::boundingRect(), QGraphicsRectItem::boundingRect(), QGraphicsEllipseItem::boundingRect(), QGraphicsPolygonItem::boundingRect(), QSvgArc::draw(), QSvgFont::draw(), QSvgLine::draw(), QSvgPolyline::draw(), QPainterPrivate::draw_helper(), QCleanlooksStyle::drawItemText(), QStyle::drawItemText(), QPaintEngine::drawPoints(), QPainterPrivate::drawStretchedGradient(), drawTextItemDecoration(), QPdf::generateDashes(), generateWavyPixmap(), QRasterPaintEnginePrivate::getPenFunc(), hash(), operator<<(), QPaintBufferEngine::penChanged(), QSvgPaintEngine::qpenToSvg(), QSvgStrokeStyle::setDashArray(), QDirectFBPaintEnginePrivate::setPen(), QPdf::Stroker::setPen(), QVGPaintEnginePrivate::setPenParams(), QCoreGraphicsPaintEnginePrivate::setStrokePen(), QPaintEngineEx::stroke(), strokeForPath(), QOpenGLPaintEnginePrivate::strokeLines(), QOpenGLPaintEnginePrivate::strokePath(), QSvgNode::strokeWidth(), QX11PaintEngine::updatePen(), QOpenGLPaintEngine::updatePen(), and QPainterPrivate::updateState().
|
friend |
Writes the given pen to the given stream and returns a reference to the stream.
Definition at line 936 of file qpen.cpp.
|
friend |
Reads a pen from the given stream into the given pen and returns a reference to the stream.
Definition at line 985 of file qpen.cpp.
|
private |
Definition at line 128 of file qpen.h.
Referenced by operator<<(), operator=(), operator==(), operator>>(), QPen(), and swap().