Map distance scale. More...
#include <mapscale.h>
Public Slots | |
void | updateMapResolution (const qreal &resolution) |
Slot to update the scale with latest resolution. | |
Public Member Functions | |
MapScale (QWidget *parent=0) | |
Constructor. | |
void | paintEvent (QPaintEvent *event) |
Event handler for paint events. | |
Private Member Functions | |
qreal | roundToBaseScale (qreal value) |
Rounding function for distances. | |
Private Attributes | |
qreal | m_centerLineImperial |
Length of the imperial scale. | |
qreal | m_centerLineMetric |
Length of the metric scale. | |
QString | m_imperialText |
Text description of the imperial scale. | |
QString | m_metricText |
Text description of the metric scale. |
Map distance scale.
MapScale::MapScale | ( | QWidget * | parent = 0 |
) |
Constructor.
parent | Parent |
void MapScale::paintEvent | ( | QPaintEvent * | event | ) |
Event handler for paint events.
Paints the scale
event | Paint event |
qreal MapScale::roundToBaseScale | ( | qreal | value | ) | [private] |
Rounding function for distances.
Rounds the given value to closest 1,2,5 or 10 in the original scale
value | Value to be rounded |
void MapScale::updateMapResolution | ( | const qreal & | resolution | ) | [slot] |
Slot to update the scale with latest resolution.
resolution | Resolution of the map in meters/pixel |