QBarDataProxy¶
The QBarDataProxy
class is the data proxy for a 3D bars graph. More…
Inherited by: QItemModelBarDataProxy
Synopsis¶
Functions¶
def
addRow
(arg__1)def
addRow
(arg__1, arg__2)def
addRows
(rows)def
addRows
(rows, labels)def
array
()def
columnLabels
()def
insertRow
(arg__1, arg__2)def
insertRow
(arg__1, arg__2, arg__3)def
insertRows
(rowIndex, rows)def
insertRows
(rowIndex, rows, labels)def
itemAt
(position)def
itemAt
(rowIndex, columnIndex)def
removeRows
(rowIndex, removeCount[, removeLabels=true])def
resetArray
()def
resetArray
(newArray)def
resetArray
(newArray, rowLabels, columnLabels)def
rowAt
(rowIndex)def
rowCount
()def
rowLabels
()def
series
()def
setColumnLabels
(labels)def
setItem
(position, item)def
setItem
(rowIndex, columnIndex, item)def
setRow
(arg__1, arg__2)def
setRow
(arg__1, arg__2, arg__3)def
setRowLabels
(labels)def
setRows
(rowIndex, rows)def
setRows
(rowIndex, rows, labels)
Signals¶
def
arrayReset
()def
columnLabelsChanged
()def
itemChanged
(rowIndex, columnIndex)def
rowCountChanged
(count)def
rowLabelsChanged
()def
rowsAdded
(startIndex, count)def
rowsChanged
(startIndex, count)def
rowsInserted
(startIndex, count)def
rowsRemoved
(startIndex, count)def
seriesChanged
(series)
Detailed Description¶
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 QtDataVisualization::QBarDataRow objects passed to it, whether directly or in a QtDataVisualization::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 and row manipulation methods provide alternate versions that do not affect the 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.
See also
- class PySide6.QtDataVisualization.QBarDataProxy([parent=None])¶
- Parameters
parent –
PySide6.QtCore.QObject
Constructs a bar data proxy with the given parent
.
- PySide6.QtDataVisualization.QBarDataProxy.addRow(arg__1, arg__2)¶
- Parameters
arg__1 –
arg__2 – str
- Return type
int
- PySide6.QtDataVisualization.QBarDataProxy.addRow(arg__1)
- Parameters
arg__1 –
- Return type
int
- PySide6.QtDataVisualization.QBarDataProxy.addRows(rows)¶
- Parameters
rows –
QBarDataArray
- Return type
int
Adds the new rows
to the end of an array. Existing row labels are not affected.
Returns the index of the first added row.
- PySide6.QtDataVisualization.QBarDataProxy.addRows(rows, labels)
- Parameters
rows –
QBarDataArray
labels – list of strings
- Return type
int
Adds the new rows
with labels
to the end of the array.
Returns the index of the first added row.
- PySide6.QtDataVisualization.QBarDataProxy.array()¶
- Return type
QBarDataArray
Returns the pointer to the data array.
- PySide6.QtDataVisualization.QBarDataProxy.arrayReset()¶
- PySide6.QtDataVisualization.QBarDataProxy.columnLabels()¶
- Return type
list of strings
This property holds The optional column labels for the array..
Indexes in this array match column indexes in rows. If the list is shorter than the longest row, all columns will not get labels.
- PySide6.QtDataVisualization.QBarDataProxy.columnLabelsChanged()¶
- PySide6.QtDataVisualization.QBarDataProxy.insertRow(arg__1, arg__2)¶
- Parameters
arg__1 – int
arg__2 –
- PySide6.QtDataVisualization.QBarDataProxy.insertRow(arg__1, arg__2, arg__3)
- Parameters
arg__1 – int
arg__2 –
arg__3 – str
- PySide6.QtDataVisualization.QBarDataProxy.insertRows(rowIndex, rows)¶
- Parameters
rowIndex – int
rows –
QBarDataArray
Inserts new rows
into rowIndex
. If rowIndex
is equal to the array size, the rows are added to the end of the array. The existing row labels are not affected.
Note
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.
- PySide6.QtDataVisualization.QBarDataProxy.insertRows(rowIndex, rows, labels)
- Parameters
rowIndex – int
rows –
QBarDataArray
labels – list of strings
Inserts new rows
with labels
into rowIndex
. If rowIndex
is equal to the array size, the rows are added to the end of the array.
- PySide6.QtDataVisualization.QBarDataProxy.itemAt(position)¶
- Parameters
position –
PySide6.QtCore.QPoint
- Return type
Returns the pointer 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.
- PySide6.QtDataVisualization.QBarDataProxy.itemAt(rowIndex, columnIndex)
- Parameters
rowIndex – int
columnIndex – int
- Return type
Returns the pointer 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.
- PySide6.QtDataVisualization.QBarDataProxy.itemChanged(rowIndex, columnIndex)¶
- Parameters
rowIndex – int
columnIndex – int
- PySide6.QtDataVisualization.QBarDataProxy.removeRows(rowIndex, removeCount[, removeLabels=true])¶
- Parameters
rowIndex – int
removeCount – int
removeLabels – bool
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.
Note
If 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.
- PySide6.QtDataVisualization.QBarDataProxy.resetArray()¶
Clears the existing array and row and column labels.
- PySide6.QtDataVisualization.QBarDataProxy.resetArray(newArray)
- Parameters
newArray –
QBarDataArray
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()
signal.
Passing a null array deletes the old array and creates a new empty array. Row and column labels are not affected.
- PySide6.QtDataVisualization.QBarDataProxy.resetArray(newArray, rowLabels, columnLabels)
- Parameters
newArray –
QBarDataArray
rowLabels – list of strings
columnLabels – list of strings
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()
signal.
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.
- PySide6.QtDataVisualization.QBarDataProxy.rowAt(rowIndex)¶
- Parameters
rowIndex – int
- Return type
QList
Returns the pointer to the row at the position rowIndex
. It is guaranteed to be valid only until the next call that modifies data.
- PySide6.QtDataVisualization.QBarDataProxy.rowCount()¶
- Return type
int
This property holds The number of rows in the array..
- PySide6.QtDataVisualization.QBarDataProxy.rowCountChanged(count)¶
- Parameters
count – int
- PySide6.QtDataVisualization.QBarDataProxy.rowLabels()¶
- Return type
list of strings
This property holds The optional row labels for the array..
Indexes in this array match the row indexes in the data array. If the list is shorter than the number of rows, all rows will not get labels.
- PySide6.QtDataVisualization.QBarDataProxy.rowLabelsChanged()¶
- PySide6.QtDataVisualization.QBarDataProxy.rowsAdded(startIndex, count)¶
- Parameters
startIndex – int
count – int
- PySide6.QtDataVisualization.QBarDataProxy.rowsChanged(startIndex, count)¶
- Parameters
startIndex – int
count – int
- PySide6.QtDataVisualization.QBarDataProxy.rowsInserted(startIndex, count)¶
- Parameters
startIndex – int
count – int
- PySide6.QtDataVisualization.QBarDataProxy.rowsRemoved(startIndex, count)¶
- Parameters
startIndex – int
count – int
- PySide6.QtDataVisualization.QBarDataProxy.series()¶
- Return type
This property holds The series this proxy is attached to..
- PySide6.QtDataVisualization.QBarDataProxy.seriesChanged(series)¶
- Parameters
- PySide6.QtDataVisualization.QBarDataProxy.setColumnLabels(labels)¶
- Parameters
labels – list of strings
This property holds The optional column labels for the array..
Indexes in this array match column indexes in rows. If the list is shorter than the longest row, all columns will not get labels.
- PySide6.QtDataVisualization.QBarDataProxy.setItem(position, item)¶
- Parameters
position –
PySide6.QtCore.QPoint
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.
- PySide6.QtDataVisualization.QBarDataProxy.setItem(rowIndex, columnIndex, item)
- Parameters
rowIndex – int
columnIndex – int
Changes a single item at the position specified by rowIndex
and columnIndex
to the item item
.
- PySide6.QtDataVisualization.QBarDataProxy.setRow(arg__1, arg__2)¶
- Parameters
arg__1 – int
arg__2 –
- PySide6.QtDataVisualization.QBarDataProxy.setRow(arg__1, arg__2, arg__3)
- Parameters
arg__1 – int
arg__2 –
arg__3 – str
- PySide6.QtDataVisualization.QBarDataProxy.setRowLabels(labels)¶
- Parameters
labels – list of strings
This property holds The optional row labels for the array..
Indexes in this array match the row indexes in the data array. If the list is shorter than the number of rows, all rows will not get labels.
- PySide6.QtDataVisualization.QBarDataProxy.setRows(rowIndex, rows)¶
- Parameters
rowIndex – int
rows –
QBarDataArray
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
.
- PySide6.QtDataVisualization.QBarDataProxy.setRows(rowIndex, rows, labels)
- Parameters
rowIndex – int
rows –
QBarDataArray
labels – list of strings
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
.
© 2022 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.