PySide6.QtGraphs.QBarDataProxy¶
- class QBarDataProxy¶
- The - QBarDataProxyclass is the data proxy for a 3D bars graph.- Details- A bar data proxy handles adding, inserting, changing, and removing rows of data. - The data array is a list of vectors (rows) of - QBarDataIteminstances. Each row can contain a different number of items or even be null.- QBarDataProxytakes 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.- QBarDataProxyoptionally keeps track of row and column labels, which- QCategory3DAxiscan 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. - See also - Inherited by: - QItemModelBarDataProxy- Synopsis¶- Properties¶- Methods¶- def - __init__()
- def - addRow()
- def - addRows()
- def - colCount()
- def - insertRow()
- def - insertRows()
- def - itemAt()
- def - removeRows()
- def - resetArray()
- def - rowAt()
- def - rowCount()
- def - series()
- def - setItem()
- def - setRow()
- def - setRows()
 - Signals¶- def - arrayReset()
- def - itemChanged()
- def - rowsAdded()
- def - rowsChanged()
- def - rowsInserted()
- def - rowsRemoved()
- def - seriesChanged()
 - Note - This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE - class RemoveLabels¶
- Added in version 6.8. 
 - Note - Properties can be used directly when - from __feature__ import true_propertyis used or via accessor functions otherwise.- property colCountᅟ: int¶
 - This property holds The number of columns in the array.. - Access functions:
- Signal - colCountChanged()
 
 - property rowCountᅟ: int¶
 - This property holds The number of rows in the array.. - Access functions:
- Signal - rowCountChanged()
 
 - property seriesᅟ: QBar3DSeries¶
 - This property holds The series this proxy is attached to.. - Access functions:
- Signal - seriesChanged()
 
 - Constructs a bar data proxy with the given - parent.- addRow(row)¶
- Parameters:
- row – .list of QBarDataItem 
- Return type:
- int 
 
 - Adds the new row - rowto the end of an array. Existing row labels are not affected.- Returns the index of the added row. - addRow(row, label)
- Parameters:
- row – .list of QBarDataItem 
- label – str 
 
- Return type:
- int 
 
 - Adds a the new row - rowwith the label- labelto the end of an array.- Returns the index of the added row. - addRows(rows)¶
- Parameters:
- rows – .list of list of QBarDataItem 
- Return type:
- int 
 
 - Adds the new - rowsto the end of an array. Existing row labels are not affected.- Returns the index of the first added row. - addRows(rows, labels)
- Parameters:
- rows – .list of list of QBarDataItem 
- labels – list of strings 
 
- Return type:
- int 
 
 - Adds the new - rowswith- labelsto the end of the array.- Returns the index of the first added row. - 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.- colCount()¶
- Return type:
- int 
 
 - Getter of property - colCountᅟ.- colCountChanged(count)¶
- Parameters:
- count – int 
 
 - Notification signal of property - colCountᅟ.- insertRow(rowIndex, row)¶
- Parameters:
- rowIndex – int 
- row – .list of QBarDataItem 
 
 
 - Inserts the new row - rowinto- rowIndex. If- rowIndexis 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 row. - insertRow(rowIndex, row, label)
- Parameters:
- rowIndex – int 
- row – .list of QBarDataItem 
- label – str 
 
 
 - Inserts the new row - rowwith the label- labelinto- rowIndex. If- rowIndexis equal to array size, rows are added to the end of the array.- insertRows(rowIndex, rows)¶
- Parameters:
- rowIndex – int 
- rows – .list of list of QBarDataItem 
 
 
 - Inserts new - rowsinto- rowIndex. If- rowIndexis 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. - insertRows(rowIndex, rows, labels)
- Parameters:
- rowIndex – int 
- rows – .list of list of QBarDataItem 
- labels – list of strings 
 
 
 - Inserts new - rowswith- labelsinto- rowIndex. If- rowIndexis 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- positionindicates the row and the y-value indicates the column. The item is guaranteed to be valid only until the next call that modifies data.- itemAt(rowIndex, columnIndex)
- Parameters:
- rowIndex – int 
- columnIndex – int 
 
- Return type:
 
 - Returns the reference to the item at the position specified by - rowIndexand- columnIndex. It is guaranteed to be valid only until the next call that modifies data.- itemChanged(rowIndex, columnIndex)¶
