Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qpen.h
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
// Qt-Security score:significant reason:default
4
5
#
ifndef
QPEN_H
6
#
define
QPEN_H
7
8
#
include
<
QtCore
/
qshareddata
.
h
>
9
#
include
<
QtGui
/
qtguiglobal
.
h
>
10
#
include
<
QtGui
/
qcolor
.
h
>
11
#
include
<
QtGui
/
qbrush
.
h
>
12
13
QT_BEGIN_NAMESPACE
14
15
16
class
QVariant;
17
class
QPenPrivate
;
18
class
QBrush;
19
class
QPen;
20
21
#
ifndef
QT_NO_DATASTREAM
22
Q_GUI_EXPORT
QDataStream
&operator<<(QDataStream &,
const
QPen &);
23
Q_GUI_EXPORT
QDataStream
&operator>>(QDataStream &, QPen &);
24
#
endif
25
26
QT_DECLARE_QESDP_SPECIALIZATION_DTOR_WITH_EXPORT(
QPenPrivate
, Q_GUI_EXPORT)
27
28
class
Q_GUI_EXPORT
QPen
29
{
30
public
:
31
QPen();
32
QPen(Qt::PenStyle);
33
QPen(
const
QColor &color);
34
QPen(
const
QBrush &brush, qreal width, Qt::PenStyle s = Qt::SolidLine,
35
Qt::PenCapStyle c = Qt::SquareCap, Qt::PenJoinStyle j = Qt::BevelJoin);
36
QPen(
const
QPen &pen)
noexcept
;
37
38
~QPen();
39
40
QPen &operator=(
const
QPen &pen)
noexcept
;
41
QPen(QPen &&other)
noexcept
=
default
;
42
QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QPen)
43
void
swap(QPen &other)
noexcept
{ d.swap(other.d); }
44
45
QPen &operator=(QColor color);
46
QPen &operator=(Qt::PenStyle style);
47
48
Qt::PenStyle style()
const
;
49
void
setStyle(Qt::PenStyle);
50
51
QList<qreal> dashPattern()
const
;
52
void
setDashPattern(
const
QList<qreal> &pattern);
53
54
qreal dashOffset()
const
;
55
void
setDashOffset(qreal doffset);
56
57
qreal miterLimit()
const
;
58
void
setMiterLimit(qreal limit);
59
60
qreal widthF()
const
;
61
void
setWidthF(qreal width);
62
63
int
width()
const
;
64
void
setWidth(
int
width);
65
66
QColor color()
const
;
67
void
setColor(
const
QColor &color);
68
69
QBrush brush()
const
;
70
void
setBrush(
const
QBrush &brush);
71
72
bool
isSolid()
const
;
73
74
Qt::PenCapStyle capStyle()
const
;
75
void
setCapStyle(Qt::PenCapStyle pcs);
76
77
Qt::PenJoinStyle joinStyle()
const
;
78
void
setJoinStyle(Qt::PenJoinStyle pcs);
79
80
bool
isCosmetic()
const
;
81
void
setCosmetic(
bool
cosmetic);
82
83
bool
operator==(
const
QPen &p)
const
;
84
inline
bool
operator!=(
const
QPen &p)
const
{
return
!(operator==(p)); }
85
operator QVariant()
const
;
86
87
bool
isDetached();
88
89
private
:
90
friend
Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QPen &);
91
friend
Q_GUI_EXPORT QDataStream &operator<<(QDataStream &,
const
QPen &);
92
93
bool
isSolidDefaultLine()
const
noexcept
;
94
95
bool
doCompareEqualColor(QColor rhs)
const
noexcept
;
96
friend
bool
comparesEqual(
const
QPen &lhs, QColor rhs)
noexcept
97
{
98
return
lhs.doCompareEqualColor(rhs);
99
}
100
Q_DECLARE_EQUALITY_COMPARABLE(QPen, QColor)
101
102
bool
doCompareEqualStyle(Qt::PenStyle rhs)
const
;
103
friend
bool
comparesEqual(
const
QPen &lhs, Qt::PenStyle rhs)
104
{
105
return
lhs.doCompareEqualStyle(rhs);
106
}
107
Q_DECLARE_EQUALITY_COMPARABLE_NON_NOEXCEPT(QPen, Qt::PenStyle)
108
109
public
:
110
using
DataPtr = QExplicitlySharedDataPointer<QPenPrivate>;
111
112
private
:
113
void
detach();
114
DataPtr d;
115
116
public
:
117
inline
DataPtr &data_ptr() {
return
d; }
118
};
119
120
Q_DECLARE_SHARED
(
QPen
)
121
122
#
ifndef
QT_NO_DEBUG_STREAM
123
Q_GUI_EXPORT
QDebug
operator<<(QDebug,
const
QPen &);
124
#
endif
125
126
QT_END_NAMESPACE
127
128
#
endif
// QPEN_H
QBrush
\inmodule QtGui
Definition
qbrush.h:30
QConicalGradient
\inmodule QtGui
Definition
qbrush.h:469
QDataStream
\inmodule QtCore\reentrant
Definition
qdatastream.h:50
QGradient
\inmodule QtGui
Definition
qbrush.h:158
QLinearGradient
\inmodule QtGui
Definition
qbrush.h:417
QPenPrivate
Definition
qpen_p.h:29
QPen
\inmodule QtGui
Definition
qpen.h:29
QRadialGradient
\inmodule QtGui
Definition
qbrush.h:435
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
QGradientStops
QList< QGradientStop > QGradientStops
Definition
qbrush.h:155
QGradientStop
std::pair< qreal, QColor > QGradientStop
Definition
qbrush.h:154
operator<<
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)
Definition
qdir.cpp:2620
qRegisterGuiVariant
void qRegisterGuiVariant()
Definition
qguivariant.cpp:138
QBrushDataPointerDeleter
Definition
qbrush.h:25
QBrushDataPointerDeleter::operator()
void operator()(QBrushData *d) const noexcept
Definition
qbrush.cpp:251
QBrushData
Definition
qbrush.h:133
QBrushData::style
Qt::BrushStyle style
Definition
qbrush.h:135
QBrushData::QBrushData
QBrushData()=default
QBrushData::transform
QTransform transform
Definition
qbrush.h:137
QBrushData::ref
QAtomicInt ref
Definition
qbrush.h:134
QBrushData::color
QColor color
Definition
qbrush.h:136
QT_BEGIN_NAMESPACE::QVariantGuiHelper
Definition
qguivariant.cpp:57
QT_BEGIN_NAMESPACE::QVariantGuiHelper::interfaceForType
static const QtPrivate::QMetaTypeInterface * interfaceForType(int type)
Definition
qguivariant.cpp:61
QT_BEGIN_NAMESPACE::QVariantGuiHelper::convert
static bool convert(const void *from, int fromTypeId, void *to, int toTypeId)
Definition
qguivariant.cpp:70
qtbase
src
gui
painting
qpen.h
Generated on
for Qt by
1.18.0