This delegate provides a checkbox editor for toggling spectator mode in the VREngage Manager interface. It handles the creation, display, and manipulation of the checkbox editor for spectator mode cells in the manager's table view.
#include <spectatorItemDelegate.h>
|
| | DtSpectatorItemDelegate (QObject *parent=0) |
| |
| virtual | ~DtSpectatorItemDelegate () override |
| |
| virtual QWidget * | createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override |
| |
| virtual void | destroyEditor (QWidget *editor, const QModelIndex &index) const override |
| |
| virtual void | setEditorData (QWidget *editor, const QModelIndex &index) const override |
| |
| virtual void | setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override |
| |
| virtual void | paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override |
| |
| virtual void | updateEditorGeometry (QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const override |
| |
◆ DtSpectatorItemDelegate()
| DtSpectatorItemDelegate::DtSpectatorItemDelegate |
( |
QObject * | parent = 0 | ) |
|
Constructor.
- Parameters
-
Initializes a new spectator item delegate with the specified parent.
◆ ~DtSpectatorItemDelegate()
| virtual DtSpectatorItemDelegate::~DtSpectatorItemDelegate |
( |
| ) |
|
|
overridevirtual |
Destructor.
Cleans up resources used by the spectator item delegate.
◆ createEditor()
| virtual QWidget * DtSpectatorItemDelegate::createEditor |
( |
QWidget * | parent, |
|
|
const QStyleOptionViewItem & | option, |
|
|
const QModelIndex & | index ) const |
|
overridevirtual |
Creates a checkbox editor for spectator mode selection.
- Parameters
-
| parent | The parent widget |
| option | The style options to use when drawing the editor |
| index | The model index of the item being edited |
- Returns
- A checkbox widget configured for spectator mode selection
Creates and configures a checkbox editor for toggling spectator mode.
◆ destroyEditor()
| virtual void DtSpectatorItemDelegate::destroyEditor |
( |
QWidget * | editor, |
|
|
const QModelIndex & | index ) const |
|
overridevirtual |
Destroys the editor when editing is finished.
- Parameters
-
| editor | The editor widget to destroy |
| index | The model index of the item that was being edited |
Handles cleanup of the editor widget when editing is complete.
◆ setEditorData()
| virtual void DtSpectatorItemDelegate::setEditorData |
( |
QWidget * | editor, |
|
|
const QModelIndex & | index ) const |
|
overridevirtual |
Sets the editor data based on the model index.
- Parameters
-
| editor | The editor widget to update |
| index | The model index containing the data to edit |
Populates the checkbox with data from the model (checked/unchecked state).
◆ setModelData()
| virtual void DtSpectatorItemDelegate::setModelData |
( |
QWidget * | editor, |
|
|
QAbstractItemModel * | model, |
|
|
const QModelIndex & | index ) const |
|
overridevirtual |
Updates the model with data from the editor.
- Parameters
-
| editor | The editor widget containing the updated data |
| model | The model to update |
| index | The model index to update |
Transfers the checkbox state back to the model when editing is complete.
◆ paint()
| virtual void DtSpectatorItemDelegate::paint |
( |
QPainter * | painter, |
|
|
const QStyleOptionViewItem & | option, |
|
|
const QModelIndex & | index ) const |
|
overridevirtual |
Custom painting for the checkbox in the view.
- Parameters
-
| painter | The painter to use for drawing |
| option | The style options to use when drawing |
| index | The model index of the item to draw |
Handles custom drawing of the checkbox in the view when not being edited.
◆ updateEditorGeometry()
| virtual void DtSpectatorItemDelegate::updateEditorGeometry |
( |
QWidget * | editor, |
|
|
const QStyleOptionViewItem & | option, |
|
|
const QModelIndex & | index ) const |
|
overridevirtual |
Updates the editor's geometry.
- Parameters
-
| editor | The editor widget to update |
| option | The style options to use when positioning |
| index | The model index of the item being edited |
Positions the checkbox editor appropriately in the cell.
◆ onStateChanged
| virtual void DtSpectatorItemDelegate::onStateChanged |
( |
int | state | ) |
|
|
protectedvirtualslot |
Handles checkbox state changes.
- Parameters
-
| state | The new state of the checkbox |
Called when the checkbox state changes between checked and unchecked.
◆ myEditor
| QCheckBox* DtSpectatorItemDelegate::myEditor |
|
mutableprotected |
The checkbox editor widget.
Maintains a reference to the currently active checkbox editor. Declared mutable to allow modification in const methods.
The documentation for this class was generated from the following file: