Crossfire Server, Trunk
CREMultilineItemDelegate Class Reference

#include <CREMultilineItemDelegate.h>

+ Inheritance diagram for CREMultilineItemDelegate:
+ Collaboration diagram for CREMultilineItemDelegate:

Public Member Functions

virtual QWidget * createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 
 CREMultilineItemDelegate (QObject *parent, bool asStringList=true, bool trimEmpty=false)
 
virtual void setEditorData (QWidget *editor, const QModelIndex &index) const override
 
virtual void setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
 
virtual ~CREMultilineItemDelegate ()
 

Private Attributes

bool myAsStringList
 
bool myTrimEmpty
 

Detailed Description

Allow the edition of a multiline item.

Definition at line 19 of file CREMultilineItemDelegate.h.

Constructor & Destructor Documentation

◆ CREMultilineItemDelegate()

CREMultilineItemDelegate::CREMultilineItemDelegate ( QObject *  parent,
bool  asStringList = true,
bool  trimEmpty = false 
)

Standard constructor.

Parameters
parentancestor of this item.
asStringListif true then data is a QStringList, else a QString.
trimEmptyif true then all empty items will be removed, onyl significant if asStringList is true.

Definition at line 17 of file CREMultilineItemDelegate.cpp.

◆ ~CREMultilineItemDelegate()

CREMultilineItemDelegate::~CREMultilineItemDelegate ( )
virtual

Definition at line 22 of file CREMultilineItemDelegate.cpp.

Member Function Documentation

◆ createEditor()

QWidget * CREMultilineItemDelegate::createEditor ( QWidget *  parent,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
overridevirtual

Definition at line 26 of file CREMultilineItemDelegate.cpp.

◆ setEditorData()

void CREMultilineItemDelegate::setEditorData ( QWidget *  editor,
const QModelIndex &  index 
) const
overridevirtual

Definition at line 33 of file CREMultilineItemDelegate.cpp.

References npc_dialog::index, and myAsStringList.

◆ setModelData()

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

Definition at line 58 of file CREMultilineItemDelegate.cpp.

References convert(), npc_dialog::index, myAsStringList, and myTrimEmpty.

+ Here is the call graph for this function:

Field Documentation

◆ myAsStringList

bool CREMultilineItemDelegate::myAsStringList
private

Definition at line 36 of file CREMultilineItemDelegate.h.

Referenced by setEditorData(), and setModelData().

◆ myTrimEmpty

bool CREMultilineItemDelegate::myTrimEmpty
private

Definition at line 37 of file CREMultilineItemDelegate.h.

Referenced by setModelData().


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