QBarDataProxy Class

QBarDataProxy 클래스는 3D 막대 그래프를 위한 데이터 프록시입니다. 더 보기...

Header: #include <QBarDataProxy>
CMake: find_package(Qt6 REQUIRED COMPONENTS DataVisualization)
target_link_libraries(mytarget PRIVATE Qt6::DataVisualization)
qmake: QT += datavisualization
이후: QtDataVisualization 1.0
QML에서: BarDataProxy
상속: QAbstractDataProxy
상속 대상:

QItemModelBarDataProxy

속성

공공 기능

QBarDataProxy(QObject *parent = nullptr)
virtual ~QBarDataProxy()
int addRow(QBarDataRow *row)
int addRow(QBarDataRow *row, const QString &label)
int addRows(const QBarDataArray &rows)
int addRows(const QBarDataArray &rows, const QStringList &labels)
const QBarDataArray *array() const
QStringList columnLabels() const
void insertRow(int rowIndex, QBarDataRow *row)
void insertRow(int rowIndex, QBarDataRow *row, const QString &label)
void insertRows(int rowIndex, const QBarDataArray &rows)
void insertRows(int rowIndex, const QBarDataArray &rows, const QStringList &labels)
const QBarDataItem *itemAt(const QPoint &position) const
const QBarDataItem *itemAt(int rowIndex, int columnIndex) const
void removeRows(int rowIndex, int removeCount, bool removeLabels = true)
void resetArray()
void resetArray(QBarDataArray *newArray)
void resetArray(QBarDataArray *newArray, const QStringList &rowLabels, const QStringList &columnLabels)
const QBarDataRow *rowAt(int rowIndex) const
int rowCount() const
QStringList rowLabels() const
QBar3DSeries *series() const
void setColumnLabels(const QStringList &labels)
void setItem(const QPoint &position, const QBarDataItem &item)
void setItem(int rowIndex, int columnIndex, const QBarDataItem &item)
void setRow(int rowIndex, QBarDataRow *row)
void setRow(int rowIndex, QBarDataRow *row, const QString &label)
void setRowLabels(const QStringList &labels)
void setRows(int rowIndex, const QBarDataArray &rows)
void setRows(int rowIndex, const QBarDataArray &rows, const QStringList &labels)

신호

void arrayReset()
void columnLabelsChanged()
void itemChanged(int rowIndex, int columnIndex)
void rowCountChanged(int count)
void rowLabelsChanged()
void rowsAdded(int startIndex, int count)
void rowsChanged(int startIndex, int count)
void rowsInserted(int startIndex, int count)
void rowsRemoved(int startIndex, int count)
void seriesChanged(QBar3DSeries *series)

상세 설명

바 데이터 프록시는 데이터 행의 추가, 삽입, 변경, 제거를 처리합니다.

데이터 배열은 QBarDataItem 인스턴스의 벡터(행) 목록입니다. 각 행은 서로 다른 수의 항목을 포함하거나 null일 수도 있습니다.

QBarDataProxy는 직접 또는 QtDataVisualization::QBarDataArray 컨테이너에 전달된 모든 QtDataVisualization::QBarDataRow 객체에 대한 소유권을 갖습니다. 배열을 프록시에 추가한 후 막대 데이터 행 포인터를 사용하여 데이터를 직접 수정하는 경우 그래프를 업데이트하려면 적절한 신호를 방출해야 합니다.

QBarDataProxy는 선택적으로 행과 열 레이블을 추적하며, QCategory3DAxis 에서 축 레이블을 표시하는 데 활용할 수 있습니다. 행과 열 레이블은 데이터와 별도의 배열에 저장되며 행 조작 메서드는 행 레이블에 영향을 미치지 않는 대체 버전을 제공합니다. 이를 통해 데이터 자체가 아닌 배열에서 데이터의 위치와 관련된 행 레이블을 사용할 수 있습니다.

Qt Data Visualization 데이터 처리도참조하세요 .

속성 문서

columnLabels : QStringList

이 속성은 배열의 선택적 열 레이블을 보유합니다.

이 배열의 인덱스는 행의 열 인덱스와 일치합니다. 목록이 가장 긴 행보다 짧으면 모든 열에 레이블이 지정되지 않습니다.

함수에 액세스합니다:

QStringList columnLabels() const
void setColumnLabels(const QStringList &labels)

알림 신호:

void columnLabelsChanged()

[read-only] rowCount : const int

이 속성은 배열의 행 수를 보유합니다.

함수에 액세스합니다:

int rowCount() const

알림 신호:

void rowCountChanged(int count)

rowLabels : QStringList

이 속성은 배열의 선택적 행 레이블을 보유합니다.

이 배열의 인덱스는 데이터 배열의 행 인덱스와 일치합니다. 목록이 행 수보다 짧으면 모든 행에 레이블이 지정되지 않습니다.

함수에 액세스합니다:

QStringList rowLabels() const
void setRowLabels(const QStringList &labels)

