235 : dashOffset(0), miterLimit(2),
257 : globalStatic(_globalStatic)
281 d = defaultPenInstance();
472 const qreal space = 2;
474 const qreal dash = 4;
487 dd->
dashPattern << dash << space << dot << space << dot << space;
536 qWarning(
"QPen::setDashPattern: Pattern not of even length");
670 qWarning(
"QPen::setWidth: Setting a pen width with a negative value is not defined");
671 if ((
qreal)width ==
d->width)
693 qWarning(
"QPen::setWidthF: Setting a pen width with a negative value is not defined");
694 if (
qAbs(
d->width - width) < 0.00000001f)
725 if (
d->capStyle == c)
755 if (
d->joinStyle == j)
773 return d->brush.color();
843 return (dd->
cosmetic ==
true) ||
d->width == 0;
922 #ifndef QT_NO_DATASTREAM 955 if (
sizeof(
qreal) ==
sizeof(double)) {
963 for (
int i = 0; i < pattern.
size(); ++i)
964 s <<
double(pattern.
at(i));
1013 if (
sizeof(
qreal) ==
sizeof(double)) {
1019 for (
quint32 i = 0; i < numDashes; ++i) {
1021 dashPattern << dash;
1042 #endif //QT_NO_DATASTREAM 1044 #ifndef QT_NO_DEBUG_STREAM 1047 #ifndef Q_BROKEN_DEBUG_STREAM 1048 const char *PEN_STYLES[] = {
1065 qWarning(
"This compiler doesn't support streaming QPen to QDebug");
1085 #undef QT_COMPILING_QPEN The QVariant class acts like a union for the most common Qt data types.
The QDebug class provides an output stream for debugging information.
The QColor class provides colors based on RGB, HSV or CMYK values.
static const Qt::PenCapStyle qpen_default_cap
#define QT_END_NAMESPACE
This macro expands to.
void setBrush(const QBrush &brush)
Sets the brush used to fill strokes generated with this pen to the given brush.
void setCapStyle(Qt::PenCapStyle pcs)
Sets the pen's cap style to the given style.
Qt::PenStyle style() const
Returns the pen style.
QDebug & nospace()
Clears the stream's internal flag that records whether the last character was a space and returns a r...
QDataStream & operator<<(QDataStream &s, const QPen &p)
void detach()
Detaches from shared pen data to make sure that this pen is the only one referring the data...
QColor color() const
Returns the color of this pen's brush.
void setCosmetic(bool cosmetic)
Sets this pen to cosmetic or non-cosmetic, depending on the value of cosmetic.
static Q_DECL_CONSTEXPR bool qFuzzyCompare(double p1, double p2)
Q_DECL_CONSTEXPR T qAbs(const T &t)
The QPen class defines how a QPainter should draw lines and outlines of shapes.
QVector< qreal > dashPattern() const
Returns the dash pattern of this pen.
void setDashPattern(const QVector< qreal > &pattern)
Sets the dash pattern for this pen to the given pattern.
Q_GLOBAL_STATIC_WITH_ARGS(QPenData, defaultPenInstance,(Qt::black, 0, Qt::SolidLine, qpen_default_cap, qpen_default_join)) Q_GLOBAL_STATIC_WITH_ARGS(QPenData
void setColor(const QColor &color)
Sets the color of this pen's brush to the given color.
#define QT_BEGIN_NAMESPACE
This macro expands to.
Qt::PenJoinStyle joinStyle
void clear()
Removes all the elements from the vector and releases the memory used by the vector.
bool isCosmetic() const
Returns true if the pen is cosmetic; otherwise returns false.
Qt::PenJoinStyle joinStyle() const
Returns the pen's join style.
void setDashOffset(qreal doffset)
Sets the dash offset (the starting point on the dash pattern) for this pen to the offset specified...
bool deref()
Atomically decrements the value of this QAtomicInt.
QBasicAtomicPointer< T > pointer
Q_CORE_EXPORT void qWarning(const char *,...)
void setJoinStyle(Qt::PenJoinStyle pcs)
Sets the pen's join style to the given style.
QBrush brush() const
Returns the brush used to fill strokes generated with this pen.
QGlobalStaticDeleter(QGlobalStatic< QPenPrivate > &_globalStatic)
bool operator==(const QPen &p) const
Returns true if the pen is equal to the given pen; otherwise false.
const T & at(int i) const
Returns the item at index position i in the vector.
int version() const
Returns the version number of the data serialization format.
int width() const
Returns the pen width with integer precision.
The QBrush class defines the fill pattern of shapes drawn by QPainter.
QVector< qreal > dashPattern
QPen & operator=(const QPen &pen)
Assigns the given pen to this pen and returns a reference to this pen.
QPen()
Constructs a default black solid line pen with 0 width.
void setWidthF(qreal width)
Sets the pen width to the given width in pixels with floating point precision.
qreal miterLimit() const
Returns the miter limit of the pen.
static const Qt::PenJoinStyle qpen_default_join
qreal widthF() const
Returns the pen width with floating point precision.
void qAtomicAssign(T *&d, T *x)
This is a helper for the assignment operators of implicitly shared classes.
qreal dashOffset() const
Returns the dash offset for the pen.
bool isEmpty() const
Returns true if the vector has size 0; otherwise returns false.
The QDataStream class provides serialization of binary data to a QIODevice.
QPenPrivate(const QBrush &brush, qreal width, Qt::PenStyle, Qt::PenCapStyle, Qt::PenJoinStyle _joinStyle)
Qt::PenCapStyle capStyle() const
Returns the pen's cap style.
QDebug & space()
Writes a space character to the debug stream and returns a reference to the stream.
static qreal dot(const QPointF &a, const QPointF &b)
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
int size() const
Returns the number of items in the vector.
QDataStream & operator>>(QDataStream &s, QPen &p)
Q_DECL_CONSTEXPR int qRound(qreal d)
void setStyle(Qt::PenStyle)
Sets the pen style to the given style.
void setMiterLimit(qreal limit)
Sets the miter limit of this pen to the given limit.
void setWidth(int width)
Sets the pen width to the given width in pixels with integer precision.
bool isSolid() const
Returns true if the pen has a solid fill, otherwise false.
QGlobalStatic< QPenPrivate > & globalStatic