QModelRoleData¶
The QModelRoleData
class holds a role and the data associated to that role. More…
Synopsis¶
Functions¶
Detailed Description¶
QModelRoleData
objects store an item role (which is a value from the ItemDataRole
enumeration, or an arbitrary integer for a custom role) as well as the data associated with that role.
A QModelRoleData
object is typically created by views or delegates, setting which role they want to fetch the data for. The object is then passed to models (see multiData()
), which populate the data corresponding to the role stored. Finally, the view visualizes the data retrieved from the model.
See also
Model/View Programming
QModelRoleDataSpan
- class PySide6.QtCore.QModelRoleData(QModelRoleData)¶
PySide6.QtCore.QModelRoleData(role)
- Parameters
role – int
QModelRoleData –
PySide6.QtCore.QModelRoleData
Constructs a QModelRoleData
object for the given role
.
See also
ItemDataRole
- PySide6.QtCore.QModelRoleData.clearData()¶
Clears the data held by this object. Note that the role is unchanged; only the data is cleared.
See also
- PySide6.QtCore.QModelRoleData.data()¶
- Return type
object
Returns the data held by this object.
See also
setData()
- PySide6.QtCore.QModelRoleData.role()¶
- Return type
int
Returns the role held by this object.
See also
ItemDataRole
© 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.