| 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 | |
| 7 | QT_BEGIN_NAMESPACE |
| 8 | |
| 9 | namespace 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 | \nativetype 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 Qt3DRender::QLineWidth::value |
| 35 | Specifies the width value to be used. |
| 36 | */ |
| 37 | |
| 38 | QLineWidth::QLineWidth(Qt3DCore::QNode *parent) |
| 39 | : QRenderState(*new QLineWidthPrivate(1.0f), parent) |
| 40 | { |
| 41 | } |
| 42 | |
| 43 | QLineWidth::~QLineWidth() |
| 44 | { |
| 45 | } |
| 46 | |
| 47 | float QLineWidth::value() const |
| 48 | { |
| 49 | Q_D(const QLineWidth); |
| 50 | return d->m_value; |
| 51 | } |
| 52 | |
| 53 | void QLineWidth::setValue(float width) |
| 54 | { |
| 55 | Q_D(QLineWidth); |
| 56 | d->m_value = width; |
| 57 | emit valueChanged(value: width); |
| 58 | } |
| 59 | |
| 60 | bool QLineWidth::smooth() const |
| 61 | { |
| 62 | Q_D(const QLineWidth); |
| 63 | return d->m_smooth; |
| 64 | } |
| 65 | |
| 66 | void 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 | |
| 77 | QT_END_NAMESPACE |
| 78 | |
| 79 | #include "moc_qlinewidth.cpp" |
| 80 | |