diff --git a/src/markeritem.cpp b/src/markeritem.cpp index a1cedce9..80c1b7ce 100644 --- a/src/markeritem.cpp +++ b/src/markeritem.cpp @@ -19,10 +19,18 @@ void MarkerItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option { Q_UNUSED(option); Q_UNUSED(widget); + bool aa; + + + if ((aa = painter->testRenderHint(QPainter::Antialiasing))) + painter->setRenderHint(QPainter::Antialiasing, false); painter->setPen(Qt::red); painter->drawLine(-SIZE/2, 0, SIZE/2, 0); painter->drawLine(0, -SIZE/2, 0, SIZE/2); + if (aa) + painter->setRenderHint(QPainter::Antialiasing, true); + // painter->drawRect(boundingRect()); } diff --git a/src/scaleitem.cpp b/src/scaleitem.cpp index 122e2a37..a6c0733b 100644 --- a/src/scaleitem.cpp +++ b/src/scaleitem.cpp @@ -46,6 +46,11 @@ void ScaleItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, font.setFamily(FONT_FAMILY); QFontMetrics fm(font); QRect br; + bool aa; + + + if ((aa = painter->testRenderHint(QPainter::Antialiasing))) + painter->setRenderHint(QPainter::Antialiasing, false); painter->setFont(font); @@ -63,6 +68,9 @@ void ScaleItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, painter->fillRect(QRectF(i * _width, br.height() + PADDING, _width, SCALE_HEIGHT), Qt::black); + if (aa) + painter->setRenderHint(QPainter::Antialiasing, true); + /* painter->setPen(Qt::red); painter->drawRect(boundingRect()); diff --git a/src/trackview.cpp b/src/trackview.cpp index 5dbee53e..6758682b 100644 --- a/src/trackview.cpp +++ b/src/trackview.cpp @@ -27,6 +27,7 @@ TrackView::TrackView(QWidget *parent) setViewportUpdateMode(QGraphicsView::FullViewportUpdate); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + setRenderHints(QPainter::Antialiasing); _mapScale = new ScaleItem(); _mapScale->setZValue(2.0);