Stores view position, zoom, rotation and grid / template visibilities to define a view onto a map.
More...
|
| MapView (QObject *parent, Map *map) |
| Creates a default view looking at the origin. More...
|
|
| MapView (Map *map) |
| Creates a default view looking at the origin. More...
|
|
| ~MapView () override |
| Destroys the map view. More...
|
|
void | save (QXmlStreamWriter &xml, const QLatin1String &element_name, bool template_details=true) const |
| Saves the map view state to an XML stream. More...
|
|
void | load (QXmlStreamReader &xml) |
| Loads the map view state from the current element of an xml stream. More...
|
|
void | updateAllMapWidgets () |
| Redraws all map widgets completely. More...
|
|
MapCoord | viewToMap (const QPointF &point) const |
| Converts the point (with origin at the center of the view) to map coordinates. More...
|
|
MapCoordF | viewToMapF (const QPointF &point) const |
| Converts the point (with origin at the center of the view) to map coordinates. More...
|
|
QPointF | mapToView (const MapCoord &coords) const |
| Converts map coordinates to view coordinates (with origin at the center of the view) More...
|
|
QPointF | mapToView (const QPointF &coords) const |
| Converts map coordinates to view coordinates (with origin at the center of the view) More...
|
|
qreal | lengthToPixel (qreal length) const |
| Converts a length from native map coordinates to the current length in view pixels. More...
|
|
qreal | pixelToLength (qreal pixel) const |
| Converts a length from current view pixels to native map coordinates. More...
|
|
QRectF | calculateViewedRect (QRectF view_rect) const |
| Calculates the bounding box of the map coordinates which can be viewed using the given view coordinates rect. More...
|
|
QRectF | calculateViewBoundingBox (QRectF map_rect) const |
| Calculates the bounding box in view coordinates of the given map coordinates rect. More...
|
|
const QTransform & | worldTransform () const |
| Returns a QTransform suitable for QPainter, so objects defined in map coordinates will be drawn at their view coordinates. More...
|
|
QPoint | panOffset () const |
| Returns the current pan offset (when dragging the map). More...
|
|
void | setPanOffset (const QPoint &offset) |
| Sets the current pan offset while the map is being dragged. More...
|
|
void | finishPanning (const QPoint &offset) |
| Finishes panning the map. More...
|
|
const Map * | getMap () const |
| Returns the map this view is defined on. More...
|
|
Map * | getMap () |
| Returns the map this view is defined on. More...
|
|
void | zoomSteps (double num_steps, const QPointF &cursor_pos_view) |
| Zooms the maps (in steps), preserving the given cursor position. More...
|
|
void | zoomSteps (double num_steps) |
| Zooms the maps (in steps), preserving the center of the view. More...
|
|
double | calculateFinalZoomFactor () const |
| Returns the final zoom factor for use in transformations. More...
|
|
double | getZoom () const |
| Returns the raw zoom facor, see also calculateFinalZoomFactor(). More...
|
|
void | setZoom (double value, const QPointF ¢er) |
| Sets the zoom factor relative to the given point. More...
|
|
void | setZoom (double value) |
| Sets the zoom factor. More...
|
|
double | getRotation () const |
| Returns the view rotation (in radians). More...
|
|
void | setRotation (double value) |
| Sets the view rotation (in radians). More...
|
|
MapCoord | center () const |
| Returns the position of the view center. More...
|
|
void | setCenter (const MapCoord &pos) |
| Sets the position of the view center. More...
|
|
TemplateVisibility | effectiveMapVisibility () const |
| Returns the effectiv visibility settings of the map drawing. More...
|
|
TemplateVisibility | getMapVisibility () const |
| Returns the visibility settings of the map drawing. More...
|
|
void | setMapVisibility (TemplateVisibility vis) |
|
bool | isTemplateVisible (const Template *temp) const |
| Checks if the template is visible without creating a template visibility object if none exists. More...
|
|
TemplateVisibility | getTemplateVisibility (const Template *temp) const |
| Returns the template visibility. More...
|
|
void | setTemplateVisibility (Template *temp, TemplateVisibility vis) |
| Sets the template visibility, and emits a change signal. More...
|
|
void | setAllTemplatesHidden (bool value) |
| Enables or disables hiding all templates in this view. More...
|
|
bool | areAllTemplatesHidden () const |
| Returns if the "hide all templates" toggle is active. More...
|
|
bool | isGridVisible () const |
| Returns if the map grid is visible. More...
|
|
void | setGridVisible (bool visible) |
| Sets the map grid visibility. More...
|
|
bool | isOverprintingSimulationEnabled () const |
| Returns if overprinting simulation is enabled. More...
|
|
void | setOverprintingSimulationEnabled (bool enabled) |
| Enables or disables overprinting simulation. More...
|
|
bool | hasAlpha () const |
| Returns true if any of the visible elements is not opaque. More...
|
|
void | setTemplateLoadingBlocked (bool blocked) |
| Temporarily blocks automatic template loading on visibility changes. More...
|
|
bool | templateLoadingBlocked () const |
| Returns true when template loading on visibility changes is disabled. More...
|
|
virtual const QMetaObject * | metaObject () const const |
|
| QObject (QObject *parent) |
|
virtual | ~QObject () |
|
virtual bool | event (QEvent *e) |
|
virtual bool | eventFilter (QObject *watched, QEvent *event) |
|
QString | objectName () const const |
|
void | setObjectName (const QString &name) |
|
bool | isWidgetType () const const |
|
bool | isWindowType () const const |
|
bool | signalsBlocked () const const |
|
bool | blockSignals (bool block) |
|
QThread * | thread () const const |
|
void | moveToThread (QThread *targetThread) |
|
int | startTimer (int interval, Qt::TimerType timerType) |
|
int | startTimer (std::chrono::milliseconds time, Qt::TimerType timerType) |
|
void | killTimer (int id) |
|
T | findChild (const QString &name, Qt::FindChildOptions options) const const |
|
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const const |
|
QList< T > | findChildren (const QRegExp ®Exp, Qt::FindChildOptions options) const const |
|
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
|
const QObjectList & | children () const const |
|
void | setParent (QObject *parent) |
|
void | installEventFilter (QObject *filterObj) |
|
void | removeEventFilter (QObject *obj) |
|
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const |
|
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const const |
|
bool | disconnect (const QObject *receiver, const char *method) const const |
|
void | dumpObjectTree () |
|
void | dumpObjectInfo () |
|
void | dumpObjectTree () const const |
|
void | dumpObjectInfo () const const |
|
bool | setProperty (const char *name, const QVariant &value) |
|
QVariant | property (const char *name) const const |
|
QList< QByteArray > | dynamicPropertyNames () const const |
|
void | destroyed (QObject *obj) |
|
void | objectNameChanged (const QString &objectName) |
|
QObject * | parent () const const |
|
bool | inherits (const char *className) const const |
|
void | deleteLater () |
|
| Q_DISABLE_COPY (Class) |
|
| Q_DISABLE_MOVE (Class) |
|
| Q_DISABLE_COPY_MOVE (Class) |
|
T | qobject_cast (QObject *object) |
|
T | qobject_cast (const QObject *object) |
|
T | qFindChild (const QObject *obj, const QString &name) |
|
QList< T > | qFindChildren (const QObject *obj, const QString &name) |
|
QList< T > | qFindChildren (const QObject *obj, const QRegExp ®Exp) |
|
| Q_CLASSINFO (Name, Value) |
|
| Q_INTERFACES (...) |
|
| Q_PROPERTY (...) |
|
| Q_ENUMS (...) |
|
| Q_FLAGS (...) |
|
| Q_ENUM (...) |
|
| Q_FLAG (...) |
|
| Q_ENUM_NS (...) |
|
| Q_FLAG_NS (...) |
|
| Q_OBJECT Q_OBJECT |
|
| Q_GADGET Q_GADGET |
|
| Q_NAMESPACE Q_NAMESPACE |
|
| Q_SIGNALS Q_SIGNALS |
|
| Q_SIGNAL Q_SIGNAL |
|
| Q_SLOTS Q_SLOTS |
|
| Q_SLOT Q_SLOT |
|
| Q_EMIT Q_EMIT |
|
| Q_INVOKABLE Q_INVOKABLE |
|
| Q_REVISION Q_REVISION |
|
| Q_SET_OBJECT_NAME (Object) |
|
| QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT |
|
|
QString | tr (const char *sourceText, const char *disambiguation, int n) |
|
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
|
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
|
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
|
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
|
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
|
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
|
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
|
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
|
bool | disconnect (const QMetaObject::Connection &connection) |
|
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
|
typedef | QObjectList |
|
| objectName |
|
Stores view position, zoom, rotation and grid / template visibilities to define a view onto a map.
These parameters define the view coordinates with origin at the view's center, measured in pixels. The class provides methods to convert between view coordinates and map coordinates (defined as millimeter on map paper).