1// Copyright (C) 2016 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#ifndef QT3DEXTRAS_QTEXT2DENTITY_H
5#define QT3DEXTRAS_QTEXT2DENTITY_H
6
7#include <QtCore/qrect.h>
8#include <QtGui/qcolor.h>
9#include <QtGui/qfont.h>
10#include <Qt3DCore/qentity.h>
11#include <Qt3DExtras/qt3dextras_global.h>
12
13QT_BEGIN_NAMESPACE
14
15namespace Qt3DExtras {
16
17class QText2DEntityPrivate;
18
19class Q_3DEXTRASSHARED_EXPORT QText2DEntity : public Qt3DCore::QEntity
20{
21 Q_OBJECT
22 Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged)
23 Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged)
24 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
25 Q_PROPERTY(float width READ width WRITE setWidth NOTIFY widthChanged)
26 Q_PROPERTY(float height READ height WRITE setHeight NOTIFY heightChanged)
27
28public:
29 explicit QText2DEntity(Qt3DCore::QNode *parent = nullptr);
30 ~QText2DEntity();
31
32 QFont font() const;
33 void setFont(const QFont &font);
34
35 QColor color() const;
36 void setColor(const QColor &color);
37
38 QString text() const;
39 void setText(const QString &text);
40
41 float width() const;
42 float height() const;
43
44 void setWidth(float width);
45 void setHeight(float height);
46
47Q_SIGNALS:
48 void fontChanged(const QFont &font);
49 void colorChanged(const QColor &color);
50 void textChanged(const QString &text);
51 void widthChanged(float width);
52 void heightChanged(float height);
53
54private:
55 Q_DECLARE_PRIVATE(QText2DEntity)
56};
57
58} // namespace Qt3DExtras
59
60QT_END_NAMESPACE
61
62#endif // QT3DEXTRAS_QTEXT2DENTITY_H
63

source code of qt3d/src/extras/text/qtext2dentity.h