|
VR-Engage
2.2
|
This class implements a Qt table model for displaying and editing VREngage application information, including application names, assigned entities, station roles, and spectator mode settings.
#include <vreTableModel.h>
Public Types | |
| using | VreRecord |
| using | VreTable = std::vector<VreRecord> |
Public Member Functions | |
| DtVreTableModel (QObject *parent) | |
| virtual | ~DtVreTableModel () override |
| virtual int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
| virtual int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
| virtual QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
| virtual bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override |
| virtual QVariant | headerData (int section, Qt::Orientation orientation, int role) const override |
| virtual Qt::ItemFlags | flags (const QModelIndex &index) const override |
| virtual void | addEntry (const VreRecord &vreRecord) |
| virtual void | removeEntry (unsigned long id) |
| virtual void | updateEntry (unsigned long id, const VreRecord &vreRecord) |
| virtual unsigned long | id (int row) const |
| virtual std::string | entityUUID (int row) const |
| virtual bool | isDirty (int row) const |
| virtual void | setDirty (int row, bool flag) |
| virtual bool | tableIsDirty () const |
| virtual void | clearDirtyFlags () |
Protected Attributes | |
| VreTable | myData |
Structure containing VREngage application status information.
Contains all the information about a VREngage application's identity and current configuration settings displayed in the manager table.
| using DtVreTableModel::VreTable = std::vector<VreRecord> |
Type definition for the table data container.
Vector of VREngage application records that makes up the table data.
| DtVreTableModel::DtVreTableModel | ( | QObject * | parent | ) |
Constructor.
| parent | The parent QObject |
Initializes a new table model for VREngage application data.
|
overridevirtual |
Destructor.
Cleans up resources used by the table model.
|
overridevirtual |
Gets the number of rows in the model.
| parent | The parent model index |
Returns the number of rows (VREngage applications) in the table model.
|
overridevirtual |
Gets the number of columns in the model.
| parent | The parent model index |
Returns the number of columns (data fields) in the table model.
|
overridevirtual |
Gets data for a cell in the table.
| index | The model index of the cell |
| role | The data role (display, edit, etc.) |
Returns the data for the specified cell and role. Handles display formatting, editor setup, and other data presentation aspects.
|
overridevirtual |
Sets data for a cell in the table.
| index | The model index of the cell to modify |
| value | The new value to set |
| role | The data role (usually Qt::EditRole) |
Updates the data for the specified cell and marks the record as dirty to indicate that changes need to be saved.
|
overridevirtual |
Gets header data for the table.
| section | The row or column number |
| orientation | The header orientation (horizontal or vertical) |
| role | The data role |
Returns header labels for the table columns.
|
overridevirtual |
Gets flags for an item in the table.
| index | The model index of the item |
Returns the flags for the specified item, including whether it's editable, selectable, enabled, etc.
|
virtual |
Adds a new VREngage application entry to the table.
| vreRecord | The record to add |
Adds a new VREngage application record to the table model and notifies views that the model has changed.
|
virtual |
Removes a VREngage application entry from the table.
| id | The unique identifier of the application to remove |
Removes the VREngage application with the specified ID from the table model and notifies views that the model has changed.
|
virtual |
Updates an existing VREngage application entry.
| id | The unique identifier of the application to update |
| vreRecord | The new record data |
Updates the data for the VREngage application with the specified ID and notifies views that the model has changed.
|
virtual |
Gets the ID of a VREngage application by row.
| row | The row index |
Returns the unique identifier of the VREngage application at the specified row. TODO – make these official columns and hide them
|
virtual |
Gets the entity UUID for a row.
| row | The row index |
Returns the UUID of the entity assigned to the VREngage application at the specified row.
|
virtual |
Checks if a row has unsaved changes.
| row | The row index |
Returns whether the VREngage application record at the specified row has unsaved changes.
|
virtual |
Sets the dirty flag for a row.
| row | The row index |
| flag | The new dirty state |
Sets whether the VREngage application record at the specified row has unsaved changes.
|
virtual |
Checks if any rows in the table have unsaved changes.
Returns whether any VREngage application records in the table have unsaved changes.
|
virtual |
Clears all dirty flags in the table.
Marks all VREngage application records in the table as clean (no unsaved changes). Called after changes have been saved or reverted.
|
protected |
The table data.
Container for all VREngage application records in the table.