Quark  0.1
ImageDelegate.h++
Go to the documentation of this file.
1 #ifndef __libquark_gui_ImageDelegate_hxx
2 #define __libquark_gui_ImageDelegate_hxx
3 
4 #include <QAbstractItemDelegate>
5 #include <QColor>
6 
7 namespace quark {
8 namespace gui {
9 
15 class ImageDelegate : public QAbstractItemDelegate
16 {
17  public:
18 
20  explicit ImageDelegate(QObject *parent = NULL);
21 
27  void setBorderThickness(int borderThickness);
28 
33  void setBorderColor(QColor borderColor);
34 
36  virtual void paint(QPainter *painter, const QStyleOptionViewItem &option,
37  const QModelIndex &index) const;
38 
40  virtual QSize sizeHint(const QStyleOptionViewItem &option,
41  const QModelIndex &index) const;
42 
43  private:
44 
45  int _borderThickness;
46  QColor _borderColor;
47 };
48 
49 } // namespace gui
50 } // namespace quark
51 
52 #endif // __libquark_gui_ImageDelegate_hxx
void setBorderColor(QColor borderColor)
Sets the border color.
void setBorderThickness(int borderThickness)
Sets the border thickness.
Definition: BarChartView.h++:6
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
Specified by QAbstractItemDelegate.
An item delegate that displays an image with an optional border.
Definition: ImageDelegate.h++:15
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
Specified by QAbstractItemDelegate.
ImageDelegate(QObject *parent=NULL)
Constructor.