QSGSimpleRectNode Class

QSGSimpleRectNode 클래스는 시나리오 그래프를 사용하여 채워진 직사각형을 그리는 데 편리한 클래스입니다. 더 보기...

Header: #include <QSGSimpleRectNode>
CMake: find_package(Qt6 REQUIRED COMPONENTS Quick)
target_link_libraries(mytarget PRIVATE Qt6::Quick)
qmake: QT += quick
상속합니다: QSGGeometryNode

공용 함수

QSGSimpleRectNode()
QSGSimpleRectNode(const QRectF &rect, const QColor &color)
QColor color() const
QRectF rect() const
void setColor(const QColor &color)
void setRect(const QRectF &rect)
void setRect(qreal x, qreal y, qreal w, qreal h)

자세한 설명

경고: 이 유틸리티 클래스는 Qt Quick 시나리오의 기본 또는 소프트웨어 백엔드로 실행할 때만 작동합니다. 대신 QQuickWindow::createRectangleNode()를 통해 QSGRectangleNode 을 사용하는 것이 좋습니다. 그러나 이 독립형 클래스는 서브클래싱을 통해 사용할 때 여전히 유용하며 애플리케이션은 특별한 시나리오 백엔드가 관여하지 않는다는 것을 알고 있습니다.

멤버 함수 문서

QSGSimpleRectNode::QSGSimpleRectNode()

빈 직사각형과 흰색을 가진 QSGSimpleRectNode 인스턴스를 생성합니다.

QSGSimpleRectNode::QSGSimpleRectNode(const QRectF &rect, const QColor &color)

color 색으로 rect 에 걸쳐 있는 QSGSimpleRectNode 인스턴스를 생성합니다.

QColor QSGSimpleRectNode::color() const

이 사각형의 색을 반환합니다.

setColor()도 참조하세요 .

QRectF QSGSimpleRectNode::rect() const

이 직사각형 노드가 포함하는 사각형을 반환합니다.

setRect()도 참조하세요 .

void QSGSimpleRectNode::setColor(const QColor &color)

이 사각형의 색상을 color 으로 설정합니다. 기본 색상은 흰색입니다.

color()도 참조하세요 .

void QSGSimpleRectNode::setRect(const QRectF &rect)

이 직사각형 노드의 직사각형을 rect 로 설정합니다.

rect()도 참조하세요 .

void QSGSimpleRectNode::setRect(qreal x, qreal y, qreal w, qreal h)

이것은 오버로드된 함수입니다.

이 직사각형 노드의 직사각형이 (x, y)에서 시작하고 너비 w 와 높이 h 를 갖도록 설정합니다.

© 2025 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.