#include <datadisplaydelegate.hpp>
|
typedef std::vector< std::pair
< int, QIcon > > | IconList |
|
typedef std::vector< std::pair
< int, QString > > | ValueList |
|
|
| DataDisplayDelegate (const ValueList &values, const IconList &icons, CSMWorld::CommandDispatcher *dispatcher, CSMDoc::Document &document, const std::string &pageName, const std::string &settingName, QObject *parent) |
|
| ~DataDisplayDelegate () |
|
virtual void | paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const |
|
virtual QSize | sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const |
|
void | setIconSize (const QSize &icon) |
| pass a QSize defining height / width of icon. Default is QSize (16,16). More...
|
|
void | setTextLeftOffset (int offset) |
| offset the horizontal position of the text from the right edge of the icon. Default is 8 pixels. More...
|
|
| EnumDelegate (const std::vector< std::pair< int, QString > > &values, CSMWorld::CommandDispatcher *dispatcher, CSMDoc::Document &document, QObject *parent) |
|
virtual QWidget * | createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const |
|
virtual QWidget * | createEditor (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 |
|
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 |
|
Enumerator |
---|
Mode_TextOnly |
|
Mode_IconOnly |
|
Mode_IconAndText |
|
CSVWorld::DataDisplayDelegate::~DataDisplayDelegate |
( |
| ) |
|
void CSVWorld::DataDisplayDelegate::buildPixmaps |
( |
| ) |
|
|
private |
rebuild the list of pixmaps from the provided icons (called when icon size is changed)
void CSVWorld::DataDisplayDelegate::paint |
( |
QPainter * |
painter, |
|
|
const QStyleOptionViewItem & |
option, |
|
|
const QModelIndex & |
index |
|
) |
| const |
|
virtual |
void CSVWorld::DataDisplayDelegate::paintIcon |
( |
QPainter * |
painter, |
|
|
const QStyleOptionViewItem & |
option, |
|
|
int |
i |
|
) |
| const |
|
private |
custom paint function for painting the icon. Mode_IconAndText and Mode_Icon only.
void CSVWorld::DataDisplayDelegate::setIconSize |
( |
const QSize & |
icon | ) |
|
pass a QSize defining height / width of icon. Default is QSize (16,16).
void CSVWorld::DataDisplayDelegate::setTextLeftOffset |
( |
int |
offset | ) |
|
offset the horizontal position of the text from the right edge of the icon. Default is 8 pixels.
void CSVWorld::DataDisplayDelegate::settingChanged |
( |
const CSMPrefs::Setting * |
setting | ) |
|
|
privatevirtual |
- Attention
- This is not a slot. For ordering reasons this function needs to be called manually from the parent object's settingChanged function.
Reimplemented from CSVWorld::CommandDelegate.
QSize CSVWorld::DataDisplayDelegate::sizeHint |
( |
const QStyleOptionViewItem & |
option, |
|
|
const QModelIndex & |
index |
|
) |
| const |
|
virtual |
void CSVWorld::DataDisplayDelegate::updateDisplayMode |
( |
const std::string & |
mode | ) |
|
|
private |
update the display mode based on a passed string
DisplayMode CSVWorld::DataDisplayDelegate::mDisplayMode |
|
protected |
int CSVWorld::DataDisplayDelegate::mHorizontalMargin |
|
private |
IconList CSVWorld::DataDisplayDelegate::mIcons |
|
protected |
QSize CSVWorld::DataDisplayDelegate::mIconSize |
|
private |
std::vector<std::pair <int, QPixmap> > CSVWorld::DataDisplayDelegate::mPixmaps |
|
private |
std::string CSVWorld::DataDisplayDelegate::mSettingKey |
|
private |
int CSVWorld::DataDisplayDelegate::mTextLeftOffset |
|
private |
The documentation for this class was generated from the following files: