mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 21:03:23 +00:00
Implement the paint method to draw the rounded rectangle.
The rectangle is now correct, but the collors are still wrong. I'm tracking that down - most probably I've set the wrong pen or brush ( or both ) somewhere. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
48a23b9b3c
commit
12dd46c140
2 changed files with 13 additions and 0 deletions
|
@ -12,6 +12,7 @@
|
|||
#include <QGraphicsScene>
|
||||
#include <QSettings>
|
||||
#include <QGraphicsView>
|
||||
#include <QStyleOptionGraphicsItem>
|
||||
#include <QDebug>
|
||||
|
||||
#define PORT_IN_PROGRESS 1
|
||||
|
@ -184,6 +185,17 @@ void ToolTipItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
|||
}
|
||||
}
|
||||
|
||||
void ToolTipItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||
{
|
||||
Q_UNUSED(widget);
|
||||
painter->save();
|
||||
painter->setClipRect(option->rect);
|
||||
painter->setPen(pen());
|
||||
painter->setBrush(brush());
|
||||
painter->drawRoundedRect(rect(), 10, 10, Qt::AbsoluteSize);
|
||||
painter->restore();
|
||||
}
|
||||
|
||||
void ToolTipItem::persistPos()
|
||||
{
|
||||
QSettings s;
|
||||
|
|
|
@ -43,6 +43,7 @@ public:
|
|||
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
|
||||
void setTimeAxis(DiveCartesianAxis *axis);
|
||||
void setPlotInfo(const plot_info &plot);
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||
public
|
||||
slots:
|
||||
void setRect(const QRectF &rect);
|
||||
|
|
Loading…
Add table
Reference in a new issue