1 #ifndef DATADISPLAYDELEGATE_HPP
2 #define DATADISPLAYDELEGATE_HPP
18 typedef std::vector < std::pair < int, QIcon > >
IconList;
19 typedef std::vector<std::pair<int, QString> >
ValueList;
35 std::vector <std::pair <int, QPixmap> >
mPixmaps;
45 const std::string& pageName,
const std::string& settingName,
QObject *parent);
49 virtual void paint (QPainter *painter,
const QStyleOptionViewItem &option,
const QModelIndex &index)
const;
51 virtual QSize
sizeHint(
const QStyleOptionViewItem &option,
const QModelIndex &index)
const;
65 void paintIcon (QPainter *painter,
const QStyleOptionViewItem &option,
int i)
const;
86 void add (
int enumValue,
const QString& enumName,
const QString& iconFilename);
92 #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:36
Definition: datadisplaydelegate.hpp:26
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:19
~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:23
DisplayMode mDisplayMode
Definition: datadisplaydelegate.hpp:30
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:38
Definition: datadisplaydelegate.hpp:25
Definition: datadisplaydelegate.hpp:14
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:150
std::vector< std::pair< int, QPixmap > > mPixmaps
Definition: datadisplaydelegate.hpp:35
virtual void settingChanged(const CSMPrefs::Setting *setting)
Definition: datadisplaydelegate.cpp:136
int mHorizontalMargin
Definition: datadisplaydelegate.hpp:37
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:31
Definition: datadisplaydelegate.hpp:73
Integer value that represents an enum and is interacted with via a combobox.
Definition: enumdelegate.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
std::vector< std::pair< int, QIcon > > IconList
Definition: datadisplaydelegate.hpp:18
DataDisplayDelegate::IconList mIcons
Definition: datadisplaydelegate.hpp:77
Definition: datadisplaydelegate.hpp:27
std::string mSettingKey
Definition: datadisplaydelegate.hpp:40
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: datadisplaydelegate.cpp:51