diff --git a/src/axisitem.cpp b/src/axisitem.cpp index 6379f654..1fdf5585 100644 --- a/src/axisitem.cpp +++ b/src/axisitem.cpp @@ -5,6 +5,7 @@ #include "axisitem.h" +#define AXIS_WIDTH 1 #define TICK 6 #define PADDING 6 #define XTICKS 15 @@ -114,9 +115,11 @@ void AxisItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, struct Label l; qreal range = _range.size(); qreal val; + QPen pen = QPen(Qt::black, AXIS_WIDTH); painter->setFont(font); + painter->setPen(pen); ls = fm.tightBoundingRect(_label); diff --git a/src/graphitem.cpp b/src/graphitem.cpp index 3f07115b..ca45daf3 100644 --- a/src/graphitem.cpp +++ b/src/graphitem.cpp @@ -51,7 +51,7 @@ GraphItem::GraphItem(const Graph &graph, QGraphicsItem *parent) _id = 0; _type = Distance; - _pen.setWidth(GRAPH_WIDTH); + _pen = QPen(Qt::black, GRAPH_WIDTH); _pen.setCosmetic(true); _distancePath.moveTo(graph.first().s(), -graph.first().y()); @@ -81,6 +81,12 @@ void GraphItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, */ } +void GraphItem::setGraphType(GraphType type) +{ + prepareGeometryChange(); + _type = type; +} + void GraphItem::setColor(const QColor &color) { _pen.setColor(color); diff --git a/src/graphitem.h b/src/graphitem.h index 6342b728..bd43fd90 100644 --- a/src/graphitem.h +++ b/src/graphitem.h @@ -18,7 +18,7 @@ public: void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); - void setGraphType(GraphType type) {_type = type;} + void setGraphType(GraphType type); int id() const {return _id;} void setId(int id) {_id = id;} void setColor(const QColor &color); diff --git a/src/scaleitem.cpp b/src/scaleitem.cpp index 7352f90f..b1fe043c 100644 --- a/src/scaleitem.cpp +++ b/src/scaleitem.cpp @@ -5,6 +5,7 @@ #include "scaleitem.h" +#define BORDER_WIDTH 1 #define SCALE_WIDTH 132 #define SCALE_HEIGHT 5 #define SEGMENTS 3 @@ -50,6 +51,7 @@ void ScaleItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, font.setFamily(FONT_FAMILY); QFontMetrics fm(font); QRect br; + QPen pen = QPen(Qt::black, BORDER_WIDTH); bool aa; @@ -57,6 +59,7 @@ void ScaleItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, painter->setRenderHint(QPainter::Antialiasing, false); painter->setFont(font); + painter->setPen(pen); for (int i = 0; i <= SEGMENTS; i++) { QString label = QString::number(_length * i);