Quark  0.1
ImageAndTextDelegate.h++
Go to the documentation of this file.
1 #ifndef __libquark_gui_ImageAndTextDelegate_hxx
2 #define __libquark_gui_ImageAndTextDelegate_hxx
3 
4 #include <QAbstractItemDelegate>
5 #include <QSize>
6 
7 namespace quark {
8 namespace gui {
9 
15 class ImageAndTextDelegate : public QAbstractItemDelegate
16 {
17  public:
18 
26  explicit ImageAndTextDelegate(const QSize &iconSize, QObject *parent = NULL);
27 
29  virtual void paint(QPainter *painter, const QStyleOptionViewItem &option,
30  const QModelIndex &index) const;
31 
33  virtual QSize sizeHint(const QStyleOptionViewItem &option,
34  const QModelIndex &index) const;
35 
36  private:
37 
38  QSize _iconSize;
39 };
40 
41 } // namespace gui
42 } // namespace quark
43 
44 #endif // __libquark_gui_ImageAndTextDelegate_hxx
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
Specified by QAbstractItemDelegate.
An item delegate that displays an image and some text.
Definition: ImageAndTextDelegate.h++:15
ImageAndTextDelegate(const QSize &iconSize, QObject *parent=NULL)
Constructs a new ImageAndTextDelegate with the given image size.
Definition: BarChartView.h++:6
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
Specified by QAbstractItemDelegate.