I have a similar implementation problem.
I'm developing a 2D earth plot using the Graphics View Framework to represent the flight path of a aircraft (Position in Latitude and Longitude). The background is a image of a Mercator projection of the earth added via (QGraphicView). I already have the means of converting from geographical coordinates to the scene coordinates.
The user needs to have the ability to add or delete aircraft (0 to 10) hence each aircraft is a reimplementation of QGraphicsItem. Each aircraft stores its initial position (Lat & Lon) and adds its current position to storage "QList" during its flight. I want to show the flight path from take off (New York ) to landing (Paris). The user must have the ability of selecting a aircraft and seeing where it had taken off from even after it has already started its journey.
I plan on updating the Earth Plot via a QTimer connected to the scene's advance() slot (similar to the Colliding Mice Example) during the aircraft flight.
In the AircraftItem every time it geographical position has been updated and the QTimer timeout() signal is triggered then in my AircraftItem::advance(int step) function I was planning on calling AircraftItem::itemChange() to change its position translated into the scene's coordinates.
Ideally the whole flight path is represented by a QPainter::drawPolyline
When I update the aircraft's position on my plot do I need to change its boundingRect() "Not really sure how to do this, btw" and should I do my drawing in its paint function.




Reply With Quote

Bookmarks