알림 신호:

void rowLabelsChanged()

[read-only] series : QBar3DSeries* const

이 프로퍼티에는 프록시가 연결된 시리즈가 저장됩니다.

함수에 액세스합니다:

QBar3DSeries *series() const

알림 신호:

void seriesChanged(QBar3DSeries *series)

멤버 함수 문서

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

주어진 parent 으로 바 데이터 프록시를 구축합니다.

[virtual noexcept] QBarDataProxy::~QBarDataProxy()

막대 데이터 프록시를 삭제합니다.

int QBarDataProxy::addRow(QBarDataRow *row)

배열 끝에 새 행 row 을 추가합니다. 기존 행 레이블은 영향을 받지 않습니다.

추가된 행의 인덱스를 반환합니다.

int QBarDataProxy::addRow(QBarDataRow *row, const QString &label)

배열 끝에 label 레이블을 가진 새 행 row 을 추가합니다.

추가된 행의 인덱스를 반환합니다.

int QBarDataProxy::addRows(const QBarDataArray &rows)

배열 끝에 새 rows 을 추가합니다. 기존 행 레이블은 영향을 받지 않습니다.

처음 추가된 행의 인덱스를 반환합니다.

int QBarDataProxy::addRows(const QBarDataArray &rows, const QStringList &labels)

배열 끝에 labels 을 사용하여 새 rows 을 추가합니다.

처음 추가된 행의 인덱스를 반환합니다.

const QBarDataArray *QBarDataProxy::array() const

데이터 배열에 대한 포인터를 반환합니다.

[signal] void QBarDataProxy::arrayReset()

이 신호는 데이터 배열이 리셋될 때 발생합니다. resetArray ()를 호출하지 않고 전체 배열의 내용이 변경된 경우 그래프를 업데이트하려면 이 신호가 발생해야 합니다.

void QBarDataProxy::insertRow(int rowIndex, QBarDataRow *row)

rowIndex 에 새 행 row 을 삽입합니다. rowIndex 이 배열 크기와 같으면 배열 끝에 행이 추가됩니다. 기존 행 레이블은 영향을 받지 않습니다.

참고: 삽입된 행 너머에 레이블이 지정된 행이 있는 경우 이 호출 후 행 레이블 배열은 행 배열과 동기화되지 않습니다.

void QBarDataProxy::insertRow(int rowIndex, QBarDataRow *row, const QString &label)

label 레이블이 있는 새 행 rowrowIndex 에 삽입합니다. rowIndex 이 배열 크기와 같으면 배열 끝에 행이 추가됩니다.

void QBarDataProxy::insertRows(int rowIndex, const QBarDataArray &rows)

rowIndex 에 새 rows 을 삽입합니다. rowIndex 이 배열 크기와 같으면 배열 끝에 행이 추가됩니다. 기존 행 레이블은 영향을 받지 않습니다.

참고: 삽입된 행 너머에 레이블이 지정된 행이 있는 경우 이 호출 후 행 레이블 배열은 행 배열과 동기화되지 않습니다.

void QBarDataProxy::insertRows(int rowIndex, const QBarDataArray &rows, const QStringList &labels)

labels 을 사용하여 rowIndex 에 새 rows 을 삽입합니다. rowIndex 이 배열 크기와 같으면 배열 끝에 행이 추가됩니다.

const QBarDataItem *QBarDataProxy::itemAt(const QPoint &position) const

position 위치에 있는 항목에 대한 포인터를 반환합니다. position 의 x 값은 행을 나타내고 y 값은 열을 나타냅니다. 이 항목은 데이터를 수정하는 다음 호출까지만 유효합니다.

const QBarDataItem *QBarDataProxy::itemAt(int rowIndex, int columnIndex) const

rowIndexcolumnIndex 에 지정된 위치에 있는 항목에 대한 포인터를 반환합니다. 데이터를 수정하는 다음 호출까지만 유효하도록 보장됩니다.

[signal] void QBarDataProxy::itemChanged(int rowIndex, int columnIndex)

이 신호는 rowIndexcolumnIndex 에서 지정한 위치의 항목이 변경될 때 발생합니다. setItem ()를 호출하지 않고 배열에서 항목이 변경된 경우 그래프를 업데이트하려면 이 신호를 발생시켜야 합니다.

void QBarDataProxy::removeRows(int rowIndex, int removeCount, bool removeLabels = true)

rowIndex 위치에서 시작하여 removeCount 에 지정된 행 수를 제거합니다. 배열의 끝을 지나 행을 제거하려고 시도하면 아무 작업도 수행되지 않습니다. removeLabelstrue 인 경우 해당 행 레이블도 제거됩니다. 그렇지 않으면 행 레이블은 영향을 받지 않습니다.

참고: removeLabelsfalse 인 경우 제거된 행 너머에 레이블이 지정된 행이 있는 경우 행 레이블 배열이 행 배열과 동기화되지 않습니다.

void QBarDataProxy::resetArray()

