Use the canonical file name also for the "already open" check
[GPXSee.git] / src / GUI / markeritem.cpp
blob485ee248989f81e1d634d113ffc806094699c5a5
1 #include <QPainter>
2 #include "markeritem.h"
5 #define SIZE 8
6 #define WIDTH 2
8 MarkerItem::MarkerItem(QGraphicsItem *parent) : QGraphicsItem(parent)
10 _color = Qt::red;
13 QRectF MarkerItem::boundingRect() const
15 return QRectF(-SIZE/2, -SIZE/2, SIZE, SIZE);
18 void MarkerItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
19 QWidget *widget)
21 Q_UNUSED(option);
22 Q_UNUSED(widget);
24 painter->setRenderHint(QPainter::Antialiasing, false);
25 painter->setPen(QPen(_color, WIDTH));
26 painter->drawLine(-SIZE/2, 0, SIZE/2, 0);
27 painter->drawLine(0, -SIZE/2, 0, SIZE/2);
29 // painter->drawRect(boundingRect());
32 void MarkerItem::setColor(const QColor &color)
34 _color = color;
35 update();