QPieSeries Class
QPieSeries 클래스는 파이 그래프로 데이터를 표시합니다. 더 보기...
Header: | #include <QPieSeries> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Graphs) target_link_libraries(mytarget PRIVATE Qt6::Graphs) |
qmake: | QT += graphs |
QML에서: | PieSeries |
상속합니다: | QAbstractSeries |
- 상속된 멤버를 포함한 모든 멤버의 목록
- QPieSeries는 Qt Graphs 2D용 C++ 클래스의 일부입니다.
속성
|
|
공용 함수
QPieSeries(QObject *parent = nullptr) | |
bool | append(QPieSlice *slice) |
bool | append(const QList<QPieSlice *> &slices) |
QPieSlice * | append(const QString &label, qreal value) |
QPieSlice * | at(qsizetype index) |
void | clear() |
qsizetype | count() const |
qreal | endAngle() const |
QPieSlice * | find(const QString &label) |
qreal | holeSize() const |
qreal | horizontalPosition() const |
bool | insert(qsizetype index, QPieSlice *slice) |
bool | isEmpty() const |
qreal | pieSize() const |
bool | remove(QPieSlice *slice) |
bool | remove(qsizetype index) |
void | removeMultiple(qsizetype index, int count) |
bool | replace(const QList<QPieSlice *> &slices) |
bool | replace(QPieSlice *oldSlice, QPieSlice *newSlice) |
bool | replace(qsizetype index, QPieSlice *slice) |
void | setEndAngle(qreal angle) |
void | setHoleSize(qreal holeSize) |
void | setHorizontalPosition(qreal relativePosition) |
void | setLabelsPosition(QPieSlice::LabelPosition position) |
void | setLabelsVisible(bool visible) |
void | setPieSize(qreal relativeSize) |
void | setStartAngle(qreal angle) |
void | setVerticalPosition(qreal relativePosition) |
QList<QPieSlice *> | slices() const |
qreal | startAngle() const |
qreal | sum() const |
bool | take(QPieSlice *slice) |
qreal | verticalPosition() const |
QPieSeries & | operator<<(QPieSlice *slice) |
재구현된 공용 함수
virtual QAbstractSeries::SeriesType | type() const override |
신호
void | added(const QList<QPieSlice *> &slices) |
void | countChanged() |
void | endAngleChanged() |
void | holeSizeChanged() |
void | horizontalPositionChanged() |
void | pieSizeChanged() |
void | removed(const QList<QPieSlice *> &slices) |
void | startAngleChanged() |
void | sumChanged() |
void | verticalPositionChanged() |
상세 설명
파이 시리즈는 QPieSlice 객체로 정의된 슬라이스로 구성됩니다. 슬라이스는 임의의 값을 가질 수 있으며, QPieSeries 객체는 그래프에서 슬라이스의 실제 크기를 결정하기 위해 계열의 모든 슬라이스의 합과 비교하여 슬라이스의 비율을 계산합니다.
그래프에서 파이 크기와 위치는 0.0에서 1.0 범위의 상대값을 사용하여 제어합니다. 이는 실제 그래프 직사각형과 관련이 있습니다.
기본적으로 파이는 전체 파이로 정의됩니다. 계열의 시작 각도와 각도 범위를 설정하여 부분 파이를 만들 수 있습니다. 전체 파이는 360도이며, 여기서 0은 12시 방향입니다.
QPieSlice 를참조하세요 .
속성 문서
[read-only]
count : const qsizetype
이 속성은 시리즈의 슬라이스 수를 보유합니다.
액세스 함수:
qsizetype | count() const |
알림 신호:
void | countChanged() |
endAngle : qreal
이 속성은 파이의 끝 각도를 보유합니다.
전체 파이는 360도이며, 여기서 0도는 12시 방향입니다.
기본값은 360입니다.
기능에 액세스합니다:
qreal | endAngle() const |
void | setEndAngle(qreal angle) |
알림 신호:
void | endAngleChanged() |
holeSize : qreal
이 속성은 도넛 구멍 크기를 저장합니다.
pieSize 속성을 설정할 때 필요한 경우 구멍 크기가 파이 크기보다 크지 않도록 이 속성을 조정합니다.
기본값은 0.0입니다.
기능에 액세스합니다:
qreal | holeSize() const |
void | setHoleSize(qreal holeSize) |
알림 신호:
void | holeSizeChanged() |
horizontalPosition : qreal
이 속성은 파이의 수평 위치를 유지합니다.
이 값은 그래프 직사각형에 상대적인 값입니다:
- 0.0은 절대 왼쪽입니다.
- 1.0은 절대 오른쪽입니다.
기본값은 0.5(가운데)입니다.
기능에 액세스합니다:
qreal | horizontalPosition() const |
void | setHorizontalPosition(qreal relativePosition) |
통지 신호:
void | horizontalPositionChanged() |
verticalPosition 를참조하세요 .
pieSize : qreal
이 속성은 파이 크기를 보유합니다.
이 값은 그래프 직사각형에 상대적인 값입니다:
- 0.0은 최소 pieSize(파이가 그려지지 않음)입니다.
- 1.0은 그래프에 맞출 수 있는 최대 pieSize입니다.
이 속성을 설정할 때 필요한 경우 holeSize 속성을 조정하여 구멍 크기가 파이 크기보다 크지 않도록 합니다.
기본값은 0.7입니다.
기능에 액세스합니다:
qreal | pieSize() const |
void | setPieSize(qreal relativeSize) |
알림 신호:
void | pieSizeChanged() |
startAngle : qreal
이 속성은 파이의 시작 각도를 보유합니다.
전체 파이는 360도이며 0도는 12시 방향입니다.
기본값은 0입니다.
함수에 액세스합니다:
qreal | startAngle() const |
void | setStartAngle(qreal angle) |
알림 신호:
void | startAngleChanged() |
[read-only]
sum : const qreal
이 속성은 모든 슬라이스의 합계를 보유합니다.
이 계열은 보유하고 있는 모든 슬라이스의 합계를 추적합니다.
함수에 액세스합니다:
qreal | sum() const |
알림 신호:
void | sumChanged() |
verticalPosition : qreal
이 속성은 파이의 수직 위치를 유지합니다.
이 값은 그래프 직사각형에 상대적인 값입니다:
- 0.0은 절대 상단입니다.
- 1.0은 절대 하단입니다.
기본값은 0.5(가운데)입니다.
기능에 액세스합니다:
qreal | verticalPosition() const |
void | setVerticalPosition(qreal relativePosition) |
통지 신호:
void | verticalPositionChanged() |
horizontalPosition 를참조하세요 .
멤버 함수 문서
[explicit]
QPieSeries::QPieSeries(QObject *parent = nullptr)
parent 의 자식인 계열 객체를 생성합니다.
[signal]
void QPieSeries::added(const QList<QPieSlice *> &slices)
이 신호는 slices 에 지정된 슬라이스가 시리즈에 추가될 때 방출됩니다.
append()도 참조하세요 .
[invokable]
bool QPieSeries::append(QPieSlice *slice)
slice 에 지정된 슬라이스를 시리즈에 추가합니다. 슬라이스 소유권은 시리즈에 전달됩니다.
추가에 성공하면 true
을 반환합니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.
[invokable]
bool QPieSeries::append(const QList<QPieSlice *> &slices)
slices 에 지정된 슬라이스 배열을 시리즈에 추가합니다. 슬라이스 소유권은 시리즈에 전달됩니다.
추가에 성공하면 true
을 반환합니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.
[invokable]
QPieSlice *QPieSeries::append(const QString &label, qreal value)
지정된 value 및 label 이 포함된 단일 슬라이스를 시리즈에 추가합니다. 슬라이스 소유권은 시리즈에 전달됩니다. value 가 NaN
, Inf
또는 -Inf
인 경우 null을 반환하고 시리즈에 아무것도 추가하지 않습니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.
[invokable]
QPieSlice *QPieSeries::at(qsizetype index)
index 위치에서 PieSlice 를 반환합니다. PieSlice 을 찾지 못하면 null을 반환합니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.
[invokable]
void QPieSeries::clear()
시리즈에서 모든 슬라이스를 지웁니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.
qsizetype QPieSeries::count() const
이 시리즈의 슬라이스 수를 반환합니다.
참고: 프로퍼티 개수에 대한 겟터 함수입니다.
qreal QPieSeries::endAngle() const
파이의 끝 각도를 반환합니다.
전체 파이는 360도이며, 여기서 0도는 12시 방향입니다.
참고: 끝각도 속성에 대한 게터 함수입니다.
setEndAngle(), startAngle() 및 setStartAngle()도 참조하세요 .
[invokable]
QPieSlice *QPieSeries::find(const QString &label)
label 레이블이 포함된 PieSlice 을 검색합니다. 발견되면 PieSlice 을 반환하고, 그렇지 않으면 null을 반환합니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.
[invokable]
bool QPieSeries::insert(qsizetype index, QPieSlice *slice)
slice 으로 지정한 슬라이스를 index 으로 지정한 위치의 슬라이스 앞 시리즈에 삽입합니다. 슬라이스 소유권은 시리즈로 전달됩니다.
삽입에 성공하면 true
을 반환합니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.
bool QPieSeries::isEmpty() const
시리즈가 비어 있으면 true
을 반환합니다.
[invokable]
bool QPieSeries::remove(QPieSlice *slice)
slice 으로 지정된 단일 슬라이스를 시리즈에서 제거하고 영구적으로 삭제합니다.
이 호출 이후에는 포인터를 참조할 수 없습니다.
제거에 성공하면 true
을 반환합니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.
[invokable]
bool QPieSeries::remove(qsizetype index)
index 위치에서 PieSlice 을 제거합니다. PieSlice 은 영구적으로 삭제됩니다. 제거에 성공하면 true
을 반환합니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.
[invokable]
void QPieSeries::removeMultiple(qsizetype index, int count)
index 에서 시작하여 count 까지 여러 개의 파이슬라이스를 제거합니다. 파이슬라이스는 영구적으로 삭제됩니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.
[signal]
void QPieSeries::removed(const QList<QPieSlice *> &slices)
이 신호는 slices 에서 지정한 슬라이스가 시리즈에서 제거될 때 발생합니다.
remove()도 참조하세요 .
[invokable]
bool QPieSeries::replace(const QList<QPieSlice *> &slices)
시리즈의 전체 파이슬라이스 목록을 slices 에 지정된 목록으로 바꿉니다. 모든 원본 파이 슬라이스는 영구적으로 삭제됩니다. 모든 파이슬라이스가 성공적으로 대체되면 true
을 반환합니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.
[invokable]
bool QPieSeries::replace(QPieSlice *oldSlice, QPieSlice *newSlice)
PieSlice oldSlice 을 newSlice 으로 바꿉니다.oldSlice 은 영구적으로 삭제됩니다. 대체에 성공하면 true
을 반환합니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.
[invokable]
bool QPieSeries::replace(qsizetype index, QPieSlice *slice)
index 위치의 PieSlice 를 slice 에 지정된 위치로 바꿉니다. 원본 PieSlice 은 영구적으로 삭제됩니다. 파이슬라이스를 교체하는 데 실패하면 false
을 반환합니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.
void QPieSeries::setEndAngle(qreal angle)
파이의 끝 각도를 설정합니다.
전체 파이는 360도이며, 여기서 0도는 12시 방향입니다.
angle 는 시작 각도보다 커야 합니다.
참고: 속성의 설정자 함수 endAngle.
endAngle(), startAngle() 및 setStartAngle()도 참조하세요 .
void QPieSeries::setLabelsPosition(QPieSlice::LabelPosition position)
모든 슬라이스 레이블의 위치를 position 로 설정합니다.
참고: 이 함수는 시리즈의 현재 슬라이스에만 영향을 줍니다. 새 슬라이스가 추가되면 기본 레이블 위치는 QPieSlice::LabelOutside입니다.
QPieSlice::labelPosition() 및 QPieSlice::setLabelPosition()도 참조하세요 .
void QPieSeries::setLabelsVisible(bool visible)
모든 슬라이스 레이블의 가시성을 visible 로 설정합니다.
참고: 이 기능은 시리즈의 현재 슬라이스에만 영향을 줍니다. 새 슬라이스가 추가되면 기본 레이블 가시성은 false
입니다.
QPieSlice::isLabelVisible() 및 QPieSlice::setLabelVisible()도 참조하세요 .
void QPieSeries::setStartAngle(qreal angle)
파이의 시작 각도를 설정합니다.
전체 파이는 360도이며, 여기서 0도는 12시 방향입니다.
angle 는 끝 각도보다 작아야 합니다.
참고: 속성의 설정자 함수 startAngle.
startAngle(), endAngle() 및 setEndAngle()도 참조하세요 .
QList<QPieSlice *> QPieSeries::slices() const
이 시리즈에 속하는 슬라이스 목록을 반환합니다.
qreal QPieSeries::startAngle() const
파이의 시작 각도를 반환합니다.
전체 파이는 360도이며, 여기서 0도는 12시 방향입니다.
참고: startAngle 속성에 대한 게터 함수입니다.
setStartAngle(), endAngle() 및 setEndAngle()도 참조하세요 .
qreal QPieSeries::sum() const
이 계열의 모든 슬라이스 값의 합계를 반환합니다.
참고: 속성 합계에 대한 게터 함수입니다.
QPieSlice::value(), QPieSlice::setValue() 및 QPieSlice::percentage()도 참조하세요 .
[invokable]
bool QPieSeries::take(QPieSlice *slice)
시리즈에서 slice 로 지정된 단일 슬라이스를 가져옵니다. 슬라이스 객체를 삭제하지 않습니다.
참고: 시리즈는 슬라이스의 부모 객체로 유지됩니다. 전체 소유권을 가져가려면 부모 객체를 설정해야 합니다.
가져오기 작업이 성공하면 true
을 반환합니다.
참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.
[override virtual]
QAbstractSeries::SeriesType QPieSeries::type() const
속성에 대한 액세스 함수를 다시 구현합니다: QAbstractSeries::type.
시리즈의 유형을 반환합니다.
QPieSeries &QPieSeries::operator<<(QPieSlice *slice)
slice 에 지정된 슬라이스를 시리즈에 추가하고 시리즈에 대한 참조를 반환합니다. 슬라이스 소유권은 시리즈에 전달됩니다.
© 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.