- Parameters:
- rowIndex – int 
- columnIndex – int 
 
 
 - This signal is emitted when the item at the position specified by - rowIndexand- columnIndexchanges. If the item is changed in the array without calling- setItem(), this signal needs to be emitted to update the graph.- removeRows(rowIndex, removeCount[, removeLabels=QBarDataProxy.RemoveLabels.No])¶
- Parameters:
- rowIndex – int 
- removeCount – int 
- removeLabels – - RemoveLabels
 
 
 - Removes the number of rows specified by - removeCountstarting at the position- rowIndex. Attempting to remove rows past the end of the array does nothing. If- removeLabelsis- true, the corresponding row labels are also removed. Otherwise, the row labels are not affected.- Note - If - removeLabelsis- false, the row labels array will be out of sync with the row array if there are labeled rows beyond the removed rows.- resetArray()¶
 - Clears the existing array and row and column labels. - resetArray(newArray)
- Parameters:
- newArray – .list of list of QBarDataItem 
 
 - 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. - resetArray(newArray, rowLabels, columnLabels)
- Parameters:
- newArray – .list of list of QBarDataItem 
- 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 - rowLabelsand- columnLabelslists specify the new labels for rows and columns.- rowAt(rowIndex)¶
- Parameters:
- rowIndex – int 
- Return type:
- .list of QBarDataItem 
 
 - Returns the reference to the row at the position - rowIndex. It is guaranteed to be valid only until the next call that modifies data.- rowCount()¶
- Return type:
- int 
 
 - Getter of property - rowCountᅟ.- rowCountChanged(count)¶
- Parameters:
- count – int 
 
 - Notification signal of property - rowCountᅟ.- rowsAdded(startIndex, count)¶
- Parameters:
- startIndex – int 
- count – int 
 
 
 - This signal is emitted when the number of rows specified by - countis added, starting at the position- startIndex. If rows are added to the array without calling- addRow()or- addRows(), this signal needs to be emitted to update the graph.- rowsChanged(startIndex, count)¶
- Parameters:
- startIndex – int 
- count – int 
 
 
 - This signal is emitted when the number of rows specified by - countis changed, starting at the position- startIndex. If rows are changed in the array without calling- setRow()or- setRows(), this signal needs to be emitted to update the graph.- rowsInserted(startIndex, count)¶
- Parameters:
- startIndex – int 
- count – int 
 
 
 - This signal is emitted when the number of rows specified by - countis inserted at the position- startIndex.- If rows are inserted into the array without calling - insertRow()or- insertRows(), this signal needs to be emitted to update the graph.- rowsRemoved(startIndex, count)¶
- Parameters:
- startIndex – int 
- count – int 
 
 
 - This signal is emitted when the number of rows specified by - countis 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.- series()¶
- Return type:
 
 - Getter of property - seriesᅟ.- seriesChanged(series)¶
- Parameters:
- series – - QBar3DSeries
 
 - Notification signal of property - seriesᅟ.- setItem(position, item)¶
- Parameters:
- position – - QPoint
- item – - QBarDataItem
 
 
 - Changes a single item at the position - positionto the item- item. The x-value of- positionindicates the row and the y-value indicates the column.- setItem(rowIndex, columnIndex, item)
- Parameters:
- rowIndex – int 
- columnIndex – int 
- item – - QBarDataItem
 
 
 - Changes a single item at the position specified by - rowIndexand- columnIndexto the item- item.- setRow(rowIndex, row)¶
- Parameters:
- rowIndex – int 
- row – .list of QBarDataItem 
 
 
 - Changes an existing row by replacing the row at the position - rowIndexwith 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.- setRow(rowIndex, row, label)
- Parameters:
- rowIndex – int 
- row – .list of QBarDataItem 
- label – str 
 
 
 - Changes an existing row by replacing the row at the position - rowIndexwith 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.- setRows(rowIndex, rows)¶
- Parameters:
- rowIndex – int 
- rows – .list of list of QBarDataItem 
 
 
 - Changes existing rows by replacing the rows starting at the position - rowIndexwith the new rows specifies by- rows. Existing row labels are not affected. The rows in the- rowsarray can be the same as the existing rows already stored at- rowIndex.- setRows(rowIndex, rows, labels)
- Parameters:
- rowIndex – int 
- rows – .list of list of QBarDataItem 
- labels – list of strings 
 
 
 - Changes existing rows by replacing the rows starting at the position - rowIndexwith the new rows specifies by- rows. The row labels are changed to- labels. The rows in the- rowsarray can be the same as the existing rows already stored at- rowIndex.