1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QCUSTOMLABELITEM_H
5#define QCUSTOMLABELITEM_H
6
7#include <QtGraphs/qgraphsglobal.h>
8#include <QtGraphs/QCustom3DItem>
9#include <QtGui/QVector3D>
10#include <QtGui/QQuaternion>
11#include <QtGui/QFont>
12#include <QtGui/QColor>
13
14QT_BEGIN_NAMESPACE
15
16class QCustom3DLabelPrivate;
17
18class 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)
23 Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged)
24 Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor NOTIFY textColorChanged)
25 Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor NOTIFY backgroundColorChanged)
26 Q_PROPERTY(bool borderEnabled READ isBorderEnabled WRITE setBorderEnabled NOTIFY borderEnabledChanged)
27 Q_PROPERTY(bool backgroundEnabled READ isBackgroundEnabled WRITE setBackgroundEnabled NOTIFY backgroundEnabledChanged)
28 Q_PROPERTY(bool facingCamera READ isFacingCamera WRITE setFacingCamera NOTIFY facingCameraChanged)
29
30public:
31 explicit QCustom3DLabel(QObject *parent = nullptr);
32 explicit QCustom3DLabel(const QString &text, const QFont &font, const QVector3D &position,
33 const QVector3D &scaling, const QQuaternion &rotation,
34 QObject *parent = nullptr);
35 virtual ~QCustom3DLabel();
36
37 void setText(const QString &text);
38 QString text() const;
39
40 void setFont(const QFont &font);
41 QFont font() const;
42
43 void setTextColor(const QColor &color);
44 QColor textColor() const;
45
46 void setBackgroundColor(const QColor &color);
47 QColor backgroundColor() const;
48
49 void setBorderEnabled(bool enabled);
50 bool isBorderEnabled() const;
51
52 void setBackgroundEnabled(bool enabled);
53 bool isBackgroundEnabled() const;
54
55 void setFacingCamera(bool enabled);
56 bool isFacingCamera() const;
57
58Q_SIGNALS:
59 void textChanged(const QString &text);
60 void fontChanged(const QFont &font);
61 void textColorChanged(const QColor &color);
62 void backgroundColorChanged(const QColor &color);
63 void borderEnabledChanged(bool enabled);
64 void backgroundEnabledChanged(bool enabled);
65 void facingCameraChanged(bool enabled);
66
67private:
68 Q_DISABLE_COPY(QCustom3DLabel)
69};
70
71QT_END_NAMESPACE
72
73#endif
74

source code of qtgraphs/src/graphs/data/qcustom3dlabel.h