Changeset View
Changeset View
Standalone View
Standalone View
src/lib/marble/PluginItemDelegate.h
Show All 24 Lines | |||||
25 | { | 25 | { | ||
26 | 26 | | |||
27 | class PluginItemDelegate : public QAbstractItemDelegate | 27 | class PluginItemDelegate : public QAbstractItemDelegate | ||
28 | { | 28 | { | ||
29 | Q_OBJECT | 29 | Q_OBJECT | ||
30 | 30 | | |||
31 | public: | 31 | public: | ||
32 | explicit PluginItemDelegate( QAbstractItemView *view, QObject * parent = 0 ); | 32 | explicit PluginItemDelegate( QAbstractItemView *view, QObject * parent = 0 ); | ||
33 | ~PluginItemDelegate(); | 33 | ~PluginItemDelegate() override; | ||
34 | 34 | | |||
35 | void paint( QPainter *painter, | 35 | void paint( QPainter *painter, | ||
36 | const QStyleOptionViewItem& option, | 36 | const QStyleOptionViewItem& option, | ||
37 | const QModelIndex& index ) const; | 37 | const QModelIndex& index ) const override; | ||
38 | QSize sizeHint( const QStyleOptionViewItem& option, const QModelIndex & index ) const; | 38 | QSize sizeHint( const QStyleOptionViewItem& option, const QModelIndex & index ) const override; | ||
39 | 39 | | |||
40 | void setAboutIcon( const QIcon& icon ); | 40 | void setAboutIcon( const QIcon& icon ); | ||
41 | void setConfigIcon( const QIcon& icon ); | 41 | void setConfigIcon( const QIcon& icon ); | ||
42 | 42 | | |||
43 | Q_SIGNALS: | 43 | Q_SIGNALS: | ||
44 | /** | 44 | /** | ||
45 | * This signal is emitted if the user clicks on a "about"-button of an item in the view | 45 | * This signal is emitted if the user clicks on a "about"-button of an item in the view | ||
46 | * passed to the constructor. | 46 | * passed to the constructor. | ||
47 | */ | 47 | */ | ||
48 | void aboutPluginClicked( const QModelIndex &index ); | 48 | void aboutPluginClicked( const QModelIndex &index ); | ||
49 | 49 | | |||
50 | /** | 50 | /** | ||
51 | * This signal is emitted if the user clicks on a "configure"-button of an item in the view | 51 | * This signal is emitted if the user clicks on a "configure"-button of an item in the view | ||
52 | * passed to the constructor. | 52 | * passed to the constructor. | ||
53 | */ | 53 | */ | ||
54 | void configPluginClicked( const QModelIndex &index ); | 54 | void configPluginClicked( const QModelIndex &index ); | ||
55 | 55 | | |||
56 | protected: | 56 | protected: | ||
57 | bool editorEvent( QEvent *event, | 57 | bool editorEvent( QEvent *event, | ||
58 | QAbstractItemModel *model, | 58 | QAbstractItemModel *model, | ||
59 | const QStyleOptionViewItem &option, | 59 | const QStyleOptionViewItem &option, | ||
60 | const QModelIndex &index ); | 60 | const QModelIndex &index ) override; | ||
61 | 61 | | |||
62 | private: | 62 | private: | ||
63 | enum ButtonType { | 63 | enum ButtonType { | ||
64 | About, | 64 | About, | ||
65 | Configure | 65 | Configure | ||
66 | }; | 66 | }; | ||
67 | 67 | | |||
68 | static QStyleOptionButton checkboxOption( const QStyleOptionViewItem& option, | 68 | static QStyleOptionButton checkboxOption( const QStyleOptionViewItem& option, | ||
Show All 22 Lines |