mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
19 lines
500 B
C++
19 lines
500 B
C++
|
#include "roundrectitem.h"
|
||
|
#include <QPainter>
|
||
|
#include <QStyleOptionGraphicsItem>
|
||
|
|
||
|
RoundRectItem::RoundRectItem(double radius, QGraphicsItem *parent) : QGraphicsRectItem(parent),
|
||
|
radius(radius)
|
||
|
{
|
||
|
}
|
||
|
|
||
|
void RoundRectItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *)
|
||
|
{
|
||
|
painter->save();
|
||
|
painter->setClipRect(option->rect);
|
||
|
painter->setPen(pen());
|
||
|
painter->setBrush(brush());
|
||
|
painter->drawRoundedRect(rect(), radius, radius, Qt::AbsoluteSize);
|
||
|
painter->restore();
|
||
|
}
|