기존 배열과 행 및 열 레이블을 지웁니다.

void QBarDataProxy::resetArray(QBarDataArray *newArray)

배열의 소유권을 가져옵니다 newArray. 새 배열이 기존 배열과 다르면 기존 배열을 지웁니다. 배열이 같으면 이 함수는 arrayReset() 신호를 트리거합니다.

null 배열을 전달하면 기존 배열이 삭제되고 빈 배열이 새로 만들어집니다. 행과 열 레이블은 영향을 받지 않습니다.

void QBarDataProxy::resetArray(QBarDataArray *newArray, const QStringList &rowLabels, const QStringList &columnLabels)

배열의 소유권을 가져옵니다 newArray. 새 배열이 기존 배열과 다르면 기존 배열을 지웁니다. 배열이 같으면 이 함수는 arrayReset() 신호를 트리거합니다.

null 배열을 전달하면 기존 배열이 삭제되고 빈 배열이 새로 만들어집니다.

rowLabelscolumnLabels 목록은 행과 열의 새 레이블을 지정합니다.

const QBarDataRow *QBarDataProxy::rowAt(int rowIndex) const

rowIndex 위치에 있는 행에 대한 포인터를 반환합니다. 데이터를 수정하는 다음 호출까지만 유효하도록 보장됩니다.

[signal] void QBarDataProxy::rowsAdded(int startIndex, int count)

이 신호는 startIndex 위치에서 시작하여 count 에 지정된 행 수가 추가될 때 발생합니다. addRow () 또는 addRows()을 호출하지 않고 배열에 행을 추가하는 경우 그래프를 업데이트하려면 이 신호를 발생시켜야 합니다.

[signal] void QBarDataProxy::rowsChanged(int startIndex, int count)

이 신호는 startIndex 위치에서 시작하여 count 에 지정된 행 수가 변경될 때 발생합니다. setRow () 또는 setRows()을 호출하지 않고 배열에서 행이 변경된 경우 그래프를 업데이트하려면 이 신호를 발생시켜야 합니다.

[signal] void QBarDataProxy::rowsInserted(int startIndex, int count)

이 신호는 count 에 지정된 행 수가 startIndex 위치에 삽입될 때 발생합니다.

insertRow() 또는 insertRows()을 호출하지 않고 배열에 행을 삽입하는 경우 그래프를 업데이트하려면 이 신호를 발생시켜야 합니다.

[signal] void QBarDataProxy::rowsRemoved(int startIndex, int count)

이 신호는 startIndex 위치에서 시작하여 count 으로 지정된 행 수가 제거될 때 발생합니다.

배열의 끝에서 행이 제거된 경우 인덱스는 현재 배열 크기입니다. removeRows ()를 호출하지 않고 배열에서 행이 제거된 경우 그래프를 업데이트하려면 이 신호가 발생해야 합니다.

void QBarDataProxy::setItem(const QPoint &position, const QBarDataItem &item)

position 위치의 단일 항목을 item 항목으로 변경합니다. position 의 x 값은 행을 나타내고 y 값은 열을 나타냅니다.

void QBarDataProxy::setItem(int rowIndex, int columnIndex, const QBarDataItem &item)

rowIndexcolumnIndex 에서 지정한 위치의 단일 항목을 item 항목으로 변경합니다.

void QBarDataProxy::setRow(int rowIndex, QBarDataRow *row)

rowIndex 위치의 행을 row 에서 지정한 새 행으로 대체하여 기존 행을 변경합니다. 새 행은 rowIndex 에 이미 저장된 기존 행과 동일할 수 있습니다. 기존 행 레이블은 영향을 받지 않습니다.

void QBarDataProxy::setRow(int rowIndex, QBarDataRow *row, const QString &label)

rowIndex 위치의 행을 row 에서 지정한 새 행으로 대체하여 기존 행을 변경합니다. 새 행은 rowIndex 에 이미 저장된 기존 행과 동일할 수 있습니다. 행 레이블을 label 로 변경합니다.

void QBarDataProxy::setRows(int rowIndex, const QBarDataArray &rows)

rowIndex 위치에서 시작하는 행을 rows 에서 지정한 새 행으로 대체하여 기존 행을 변경합니다. 기존 행 레이블은 영향을 받지 않습니다. rows 배열의 행은 rowIndex 에 이미 저장된 기존 행과 동일할 수 있습니다.

void QBarDataProxy::setRows(int rowIndex, const QBarDataArray &rows, const QStringList &labels)

rowIndex 위치에서 시작하는 행을 rows 에서 지정한 새 행으로 대체하여 기존 행을 변경합니다. 행 레이블은 labels 로 변경됩니다. rows 배열의 행은 rowIndex 에 이미 저장된 기존 행과 동일할 수 있습니다.

관련 비회원

QBarDataArray

QBarDataRow 객체에 대한 포인터 목록입니다.

QBarDataRow

QBarDataItem 개체 목록입니다.

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