1 #include <QPaintEngine>
2 #include <QPaintDevice>
7 TrackInfo::TrackInfo(QObject
*parent
) : QGraphicsScene(parent
)
9 _info
= new InfoItem();
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(),
26 render(painter
, target
, adj
);
29 bool TrackInfo::isEmpty() const
31 return _info
->isEmpty();
34 QSizeF
TrackInfo::contentSize() const
36 return sceneRect().size();