QItemModelScatterDataProxy#
Proxy class for presenting data in item models with Q3DScatter
. More…
Synopsis#
Properties#
itemModel
- Item model to use as a data source for a 3D scatter seriesrotationRole
- Item model role to map into item rotationrotationRolePattern
- Whether a search and replace is done on the value mapped by the rotation role before it is used as item rotationrotationRoleReplace
- Replace content to be used in conjunction with the rotation role patternxPosRole
- Item model role to map into the X positionxPosRolePattern
- Whether search and replace is done on the value mapped by the x position role before it is used as an item position valuexPosRoleReplace
- Replace content to be used in conjunction with the x position role patternyPosRole
- Item model role to map into the Y positionyPosRolePattern
- Whether a search and replace is done on the value mapped by the y position role before it is used as an item position valueyPosRoleReplace
- Replace content to be used in conjunction with the y position role patternzPosRole
- Item model role to map into the Z positionzPosRolePattern
- Whether a search and replace is done on the value mapped by the z position role before it is used as an item position valuezPosRoleReplace
- Replace content to be used in conjunction with the z position role pattern
Functions#
def
itemModel
()def
remap
(xPosRole, yPosRole, zPosRole, rotationRole)def
rotationRole
()def
rotationRolePattern
()def
rotationRoleReplace
()def
setItemModel
(itemModel)def
setRotationRole
(role)def
setRotationRolePattern
(pattern)def
setRotationRoleReplace
(replace)def
setXPosRole
(role)def
setXPosRolePattern
(pattern)def
setXPosRoleReplace
(replace)def
setYPosRole
(role)def
setYPosRolePattern
(pattern)def
setYPosRoleReplace
(replace)def
setZPosRole
(role)def
setZPosRolePattern
(pattern)def
setZPosRoleReplace
(replace)def
xPosRole
()def
xPosRolePattern
()def
xPosRoleReplace
()def
yPosRole
()def
yPosRolePattern
()def
yPosRoleReplace
()def
zPosRole
()def
zPosRolePattern
()def
zPosRoleReplace
()
Signals#
def
itemModelChanged
(itemModel)def
rotationRoleChanged
(role)def
rotationRolePatternChanged
(pattern)def
rotationRoleReplaceChanged
(replace)def
xPosRoleChanged
(role)def
xPosRolePatternChanged
(pattern)def
xPosRoleReplaceChanged
(replace)def
yPosRoleChanged
(role)def
yPosRolePatternChanged
(pattern)def
yPosRoleReplaceChanged
(replace)def
zPosRoleChanged
(role)def
zPosRolePatternChanged
(pattern)def
zPosRoleReplaceChanged
(replace)
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
Detailed Description#
Warning
This section contains snippets that were automatically translated from C++ to Python and may contain errors.
QItemModelScatterDataProxy
allows you to use QAbstractItemModel
derived models as a data source for Q3DScatter
. It maps roles of QAbstractItemModel
to the XYZ-values of Q3DScatter
points.
The data is resolved asynchronously whenever the mapping or the model changes. arrayReset()
is emitted when the data has been resolved. However, inserts, removes, and single data item changes after the model initialization are resolved synchronously, unless the same frame also contains a change that causes the whole model to be resolved.
Mapping ignores rows and columns of the QAbstractItemModel
and treats all items equally. It requires the model to provide roles for the data items that can be mapped to X, Y, and Z-values for the scatter points.
For example, assume that you have a custom QAbstractItemModel
for storing various measurements done on material samples, providing data for roles such as “density”, “hardness”, and “conductivity”. You could visualize these properties on a scatter graph using this proxy:
# Map "density" value to X-axis, "hardness" to Y-axis and "conductivity" to Z-axis. proxy = QItemModelScatterDataProxy(customModel,() "density", "hardness", "conductivity")
If the fields of the model do not contain the data in the exact format you need, you can specify a search pattern regular expression and a replace rule for each role to get the value in a format you need. For more information how the replace using regular expressions works, see replace
(const QRegularExpression
&rx, const QString
&after) function documentation. Note that using regular expressions has an impact on the performance, so it’s more efficient to utilize item models where doing search and replace is not necessary to get the desired values.
For example about using the search patterns in conjunction with the roles, see ItemModelBarDataProxy usage in Simple Bar Graph example.
See also
- class PySide6.QtDataVisualization.QItemModelScatterDataProxy(itemModel[, parent=None])#
PySide6.QtDataVisualization.QItemModelScatterDataProxy(itemModel, xPosRole, yPosRole, zPosRole[, parent=None])
PySide6.QtDataVisualization.QItemModelScatterDataProxy(itemModel, xPosRole, yPosRole, zPosRole, rotationRole[, parent=None])
PySide6.QtDataVisualization.QItemModelScatterDataProxy([parent=None])
- Parameters:
itemModel –
PySide6.QtCore.QAbstractItemModel
xPosRole – str
rotationRole – str
yPosRole – str
zPosRole – str
parent –
PySide6.QtCore.QObject
Constructs QItemModelScatterDataProxy
with itemModel
and optional parent
. Proxy doesn’t take ownership of the itemModel
, as typically item models are owned by other controls.
Constructs QItemModelScatterDataProxy
with itemModel
and optional parent
. Proxy doesn’t take ownership of the itemModel
, as typically item models are owned by other controls. The xPosRole
property is set to xPosRole
, yPosRole
property to yPosRole
, and zPosRole
property to zPosRole
.
Constructs QItemModelScatterDataProxy
with itemModel
and optional parent
. Proxy doesn’t take ownership of the itemModel
, as typically item models are owned by other controls. The xPosRole
property is set to xPosRole
, yPosRole
property to yPosRole
, zPosRole
property to zPosRole
, and rotationRole
property to rotationRole
.
Constructs QItemModelScatterDataProxy
with optional parent
.
Note
Properties can be used directly when from __feature__ import true_property
is used or via accessor functions otherwise.
- property PᅟySide6.QtDataVisualization.QItemModelScatterDataProxy.itemModel: PySide6.QtCore.QAbstractItemModel#
This property holds The item model to use as a data source for a 3D scatter series..
- Access functions:
itemModel
()setItemModel
(itemModel)Signal
itemModelChanged
(itemModel)
- property PᅟySide6.QtDataVisualization.QItemModelScatterDataProxy.rotationRole: str#
This property holds The item model role to map into item rotation..
The model may supply the value for rotation as either variant that is directly convertible to QQuaternion
, or as one of the string representations: "scalar,x,y,z"
or "@angle,x,y,z"
. The first will construct the quaternion directly with given values, and the second one will construct the quaternion using fromAxisAndAngle()
method.
- Access functions:
rotationRole
()setRotationRole
(role)Signal
rotationRoleChanged
(role)
- property PᅟySide6.QtDataVisualization.QItemModelScatterDataProxy.rotationRolePattern: PySide6.QtCore.QRegularExpression#
This property holds Whether a search and replace is done on the value mapped by the rotation role before it is used as item rotation..
This property specifies the regular expression to find the portion of the mapped value to replace and rotationRoleReplace
property contains the replacement string.
See also
- Access functions:
setRotationRolePattern
(pattern)Signal
rotationRolePatternChanged
(pattern)
- property PᅟySide6.QtDataVisualization.QItemModelScatterDataProxy.rotationRoleReplace: str#
This property holds The replace content to be used in conjunction with the rotation role pattern..
Defaults to an empty string. For more information on how the search and replace using regular expressions works, see replace
(const QRegularExpression
&rx, const QString
&after) function documentation.
See also
- Access functions:
setRotationRoleReplace
(replace)Signal
rotationRoleReplaceChanged
(replace)
- property PᅟySide6.QtDataVisualization.QItemModelScatterDataProxy.xPosRole: str#
This property holds The item model role to map into the X position..
- Access functions:
xPosRole
()setXPosRole
(role)Signal
xPosRoleChanged
(role)
- property PᅟySide6.QtDataVisualization.QItemModelScatterDataProxy.xPosRolePattern: PySide6.QtCore.QRegularExpression#
This property holds Whether search and replace is done on the value mapped by the x position role before it is used as an item position value..
This property specifies the regular expression to find the portion of the mapped value to replace and xPosRoleReplace
property contains the replacement string.
See also
- Access functions:
setXPosRolePattern
(pattern)Signal
xPosRolePatternChanged
(pattern)
- property PᅟySide6.QtDataVisualization.QItemModelScatterDataProxy.xPosRoleReplace: str#
This property holds The replace content to be used in conjunction with the x position role pattern..
Defaults to an empty string. For more information on how the search and replace using regular expressions works, see replace
(const QRegularExpression
&rx, const QString
&after) function documentation.
See also
- Access functions:
setXPosRoleReplace
(replace)Signal
xPosRoleReplaceChanged
(replace)
- property PᅟySide6.QtDataVisualization.QItemModelScatterDataProxy.yPosRole: str#
This property holds The item model role to map into the Y position..
- Access functions:
yPosRole
()setYPosRole
(role)Signal
yPosRoleChanged
(role)
- property PᅟySide6.QtDataVisualization.QItemModelScatterDataProxy.yPosRolePattern: PySide6.QtCore.QRegularExpression#
This property holds Whether a search and replace is done on the value mapped by the y position role before it is used as an item position value..
This property specifies the regular expression to find the portion of the mapped value to replace and yPosRoleReplace
property contains the replacement string.
See also
- Access functions:
setYPosRolePattern
(pattern)Signal
yPosRolePatternChanged
(pattern)
- property PᅟySide6.QtDataVisualization.QItemModelScatterDataProxy.yPosRoleReplace: str#
This property holds The replace content to be used in conjunction with the y position role pattern..
Defaults to an empty string. For more information on how the search and replace using regular expressions works, see replace
(const QRegularExpression
&rx, const QString
&after) function documentation.
See also
- Access functions:
setYPosRoleReplace
(replace)Signal
yPosRoleReplaceChanged
(replace)
- property PᅟySide6.QtDataVisualization.QItemModelScatterDataProxy.zPosRole: str#
This property holds The item model role to map into the Z position..
- Access functions:
zPosRole
()setZPosRole
(role)Signal
zPosRoleChanged
(role)
- property PᅟySide6.QtDataVisualization.QItemModelScatterDataProxy.zPosRolePattern: PySide6.QtCore.QRegularExpression#
This property holds Whether a search and replace is done on the value mapped by the z position role before it is used as an item position value..
This property specifies the regular expression to find the portion of the mapped value to replace and zPosRoleReplace
property contains the replacement string.
See also
- Access functions:
setZPosRolePattern
(pattern)Signal
zPosRolePatternChanged
(pattern)
- property PᅟySide6.QtDataVisualization.QItemModelScatterDataProxy.zPosRoleReplace: str#
This property holds The replace content to be used in conjunction with the z position role pattern..
Defaults to an empty string. For more information on how the search and replace using regular expressions works, see replace
(const QRegularExpression
&rx, const QString
&after) function documentation.
See also
- Access functions:
setZPosRoleReplace
(replace)Signal
zPosRoleReplaceChanged
(replace)
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.itemModel()#
- Return type:
See also
Getter of property itemModel
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.itemModelChanged(itemModel)#
- Parameters:
itemModel –
PySide6.QtCore.QAbstractItemModel
Notification signal of property itemModel
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.remap(xPosRole, yPosRole, zPosRole, rotationRole)#
- Parameters:
xPosRole – str
yPosRole – str
zPosRole – str
rotationRole – str
Changes xPosRole
, yPosRole
, zPosRole
, and rotationRole
mapping.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.rotationRole()#
- Return type:
str
See also
Getter of property rotationRole
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.rotationRoleChanged(role)#
- Parameters:
role – str
Notification signal of property rotationRole
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.rotationRolePattern()#
- Return type:
See also
Getter of property rotationRolePattern
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.rotationRolePatternChanged(pattern)#
- Parameters:
pattern –
PySide6.QtCore.QRegularExpression
Notification signal of property rotationRolePattern
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.rotationRoleReplace()#
- Return type:
str
See also
Getter of property rotationRoleReplace
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.rotationRoleReplaceChanged(replace)#
- Parameters:
replace – str
Notification signal of property rotationRoleReplace
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.setItemModel(itemModel)#
- Parameters:
itemModel –
PySide6.QtCore.QAbstractItemModel
Sets itemModel
as the item model for Q3DScatter
. Does not take ownership of the model, but does connect to it to listen for changes.
See also
Setter of property itemModel
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.setRotationRole(role)#
- Parameters:
role – str
See also
Setter of property rotationRole
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.setRotationRolePattern(pattern)#
- Parameters:
pattern –
PySide6.QtCore.QRegularExpression
See also
Setter of property rotationRolePattern
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.setRotationRoleReplace(replace)#
- Parameters:
replace – str
See also
Setter of property rotationRoleReplace
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.setXPosRole(role)#
- Parameters:
role – str
See also
Setter of property xPosRole
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.setXPosRolePattern(pattern)#
- Parameters:
pattern –
PySide6.QtCore.QRegularExpression
See also
Setter of property xPosRolePattern
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.setXPosRoleReplace(replace)#
- Parameters:
replace – str
See also
Setter of property xPosRoleReplace
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.setYPosRole(role)#
- Parameters:
role – str
See also
Setter of property yPosRole
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.setYPosRolePattern(pattern)#
- Parameters:
pattern –
PySide6.QtCore.QRegularExpression
See also
Setter of property yPosRolePattern
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.setYPosRoleReplace(replace)#
- Parameters:
replace – str
See also
Setter of property yPosRoleReplace
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.setZPosRole(role)#
- Parameters:
role – str
See also
Setter of property zPosRole
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.setZPosRolePattern(pattern)#
- Parameters:
pattern –
PySide6.QtCore.QRegularExpression
See also
Setter of property zPosRolePattern
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.setZPosRoleReplace(replace)#
- Parameters:
replace – str
See also
Setter of property zPosRoleReplace
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.xPosRole()#
- Return type:
str
See also
Getter of property xPosRole
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.xPosRoleChanged(role)#
- Parameters:
role – str
Notification signal of property xPosRole
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.xPosRolePattern()#
- Return type:
See also
Getter of property xPosRolePattern
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.xPosRolePatternChanged(pattern)#
- Parameters:
pattern –
PySide6.QtCore.QRegularExpression
Notification signal of property xPosRolePattern
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.xPosRoleReplace()#
- Return type:
str
See also
Getter of property xPosRoleReplace
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.xPosRoleReplaceChanged(replace)#
- Parameters:
replace – str
Notification signal of property xPosRoleReplace
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.yPosRole()#
- Return type:
str
See also
Getter of property yPosRole
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.yPosRoleChanged(role)#
- Parameters:
role – str
Notification signal of property yPosRole
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.yPosRolePattern()#
- Return type:
See also
Getter of property yPosRolePattern
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.yPosRolePatternChanged(pattern)#
- Parameters:
pattern –
PySide6.QtCore.QRegularExpression
Notification signal of property yPosRolePattern
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.yPosRoleReplace()#
- Return type:
str
See also
Getter of property yPosRoleReplace
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.yPosRoleReplaceChanged(replace)#
- Parameters:
replace – str
Notification signal of property yPosRoleReplace
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.zPosRole()#
- Return type:
str
See also
Getter of property zPosRole
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.zPosRoleChanged(role)#
- Parameters:
role – str
Notification signal of property zPosRole
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.zPosRolePattern()#
- Return type:
See also
Getter of property zPosRolePattern
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.zPosRolePatternChanged(pattern)#
- Parameters:
pattern –
PySide6.QtCore.QRegularExpression
Notification signal of property zPosRolePattern
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.zPosRoleReplace()#
- Return type:
str
See also
Getter of property zPosRoleReplace
.
- PySide6.QtDataVisualization.QItemModelScatterDataProxy.zPosRoleReplaceChanged(replace)#
- Parameters:
replace – str
Notification signal of property zPosRoleReplace
.