PySide6.QtCore.QModelRoleData¶
- class QModelRoleData¶
- The - QModelRoleDataclass holds a role and the data associated to that role. More…- Synopsis¶- Methods¶- def - __init__()
- def - clearData()
- def - data()
- def - role()
- def - setData()
 - 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¶- QModelRoleDataobjects store an item role (which is a value from the- ItemDataRoleenumeration, or an arbitrary integer for a custom role) as well as the data associated with that role.- A - QModelRoleDataobject 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 - __init__(role)¶
- Parameters:
- role – int 
 
 - Constructs a - QModelRoleDataobject for the given- role.- See also - clearData()¶
 - Clears the data held by this object. Note that the role is unchanged; only the data is cleared. - See also - data()¶
- Return type:
- object 
 
 - Returns the data held by this object. - See also - role()¶
- Return type:
- int 
 
 - Returns the role held by this object. - See also - setData(data)¶
- Parameters:
- data – object