KDStateMachineEditor API Documentation
2.1
Loading...
Searching...
No Matches
src
view
quick
quickpen.cpp
Go to the documentation of this file.
1
/*
2
This file is part of the KDAB State Machine Editor Library.
3
4
SPDX-FileCopyrightText: 2014 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
5
Author: Kevin Funk <kevin.funk@kdab.com>
6
7
SPDX-License-Identifier: LGPL-2.1-only OR LicenseRef-KDAB-KDStateMachineEditor
8
9
Licensees holding valid commercial KDAB State Machine Editor Library
10
licenses may use this file in accordance with the KDAB State Machine Editor
11
Library License Agreement provided with the Software.
12
13
Contact info@kdab.com if any conditions of this licensing are not clear to you.
14
*/
15
16
#include "
quickpen_p.h
"
17
18
#include <QPen>
19
20
QuickPen::QuickPen
(QObject *parent)
21
: QObject(parent)
22
, m_width(0.0)
23
, m_color(Qt::black)
24
, m_style(Qt::SolidLine)
25
{
26
}
27
28
void
QuickPen::modifyPen
(QPen *pen)
const
29
{
30
Q_ASSERT(pen);
31
pen->setWidthF(m_width);
32
pen->setColor(m_color);
33
pen->setStyle(m_style);
34
}
35
36
QPen
QuickPen::toQPen
()
const
37
{
38
QPen pen;
39
modifyPen
(&pen);
40
return
pen;
41
}
42
43
qreal
QuickPen::width
()
const
44
{
45
return
m_width;
46
}
47
48
void
QuickPen::setWidth
(qreal width)
49
{
50
m_width =
width
;
51
Q_EMIT
penChanged
();
52
}
53
54
QColor
QuickPen::color
()
const
55
{
56
return
m_color;
57
}
58
59
void
QuickPen::setColor
(
const
QColor &color)
60
{
61
m_color =
color
;
62
Q_EMIT
penChanged
();
63
}
64
65
Qt::PenStyle
QuickPen::style
()
const
66
{
67
return
m_style;
68
}
69
70
void
QuickPen::setStyle
(Qt::PenStyle style)
71
{
72
m_style =
style
;
73
Q_EMIT
penChanged
();
74
}
QuickPen::setWidth
void setWidth(qreal width)
Definition
quickpen.cpp:48
QuickPen::width
qreal width
Definition
quickpen_p.h:35
QuickPen::QuickPen
QuickPen(QObject *parent=nullptr)
Definition
quickpen.cpp:20
QuickPen::toQPen
QPen toQPen() const
Definition
quickpen.cpp:36
QuickPen::color
QColor color
Definition
quickpen_p.h:36
QuickPen::modifyPen
void modifyPen(QPen *pen) const
Definition
quickpen.cpp:28
QuickPen::setStyle
void setStyle(Qt::PenStyle style)
Definition
quickpen.cpp:70
QuickPen::style
Qt::PenStyle style
Definition
quickpen_p.h:37
QuickPen::setColor
void setColor(const QColor &color)
Definition
quickpen.cpp:59
QuickPen::penChanged
void penChanged()
quickpen_p.h
© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDStateMachineEditor
Create Qt State Machine metacode using a graphical user interface
https://github.com/KDAB/KDStateMachineEditor
Generated on Tue Jul 15 2025 15:21:47 for KDStateMachineEditor API Documentation by doxygen 1.9.8