31 TrailItem::TrailItem(
internals::PointLatLng const& coord,
int const& altitude, QBrush color, MapGraphicItem *map):QGraphicsItem(map),coord(coord),m_brush(color),m_map(map)
33 QDateTime time=QDateTime::currentDateTime();
34 QString coord_str =
" " + QString::number(coord.
Lat(),
'f', 6) +
" " + QString::number(coord.
Lng(),
'f', 6);
35 setToolTip(QString(tr(
"Position:")+
"%1\n"+tr(
"Altitude:")+
"%2\n"+tr(
"Time:")+
"%3").arg(coord_str).arg(QString::number(altitude)).arg(time.toString()));
38 void TrailItem::paint(QPainter *painter,
const QStyleOptionGraphicsItem *option, QWidget *widget)
43 painter->setBrush(m_brush);
44 painter->drawEllipse(-2,-2,4,4);
46 QRectF TrailItem::boundingRect()
const
48 return QRectF(-2,-2,4,4);
52 int TrailItem::type()
const
59 setPos(m_map->FromLatLngToLocal(this->coord).
X(),m_map->FromLatLngToLocal(this->coord).
Y());
A graphicsItem representing a WayPoint.