The QBarDataProxy class is the data proxy for a 3D bars graph. 更多...
| 头: |
#include <QBarDataProxy>
|
| CMake: |
find_package(Qt6 REQUIRED COMPONENTS Graphs)
target_link_libraries(mytarget PRIVATE Qt6::Graphs)
|
| qmake: |
QT += graphs
|
| 在 QML: | BarDataProxy |
| 继承: | QAbstractDataProxy |
| 继承者: |
| QBarDataProxy (QObject * parent = nullptr) | |
| virtual | ~QBarDataProxy () override |
| qsizetype | addRow (QBarDataRow row ) |
| qsizetype | addRow (QBarDataRow row , QString label ) |
| qsizetype | addRows (QBarDataArray rows ) |
| qsizetype | addRows (QBarDataArray rows , QStringList labels ) |
| qsizetype | colCount () const |
| void | insertRow (qsizetype rowIndex , QBarDataRow row ) |
| void | insertRow (qsizetype rowIndex , QBarDataRow row , QString label ) |
| void | insertRows (qsizetype rowIndex , QBarDataArray rows ) |
| void | insertRows (qsizetype rowIndex , QBarDataArray rows , QStringList labels ) |
| const QBarDataItem & | itemAt (QPoint position ) const |
| const QBarDataItem & | itemAt (qsizetype rowIndex , qsizetype columnIndex ) const |
| void | removeRows (qsizetype rowIndex , qsizetype removeCount , QBarDataProxy::RemoveLabels removeLabels = RemoveLabels::No) |
| void | resetArray () |
| void | resetArray (QBarDataArray newArray ) |
| void | resetArray (QBarDataArray newArray , QStringList rowLabels , QStringList columnLabels ) |
| const QBarDataRow & | rowAt (qsizetype rowIndex ) const |
| qsizetype | rowCount () const |
| QBar3DSeries * | series () const |
| void | setItem (QPoint position , QBarDataItem item ) |
| void | setItem (qsizetype rowIndex , qsizetype columnIndex , QBarDataItem item ) |
| void | setRow (qsizetype rowIndex , QBarDataRow row ) |
| void | setRow (qsizetype rowIndex , QBarDataRow row , QString label ) |
| void | setRows (qsizetype rowIndex , QBarDataArray rows ) |
| void | setRows (qsizetype rowIndex , QBarDataArray rows , QStringList labels ) |
| void | arrayReset () |
| void | colCountChanged (qsizetype count ) |
| void | itemChanged (qsizetype rowIndex , qsizetype columnIndex ) |
| void | rowCountChanged (qsizetype count ) |
| void | rowsAdded (qsizetype startIndex , qsizetype count ) |
| void | rowsChanged (qsizetype startIndex , qsizetype count ) |
| void | rowsInserted (qsizetype startIndex , qsizetype count ) |
| void | rowsRemoved (qsizetype startIndex , qsizetype count ) |
| void | seriesChanged (QBar3DSeries * series ) |
| QBarDataArray | |
| QBarDataRow |
A bar data proxy handles adding, inserting, changing, and removing rows of data.
The data array is a list of vectors (rows) of QBarDataItem instances. Each row can contain a different number of items or even be null.
QBarDataProxy takes ownership of all QtGraphs::QBarDataRow objects passed to it, whether directly or in a QtGraphs::QBarDataArray container. If bar data row pointers are used to directly modify data after adding the array to the proxy, the appropriate signal must be emitted to update the graph.
QBarDataProxy optionally keeps track of row and column labels, which QCategory3DAxis can utilize to show axis labels.
The row and column labels are stored in a separate array from the data in the series rather. Row processing methods are available in the proxy and provide alternative versions that do not affect row labels. This enables the option of having row labels that relate to the position of the data in the array rather than the data itself. Since the series holds the data and row and column labels, it is necessary to create a series associated with the proxy before using these functions for them.
另请参阅 Qt Graphs Data Handling with 3D .
[read-only]
colCount
: const
qsizetype
This property holds the number of columns in the array.
访问函数:
| qsizetype | colCount () const |
通知程序信号:
| void | colCountChanged (qsizetype count ) |
[read-only]
rowCount
: const
qsizetype
This property holds the number of rows in the array.
访问函数:
| qsizetype | rowCount () const |
通知程序信号:
| void | rowCountChanged (qsizetype count ) |
[read-only]
series
:
QBar3DSeries
* const
This property holds the series this proxy is attached to.
访问函数:
| QBar3DSeries * | series () const |
通知程序信号:
| void | seriesChanged (QBar3DSeries * series ) |
[explicit]
QBarDataProxy::
QBarDataProxy
(
QObject
*
parent
= nullptr)
Constructs a bar data proxy with the given parent .
[override virtual noexcept]
QBarDataProxy::
~QBarDataProxy
()
Deletes the bar data proxy.
Adds the new row row to the end of an array. Existing row labels are not affected.
Returns the index of the added row.
Adds a the new row row with the label label to the end of an array.
Returns the index of the added row.
Adds the new rows to the end of an array. Existing row labels are not affected.
Returns the index of the first added row.
Adds the new rows with labels to the end of the array.
Returns the index of the first added row.
[signal]
void
QBarDataProxy::
arrayReset
()
This signal is emitted when the data array is reset. If the contents of the whole array are changed without calling resetArray (), this signal needs to be emitted to update the graph.
Inserts the new row row into rowIndex 。若 rowIndex is equal to the array size, the rows are added to the end of the array. The existing row labels are not affected.
注意: The row labels array will be out of sync with the row array after this call if there were labeled rows beyond the inserted row.
Inserts the new row row with the label label into rowIndex 。若 rowIndex is equal to array size, rows are added to the end of the array.
Inserts new rows into rowIndex 。若 rowIndex is equal to the array size, the rows are added to the end of the array. The existing row labels are not affected.
注意: The row labels array will be out of sync with the row array after this call if there were labeled rows beyond the inserted rows.
Inserts new rows with labels into rowIndex 。若 rowIndex is equal to the array size, the rows are added to the end of the array.
Returns the reference to the item at the position position . The x-value of position indicates the row and the y-value indicates the column. The item is guaranteed to be valid only until the next call that modifies data.
Returns the reference to the item at the position specified by rowIndex and columnIndex . It is guaranteed to be valid only until the next call that modifies data.
[signal]
void
QBarDataProxy::
itemChanged
(
qsizetype
rowIndex
,
qsizetype
columnIndex
)
This signal is emitted when the item at the position specified by rowIndex and columnIndex changes. If the item is changed in the array without calling setItem (), this signal needs to be emitted to update the graph.
Removes the number of rows specified by
removeCount
starting at the position
rowIndex
. Attempting to remove rows past the end of the array does nothing. If
removeLabels
is
true
, the corresponding row labels are also removed. Otherwise, the row labels are not affected.
注意:
若
removeLabels
is
false
, the row labels array will be out of sync with the row array if there are labeled rows beyond the removed rows.
Clears the existing array and row and column labels.
Takes ownership of the array newArray . Clears the existing array if the new array differs from it. If the arrays are the same, this function just triggers the arrayReset () 信号。
Passing a null array deletes the old array and creates a new empty array. Row and column labels are not affected.
Takes ownership of the array newArray . Clears the existing array if the new array differs from it. If the arrays are the same, this function just triggers the arrayReset () 信号。
Passing a null array deletes the old array and creates a new empty array.
The rowLabels and columnLabels lists specify the new labels for rows and columns.
Returns the reference to the row at the position rowIndex . It is guaranteed to be valid only until the next call that modifies data.
[signal]
void
QBarDataProxy::
rowsAdded
(
qsizetype
startIndex
,
qsizetype
count
)
This signal is emitted when the number of rows specified by count is added, starting at the position startIndex . If rows are added to the array without calling addRow () 或 addRows (), this signal needs to be emitted to update the graph.
[signal]
void
QBarDataProxy::
rowsChanged
(
qsizetype
startIndex
,
qsizetype
count
)
This signal is emitted when the number of rows specified by count is changed, starting at the position startIndex . If rows are changed in the array without calling setRow () 或 setRows (), this signal needs to be emitted to update the graph.
[signal]
void
QBarDataProxy::
rowsInserted
(
qsizetype
startIndex
,
qsizetype
count
)
This signal is emitted when the number of rows specified by count is inserted at the position startIndex .
If rows are inserted into the array without calling insertRow () 或 insertRows (), this signal needs to be emitted to update the graph.
[signal]
void
QBarDataProxy::
rowsRemoved
(
qsizetype
startIndex
,
qsizetype
count
)
This signal is emitted when the number of rows specified by count is removed, starting at the position startIndex .
The index is the current array size if the rows were removed from the end of the array. If rows are removed from the array without calling removeRows (), this signal needs to be emitted to update the graph.
Changes a single item at the position position to the item item . The x-value of position indicates the row and the y-value indicates the column.
Changes a single item at the position specified by rowIndex and columnIndex to the item item .
Changes an existing row by replacing the row at the position rowIndex with the new row specified by row . The new row can be the same as the existing row already stored at rowIndex . Existing row labels are not affected.
Changes an existing row by replacing the row at the position rowIndex with the new row specified by row . The new row can be the same as the existing row already stored at rowIndex . Changes the row label to label .
Changes existing rows by replacing the rows starting at the position rowIndex with the new rows specifies by rows . Existing row labels are not affected. The rows in the rows array can be the same as the existing rows already stored at rowIndex .
Changes existing rows by replacing the rows starting at the position rowIndex with the new rows specifies by rows . The row labels are changed to labels . The rows in the rows array can be the same as the existing rows already stored at rowIndex .
[alias]
QBarDataArray
A list of pointers to QBarDataRow 对象。
[alias]
QBarDataRow
A list of QBarDataItem 对象。