이 페이지에서

QCustom3DLabel Class

QCustom3DLabel 클래스는 그래프에 사용자 정의 레이블을 추가합니다. 더 보기...

헤더: #include <QCustom3DLabel>
CMake: find_package(Qt6 REQUIRED COMPONENTS Graphs)
target_link_libraries(mytarget PRIVATE Qt6::Graphs)
qmake: QT += graphs
QML에서: Custom3DLabel
상속: QCustom3DItem

속성

공개 함수

QCustom3DLabel(QObject *parent = nullptr)
QCustom3DLabel(const QString &text, const QFont &font, QVector3D position, QVector3D scaling, const QQuaternion &rotation, QObject *parent = nullptr)
virtual ~QCustom3DLabel() override
QColor backgroundColor() const
QFont font() const
bool isBackgroundVisible() const
bool isBorderVisible() const
bool isFacingCamera() const
void setBackgroundColor(QColor color)
void setBackgroundVisible(bool visible)
void setBorderVisible(bool visible)
void setFacingCamera(bool enabled)
void setFont(const QFont &font)
void setText(const QString &text)
void setTextColor(QColor color)
QString text() const
QColor textColor() const

신호

void backgroundColorChanged(QColor color)
void backgroundVisibleChanged(bool visible)
void borderVisibleChanged(bool visible)
void facingCameraChanged(bool enabled)
void fontChanged(const QFont &font)
void textChanged(const QString &text)
void textColorChanged(QColor color)

상세 설명

사용자 정의 레이블의 텍스트, 글꼴, 위치, 크기 조정, 회전 및 색상을 설정할 수 있습니다. 또한 레이블의 테두리와 배경 표시 여부를 전환할 수 있습니다. 색상, 테두리 및 배경은 명시적으로 설정되지 않은 경우 활성 테마에 따라 결정됩니다.

참고: 크기 조정시 z 좌표는 영향을 미치지 않습니다. x 및 y 좌표를 동일하게 설정하면 원래 글꼴 크기가 유지됩니다.

참조: ` Q3DGraphsWidgetItem::addCustomItem()` 함수.

속성 설명서

backgroundColor : QColor

이 속성은 라벨 배경색이 활성화된 경우 해당 색상을 지정합니다.

기본값은 Qt::gray 입니다.

액세스 함수:

QColor backgroundColor() const
void setBackgroundColor(QColor color)

알림 신호:

void backgroundColorChanged(QColor color)

backgroundVisible도 참조하십시오 .

backgroundVisible : bool

이 속성은 레이블 배경이 표시되는지 여부를 결정합니다.

false 로 설정된 경우, backgroundColor()은 아무런 효과가 없습니다. 기본값은 true 입니다.

액세스 함수:

bool isBackgroundVisible() const
void setBackgroundVisible(bool visible)

알림 신호:

void backgroundVisibleChanged(bool visible)

borderVisible : bool

이 속성은 레이블 테두리가 표시되는지 여부를 결정합니다.

기본값은 ` true`입니다.

액세스 함수:

bool isBorderVisible() const
void setBorderVisible(bool visible)

알림 신호:

void borderVisibleChanged(bool visible)

facingCamera : bool

이 속성은 레이블이 항상 카메라를 향하도록 할지 여부를 지정합니다.

기본값은 ` false`입니다. ` true`로 설정된 경우, ` rotation()`는 아무런 효과도 미치지 않습니다.

액세스 함수:

bool isFacingCamera() const
void setFacingCamera(bool enabled)

알림 신호:

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(QColor color)

알림 신호:

void textColorChanged(QColor color)

borderVisible도 참조하십시오 .

멤버 함수 설명서

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

지정된 parent 를 사용하여 사용자 정의 3D 레이블을 생성합니다.

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

지정된 text, font, position, scaling, rotation 및 선택 사항인 parent 을 사용하여 사용자 정의 3D 레이블을 생성합니다.

참고: scaling 에 동일한 x 및 y 좌표를설정하면 원래 글꼴 크기가 유지됩니다.

[override 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.