1// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "qlinewidth.h"
5#include "qlinewidth_p.h"
6
7QT_BEGIN_NAMESPACE
8
9namespace Qt3DRender {
10
11/*!
12 \class Qt3DRender::QLineWidth
13 \inmodule Qt3DRender
14 \since 5.10
15 \brief Specifies the width of rasterized lines.
16 */
17
18/*!
19 \qmltype LineWidth
20 \since 5.10
21 \inherits RenderState
22 \instantiates Qt3DRender::QLineWidth
23 \inqmlmodule Qt3D.Render
24
25 \brief Specifies the width of rasterized lines.
26 */
27
28/*!
29 \qmlproperty real LineWidth::value
30 Specifies the width value to be used.
31*/
32
33/*!
34 \property QLineWidth::value
35 Specifies the width value to be used.
36*/
37
38QLineWidth::QLineWidth(Qt3DCore::QNode *parent)
39 : QRenderState(*new QLineWidthPrivate(1.0f), parent)
40{
41}
42
43QLineWidth::~QLineWidth()
44{
45}
46
47float QLineWidth::value() const
48{
49 Q_D(const QLineWidth);
50 return d->m_value;
51}
52
53void QLineWidth::setValue(float width)
54{
55 Q_D(QLineWidth);
56 d->m_value = width;
57 emit valueChanged(value: width);
58}
59
60bool QLineWidth::smooth() const
61{
62 Q_D(const QLineWidth);
63 return d->m_smooth;
64}
65
66void QLineWidth::setSmooth(bool enabled)
67{
68 Q_D(QLineWidth);
69 if (d->m_smooth != enabled) {
70 d->m_smooth = enabled;
71 emit smoothChanged(enabled);
72 }
73}
74
75} // namespace Qt3DRender
76
77QT_END_NAMESPACE
78
79#include "moc_qlinewidth.cpp"
80

source code of qt3d/src/render/renderstates/qlinewidth.cpp