Class for indicating current position and accuracy accuired from GPS on the map. More...
#include <gpslocationitem.h>
Public Member Functions | |
| GPSLocationItem () | |
| Constructor. | |
| QRectF | boundingRect () const |
| Implements the bounding rect. | |
| void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) |
| Implements the painter. | |
| void | setEnabled (bool enable) |
| Enable / disable item. | |
| void | updateItem (QPointF scenePosition, qreal accuracy, qreal sceneResolution) |
| Update position item. | |
Private Member Functions | |
| void | setAccuracyRingRadius (qreal accuracy, qreal sceneResolution) |
| Set new radius for the accuracy ring. | |
| void | setBoundingRect (qreal radius) |
| Sets new bounding rect for this item based on the accuracy ring radius. | |
Private Attributes | |
| bool | m_showOnNextUpdate |
| should the item be shown when next update arrives | |
| qreal | m_radius |
| accuracy ring radius in scene pixels | |
| QGraphicsPixmapItem * | m_pixmapItem |
| red led item | |
| QRectF | m_boundingRect |
| item's bounding rect | |
Class for indicating current position and accuracy accuired from GPS on the map.
Actual position spot image is a child item of this class and this class handles drawing the accuracy ring. GPS fix accuracy is indicated by the radius of the circle around the position item.
| QRectF GPSLocationItem::boundingRect | ( | ) | const |
Implements the bounding rect.
| void GPSLocationItem::setAccuracyRingRadius | ( | qreal | accuracy, | |
| qreal | sceneResolution | |||
| ) | [private] |
Set new radius for the accuracy ring.
Calls setBoundingRect() if the radius changes
| accuracy | Accuracy (in meters) | |
| sceneResolution | Scene resolution (meters/pixel) |
| void GPSLocationItem::setBoundingRect | ( | qreal | radius | ) | [private] |
Sets new bounding rect for this item based on the accuracy ring radius.
| radius | Radius of the accuracy ring |
| void GPSLocationItem::setEnabled | ( | bool | enable | ) |
Enable / disable item.
Actual enabling is done when next position update is received, so the old value before hiding the item is not used.
| enable | True if item should be enabled, otherwise false |
| void GPSLocationItem::updateItem | ( | QPointF | scenePosition, | |
| qreal | accuracy, | |||
| qreal | sceneResolution | |||
| ) |
Update position item.
| scenePosition | Scene position | |
| accuracy | Accuracy of the GPS fix | |
| sceneResolution | Scene horizontal resolution at given coordinate latitude level |
1.6.1