mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-02-17 16:20:48 +01:00
Now using antialiasing in track view
This commit is contained in:
parent
7a6e60b83d
commit
64e65679fe
@ -19,10 +19,18 @@ void MarkerItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option
|
|||||||
{
|
{
|
||||||
Q_UNUSED(option);
|
Q_UNUSED(option);
|
||||||
Q_UNUSED(widget);
|
Q_UNUSED(widget);
|
||||||
|
bool aa;
|
||||||
|
|
||||||
|
|
||||||
|
if ((aa = painter->testRenderHint(QPainter::Antialiasing)))
|
||||||
|
painter->setRenderHint(QPainter::Antialiasing, false);
|
||||||
|
|
||||||
painter->setPen(Qt::red);
|
painter->setPen(Qt::red);
|
||||||
painter->drawLine(-SIZE/2, 0, SIZE/2, 0);
|
painter->drawLine(-SIZE/2, 0, SIZE/2, 0);
|
||||||
painter->drawLine(0, -SIZE/2, 0, SIZE/2);
|
painter->drawLine(0, -SIZE/2, 0, SIZE/2);
|
||||||
|
|
||||||
|
if (aa)
|
||||||
|
painter->setRenderHint(QPainter::Antialiasing, true);
|
||||||
|
|
||||||
// painter->drawRect(boundingRect());
|
// painter->drawRect(boundingRect());
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,11 @@ void ScaleItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|||||||
font.setFamily(FONT_FAMILY);
|
font.setFamily(FONT_FAMILY);
|
||||||
QFontMetrics fm(font);
|
QFontMetrics fm(font);
|
||||||
QRect br;
|
QRect br;
|
||||||
|
bool aa;
|
||||||
|
|
||||||
|
|
||||||
|
if ((aa = painter->testRenderHint(QPainter::Antialiasing)))
|
||||||
|
painter->setRenderHint(QPainter::Antialiasing, false);
|
||||||
|
|
||||||
painter->setFont(font);
|
painter->setFont(font);
|
||||||
|
|
||||||
@ -63,6 +68,9 @@ void ScaleItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|||||||
painter->fillRect(QRectF(i * _width, br.height() + PADDING, _width,
|
painter->fillRect(QRectF(i * _width, br.height() + PADDING, _width,
|
||||||
SCALE_HEIGHT), Qt::black);
|
SCALE_HEIGHT), Qt::black);
|
||||||
|
|
||||||
|
if (aa)
|
||||||
|
painter->setRenderHint(QPainter::Antialiasing, true);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
painter->setPen(Qt::red);
|
painter->setPen(Qt::red);
|
||||||
painter->drawRect(boundingRect());
|
painter->drawRect(boundingRect());
|
||||||
|
@ -27,6 +27,7 @@ TrackView::TrackView(QWidget *parent)
|
|||||||
setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
|
setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
|
||||||
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
|
setRenderHints(QPainter::Antialiasing);
|
||||||
|
|
||||||
_mapScale = new ScaleItem();
|
_mapScale = new ScaleItem();
|
||||||
_mapScale->setZValue(2.0);
|
_mapScale->setZValue(2.0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user