The line style item delegate for rendering the styles.
More...
#include <KoLineStyleItemDelegate_p.h>
The line style item delegate for rendering the styles.
Definition at line 12 of file KoLineStyleItemDelegate_p.h.
◆ KoLineStyleItemDelegate()
| KoLineStyleItemDelegate::KoLineStyleItemDelegate |
( |
QObject * | parent = 0 | ) |
|
|
explicit |
◆ ~KoLineStyleItemDelegate()
| KoLineStyleItemDelegate::~KoLineStyleItemDelegate |
( |
| ) |
|
|
inlineoverride |
◆ paint()
| void KoLineStyleItemDelegate::paint |
( |
QPainter * | painter, |
|
|
const QStyleOptionViewItem & | option, |
|
|
const QModelIndex & | index ) const |
|
override |
Definition at line 17 of file KoLineStyleItemDelegate.cpp.
18{
19 painter->save();
20
21 if (option.state & QStyle::State_Selected)
22 painter->fillRect(option.rect, option.palette.highlight());
23
24 QPen pen = index.data(Qt::DecorationRole).value<QPen>();
25 pen.setBrush(option.palette.text());
26 painter->setPen(pen);
27 painter->drawLine(option.rect.left(), option.rect.center().y(), option.rect.right(), option.rect.center().y());
28
29 painter->restore();
30}
◆ sizeHint()
| QSize KoLineStyleItemDelegate::sizeHint |
( |
const QStyleOptionViewItem & | option, |
|
|
const QModelIndex & | index ) const |
|
override |
The documentation for this class was generated from the following files: