| 1 | // Copyright (C) 2023 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QTGRAPHS_QCUSTOMLABELITEM_H |
| 5 | #define QTGRAPHS_QCUSTOMLABELITEM_H |
| 6 | |
| 7 | #include <QtGraphs/qcustom3ditem.h> |
| 8 | #include <QtGraphs/qgraphsglobal.h> |
| 9 | #include <QtGui/qcolor.h> |
| 10 | #include <QtGui/qfont.h> |
| 11 | #include <QtGui/qquaternion.h> |
| 12 | #include <QtGui/qvector3d.h> |
| 13 | |
| 14 | QT_BEGIN_NAMESPACE |
| 15 | |
| 16 | class QCustom3DLabelPrivate; |
| 17 | |
| 18 | class Q_GRAPHS_EXPORT QCustom3DLabel : public QCustom3DItem |
| 19 | { |
| 20 | Q_OBJECT |
| 21 | Q_DECLARE_PRIVATE(QCustom3DLabel) |
| 22 | Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged FINAL) |
| 23 | Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged FINAL) |
| 24 | Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor NOTIFY textColorChanged FINAL) |
| 25 | Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor NOTIFY |
| 26 | backgroundColorChanged FINAL) |
| 27 | Q_PROPERTY(bool borderVisible READ isBorderVisible WRITE setBorderVisible NOTIFY |
| 28 | borderVisibleChanged FINAL) |
| 29 | Q_PROPERTY(bool backgroundVisible READ isBackgroundVisible WRITE setBackgroundVisible NOTIFY |
| 30 | backgroundVisibleChanged FINAL) |
| 31 | Q_PROPERTY(bool facingCamera READ isFacingCamera WRITE setFacingCamera NOTIFY |
| 32 | facingCameraChanged FINAL) |
| 33 | |
| 34 | public: |
| 35 | explicit QCustom3DLabel(QObject *parent = nullptr); |
| 36 | explicit QCustom3DLabel(const QString &text, |
| 37 | const QFont &font, |
| 38 | QVector3D position, |
| 39 | QVector3D scaling, |
| 40 | const QQuaternion &rotation, |
| 41 | QObject *parent = nullptr); |
| 42 | ~QCustom3DLabel() override; |
| 43 | |
| 44 | void setText(const QString &text); |
| 45 | QString text() const; |
| 46 | |
| 47 | void setFont(const QFont &font); |
| 48 | QFont font() const; |
| 49 | |
| 50 | void setTextColor(QColor color); |
| 51 | QColor textColor() const; |
| 52 | |
| 53 | void setBackgroundColor(QColor color); |
| 54 | QColor backgroundColor() const; |
| 55 | |
| 56 | void setBorderVisible(bool visible); |
| 57 | bool isBorderVisible() const; |
| 58 | |
| 59 | void setBackgroundVisible(bool visible); |
| 60 | bool isBackgroundVisible() const; |
| 61 | |
| 62 | void setFacingCamera(bool enabled); |
| 63 | bool isFacingCamera() const; |
| 64 | |
| 65 | Q_SIGNALS: |
| 66 | void textChanged(const QString &text); |
| 67 | void fontChanged(const QFont &font); |
| 68 | void textColorChanged(QColor color); |
| 69 | void backgroundColorChanged(QColor color); |
| 70 | void borderVisibleChanged(bool visible); |
| 71 | void backgroundVisibleChanged(bool visible); |
| 72 | void facingCameraChanged(bool enabled); |
| 73 | |
| 74 | private: |
| 75 | Q_DISABLE_COPY(QCustom3DLabel) |
| 76 | }; |
| 77 | |
| 78 | QT_END_NAMESPACE |
| 79 | |
| 80 | #endif |
| 81 | |