このページでは

QCustom3DLabel Class

QCustom3DLabel クラスは、グラフにカスタムラベルを追加します。詳細...

ヘッダー: #include <QCustom3DLabel>
CMake: find_package(Qt6 REQUIRED COMPONENTS DataVisualization)
target_link_libraries(mytarget PRIVATE Qt6::DataVisualization)
qmake: QT += datavisualization
バージョン: QtDataVisualization 1.1
QML内: Custom3DLabel
継承元: QCustom3DItem
ステータス: 非推奨

このクラスは非推奨です。新しいコードでの使用は強く推奨しません。

プロパティ

パブリック関数

QCustom3DLabel(QObject *parent = nullptr)
QCustom3DLabel(const QString &text, const QFont &font, const QVector3D &position, const QVector3D &scaling, const QQuaternion &rotation, QObject *parent = nullptr)
virtual ~QCustom3DLabel()
QColor backgroundColor() const
QFont font() const
bool isBackgroundEnabled() const
bool isBorderEnabled() const
bool isFacingCamera() const
void setBackgroundColor(const QColor &color)
void setBackgroundEnabled(bool enabled)
void setBorderEnabled(bool enabled)
void setFacingCamera(bool enabled)
void setFont(const QFont &font)
void setText(const QString &text)
void setTextColor(const QColor &color)
QString text() const
QColor textColor() const

シグナル

void backgroundColorChanged(const QColor &color)
void backgroundEnabledChanged(bool enabled)
void borderEnabledChanged(bool enabled)
void facingCameraChanged(bool enabled)
void fontChanged(const QFont &font)
void textChanged(const QString &text)
void textColorChanged(const QColor &color)

詳細説明

カスタムラベルのテキスト、フォント、位置、拡大縮小、回転、および色を設定できます。さらに、ラベルの枠線や背景の表示/非表示を切り替えることができます。色、枠線、背景は、明示的に設定されていない限り、アクティブなテーマによって決定されます。

注: 拡大縮小の際 、z座標は影響しません。x座標とy座標を同じ値に設定すると、元のフォントサイズが維持されます。

関連項目: QAbstract3DGraph::addCustomItem()。

プロパティのドキュメント

backgroundColor : QColor

このプロパティは、有効になっている場合、ラベルの背景色を指定します。

デフォルト値はQt::gray です。

アクセス関数:

QColor backgroundColor() const
void setBackgroundColor(const QColor &color)

通知シグナル:

void backgroundColorChanged(const QColor &color)

「backgroundEnabled」も参照してください 。

backgroundEnabled : bool

このプロパティは、ラベルの背景が表示されるかどうかを決定します。

false に設定されている場合、backgroundColor()は効果を持ちません。デフォルトはtrue です。

アクセス関数:

bool isBackgroundEnabled() const
void setBackgroundEnabled(bool enabled)

Notifierシグナル:

void backgroundEnabledChanged(bool enabled)

borderEnabled : bool

このプロパティは、ラベルの枠線が表示されるかどうかを指定します。

デフォルト値はtrue です。

アクセス関数:

bool isBorderEnabled() const
void setBorderEnabled(bool enabled)

通知シグナル:

void borderEnabledChanged(bool enabled)

facingCamera : bool

このプロパティは、ラベルが常にカメラの方を向くかどうかを指定します。

デフォルトはfalse です。true に設定された場合、rotation()は効果を持ちません。

アクセス関数:

bool isFacingCamera() const
void setFacingCamera(bool enabled)

Notifierシグナル:

void facingCameraChanged(bool enabled)

font : QFont

このプロパティは、ラベルに使用するフォントを指定します。

デフォルトはQFont("Arial", 20) です。特殊な書式設定(アウトラインなど)はサポートされていません。

アクセス関数:

QFont font() const
void setFont(const QFont &font)

通知シグナル:

void fontChanged(const QFont &font)

text : QString

このプロパティには、ラベルのテキストが格納されます。

リッチテキストはサポートされていません。

アクセス関数:

QString text() const
void setText(const QString &text)

通知シグナル:

void textChanged(const QString &text)

textColor : QColor

このプロパティは、ラベルテキストの色を指定します。

有効になっている場合は、ラベルの枠線にも影響します。デフォルトはQt::white です。

アクセス関数:

QColor textColor() const
void setTextColor(const QColor &color)

通知シグナル:

void textColorChanged(const QColor &color)

「borderEnabled」も参照してください 。

メンバ関数のドキュメント

[explicit] QCustom3DLabel::QCustom3DLabel(QObject *parent = nullptr)

指定されたparent を使用して、カスタム3Dラベルを作成します。

[explicit] QCustom3DLabel::QCustom3DLabel(const QString &text, const QFont &font, const QVector3D &position, const QVector3D &scaling, const QQuaternion &rotation, QObject *parent = nullptr)

指定されたtext 、font 、position 、scaling 、rotation 、およびオプションのparent を使用して、カスタム3Dラベルを作成します。

注: scaling に対してx座標とy座標を同じ値に設定すると 、元のフォントの寸法が維持されます。

[virtual noexcept] QCustom3DLabel::~QCustom3DLabel()

カスタム3Dラベルを削除します。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.