1 #ifndef DATADISPLAYDELEGATE_HPP
2 #define DATADISPLAYDELEGATE_HPP
26 typedef std::vector<std::pair<int, QString> >
ValueList;
42 std::vector <std::pair <int, QPixmap> >
mPixmaps;
52 const std::string& pageName,
const std::string& settingName,
QObject *parent);
56 virtual void paint (QPainter *painter,
const QStyleOptionViewItem &option,
const QModelIndex &index)
const;
58 virtual QSize
sizeHint(
const QStyleOptionViewItem &option,
const QModelIndex &index)
const;
72 void paintIcon (QPainter *painter,
const QStyleOptionViewItem &option,
int i)
const;
93 void add (
int enumValue,
const QString& enumName,
const QString& iconFilename);
99 #endif // DATADISPLAYDELEGATE_HPP
void updateDisplayMode(const std::string &)
update the display mode based on a passed string
Definition: datadisplaydelegate.cpp:120
QSize mIconSize
Definition: datadisplaydelegate.hpp:43
Definition: datadisplaydelegate.hpp:33
QIcon mIcon
Definition: datadisplaydelegate.hpp:17
void setTextLeftOffset(int offset)
offset the horizontal position of the text from the right edge of the icon. Default is 8 pixels...
Definition: datadisplaydelegate.cpp:46
std::vector< std::pair< int, QString > > ValueList
Definition: datadisplaydelegate.hpp:26
~DataDisplayDelegate()
Definition: datadisplaydelegate.cpp:132
Definition: enumdelegate.hpp:55
void buildPixmaps()
rebuild the list of pixmaps from the provided icons (called when icon size is changed) ...
Definition: datadisplaydelegate.cpp:26
DisplayMode
Definition: datadisplaydelegate.hpp:30
DisplayMode mDisplayMode
Definition: datadisplaydelegate.hpp:37
void setIconSize(const QSize &icon)
pass a QSize defining height / width of icon. Default is QSize (16,16).
Definition: datadisplaydelegate.cpp:40
void add(int enumValue, const QString &enumName, const QString &iconFilename)
Definition: datadisplaydelegate.cpp:143
int mTextLeftOffset
Definition: datadisplaydelegate.hpp:45
Definition: datadisplaydelegate.hpp:32
QString mName
Definition: datadisplaydelegate.hpp:18
Definition: datadisplaydelegate.hpp:21
virtual CommandDelegate * makeDelegate(CSMWorld::CommandDispatcher *dispatcher, CSMDoc::Document &document, QObject *parent) const
The ownership of the returned CommandDelegate is transferred to the caller.
Definition: datadisplaydelegate.cpp:164
std::vector< std::pair< int, QPixmap > > mPixmaps
Definition: datadisplaydelegate.hpp:42
virtual void settingChanged(const CSMPrefs::Setting *setting)
Definition: datadisplaydelegate.cpp:136
int mHorizontalMargin
Definition: datadisplaydelegate.hpp:44
Definition: commanddispatcher.hpp:20
Definition: setting.hpp:22
void paintIcon(QPainter *painter, const QStyleOptionViewItem &option, int i) const
custom paint function for painting the icon. Mode_IconAndText and Mode_Icon only. ...
Definition: datadisplaydelegate.cpp:94
Definition: document.hpp:57
IconList mIcons
Definition: datadisplaydelegate.hpp:38
Definition: datadisplaydelegate.hpp:80
Integer value that represents an enum and is interacted with via a combobox.
Definition: enumdelegate.hpp:16
int mValue
Definition: datadisplaydelegate.hpp:16
DataDisplayDelegate(const ValueList &values, const IconList &icons, CSMWorld::CommandDispatcher *dispatcher, CSMDoc::Document &document, const std::string &pageName, const std::string &settingName, QObject *parent)
Definition: datadisplaydelegate.cpp:8
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: datadisplaydelegate.cpp:75
DataDisplayDelegate::IconList mIcons
Definition: datadisplaydelegate.hpp:84
Definition: datadisplaydelegate.hpp:34
Definition: datadisplaydelegate.hpp:14
std::string mSettingKey
Definition: datadisplaydelegate.hpp:47
std::vector< Icon > IconList
Definition: datadisplaydelegate.hpp:25
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: datadisplaydelegate.cpp:51