VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtRoleItemDelegate Class Reference

Detailed Description

This delegate provides a combobox editor for selecting roles in the VREngage Manager interface. It handles the creation, population, and manipulation of the combobox editor for role selection cells in the manager's table view.

#include <roleItemDelegate.h>

Inheritance diagram for makVre::DtRoleItemDelegate:
[legend]

Public Member Functions

 DtRoleItemDelegate (QObject *parent=0)
 
virtual ~DtRoleItemDelegate () 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
 

Protected Slots

virtual void onActivated (int index)
 

Protected Attributes

QComboBox * myEditor
 

Constructor & Destructor Documentation

◆ DtRoleItemDelegate()

makVre::DtRoleItemDelegate::DtRoleItemDelegate ( QObject * parent = 0)

Constructor.

Parameters
parentThe parent object

Initializes a new role item delegate with the specified parent.

◆ ~DtRoleItemDelegate()

virtual makVre::DtRoleItemDelegate::~DtRoleItemDelegate ( )
overridevirtual

Destructor.

Cleans up resources used by the role item delegate.

Member Function Documentation

◆ createEditor()

virtual QWidget * makVre::DtRoleItemDelegate::createEditor ( QWidget * parent,
const QStyleOptionViewItem & option,
const QModelIndex & index ) const
overridevirtual

Creates a combobox editor for role selection.

Parameters
parentThe parent widget
optionThe style options to use when drawing the editor
indexThe model index of the item being edited
Returns
A combobox widget configured for role selection

Creates and configures a combobox editor for selecting roles.

◆ destroyEditor()

virtual void makVre::DtRoleItemDelegate::destroyEditor ( QWidget * editor,
const QModelIndex & index ) const
overridevirtual

Destroys the editor when editing is finished.

Parameters
editorThe editor widget to destroy
indexThe model index of the item that was being edited

Handles cleanup of the editor widget when editing is complete.

◆ setEditorData()

virtual void makVre::DtRoleItemDelegate::setEditorData ( QWidget * editor,
const QModelIndex & index ) const
overridevirtual

Sets the editor data based on the model index.

Parameters
editorThe editor widget to update
indexThe model index containing the data to edit

Populates the editor with data from the model.

◆ setModelData()

virtual void makVre::DtRoleItemDelegate::setModelData ( QWidget * editor,
QAbstractItemModel * model,
const QModelIndex & index ) const
overridevirtual

Updates the model with data from the editor.

Parameters
editorThe editor widget containing the updated data
modelThe model to update
indexThe model index to update

Transfers the data from the editor back to the model when editing is complete.

◆ onActivated

virtual void makVre::DtRoleItemDelegate::onActivated ( int index)
protectedvirtualslot

Handles combobox activation.

Parameters
indexThe index of the activated item

Called when an item in the combobox is activated/selected.

Member Data Documentation

◆ myEditor

QComboBox* makVre::DtRoleItemDelegate::myEditor
mutableprotected

The combobox editor widget.

Maintains a reference to the currently active combobox editor. Declared mutable to allow modification in const methods.


The documentation for this class was generated from the following file: