Use the canonical file name also for the "already open" check
[GPXSee.git] / src / GUI / trackinfo.cpp
blobc412ce2883075ace604d5609a14e872983fb1b5a
1 #include <QPaintEngine>
2 #include <QPaintDevice>
3 #include "infoitem.h"
4 #include "trackinfo.h"
7 TrackInfo::TrackInfo(QObject *parent) : QGraphicsScene(parent)
9 _info = new InfoItem();
10 addItem(_info);
13 void TrackInfo::insert(const QString &key, const QString &value)
15 _info->insert(key, value);
18 void TrackInfo::plot(QPainter *painter, const QRectF &target, qreal scale)
20 QSizeF canvas = QSizeF(target.width() / scale, target.height() / scale);
21 QSizeF diff = QSizeF(qAbs(canvas.width() - sceneRect().width()),
22 qAbs(canvas.height() - sceneRect().height()));
23 QRectF adj = sceneRect().adjusted(0, -diff.height()/2, diff.width(),
24 diff.height()/2);
26 render(painter, target, adj);
29 bool TrackInfo::isEmpty() const
31 return _info->isEmpty();
34 QSizeF TrackInfo::contentSize() const
36 return sceneRect().size();