OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
CSVWorld::EnumDelegate Class Reference

Integer value that represents an enum and is interacted with via a combobox. More...

#include <enumdelegate.hpp>

Inheritance diagram for CSVWorld::EnumDelegate:
Collaboration diagram for CSVWorld::EnumDelegate:

Public Member Functions

 EnumDelegate (const std::vector< std::pair< int, QString > > &values, CSMWorld::CommandDispatcher *dispatcher, CSMDoc::Document &document, QObject *parent)
 
virtual QWidgetcreateEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
 
virtual QWidgetcreateEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index, CSMWorld::ColumnBase::Display display=CSMWorld::ColumnBase::Display_None) const
 
virtual void setEditorData (QWidget *editor, const QModelIndex &index, bool tryDisplay=false) const
 
virtual void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
 
virtual QSize sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const
 
- Public Member Functions inherited from CSVWorld::CommandDelegate
 CommandDelegate (CSMWorld::CommandDispatcher *commandDispatcher, CSMDoc::Document &document, QObject *parent)
 
virtual void setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
 
void setEditLock (bool locked)
 
bool isEditLocked () const
 
virtual void setEditorData (QWidget *editor, const QModelIndex &index) const
 
virtual void settingChanged (const CSMPrefs::Setting *setting)
 

Protected Member Functions

int getValueIndex (const QModelIndex &index, int role=Qt::DisplayRole) const
 
- Protected Member Functions inherited from CSVWorld::CommandDelegate
QUndoStack & getUndoStack () const
 
CSMDoc::DocumentgetDocument () const
 
CSMWorld::ColumnBase::Display getDisplayTypeFromIndex (const QModelIndex &index) const
 

Protected Attributes

std::vector< std::pair< int,
QString > > 
mValues
 

Private Member Functions

virtual void setModelDataImp (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
 
virtual void addCommands (QAbstractItemModel *model, const QModelIndex &index, int type) const
 

Detailed Description

Integer value that represents an enum and is interacted with via a combobox.

Constructor & Destructor Documentation

CSVWorld::EnumDelegate::EnumDelegate ( const std::vector< std::pair< int, QString > > &  values,
CSMWorld::CommandDispatcher dispatcher,
CSMDoc::Document document,
QObject parent 
)

Member Function Documentation

void CSVWorld::EnumDelegate::addCommands ( QAbstractItemModel model,
const QModelIndex &  index,
int  type 
) const
privatevirtual

Reimplemented in CSVWorld::VarTypeDelegate.

QWidget * CSVWorld::EnumDelegate::createEditor ( QWidget parent,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
virtual

Reimplemented from CSVWorld::CommandDelegate.

QWidget * CSVWorld::EnumDelegate::createEditor ( QWidget parent,
const QStyleOptionViewItem &  option,
const QModelIndex &  index,
CSMWorld::ColumnBase::Display  display = CSMWorld::ColumnBase::Display_None 
) const
virtual

Reimplemented from CSVWorld::CommandDelegate.

int CSVWorld::EnumDelegate::getValueIndex ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
protected
void CSVWorld::EnumDelegate::paint ( QPainter *  painter,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
virtual

Reimplemented in CSVWorld::DataDisplayDelegate.

Here is the caller graph for this function:

void CSVWorld::EnumDelegate::setEditorData ( QWidget editor,
const QModelIndex &  index,
bool  tryDisplay = false 
) const
virtual

Reimplemented from CSVWorld::CommandDelegate.

void CSVWorld::EnumDelegate::setModelDataImp ( QWidget editor,
QAbstractItemModel model,
const QModelIndex &  index 
) const
privatevirtual

Reimplemented from CSVWorld::CommandDelegate.

QSize CSVWorld::EnumDelegate::sizeHint ( const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
virtual

Reimplemented in CSVWorld::DataDisplayDelegate.

Here is the caller graph for this function:

Member Data Documentation

std::vector<std::pair<int, QString> > CSVWorld::EnumDelegate::mValues
protected

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