Mapper  0.9.0
API documentation
Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions | Friends | List of all members
OpenOrienteering::MapWidget Class Reference

QWidget for displaying a map. More...

#include <map_widget.h>

Inheritance diagram for OpenOrienteering::MapWidget:
Inheritance graph
[legend]
Collaboration diagram for OpenOrienteering::MapWidget:
Collaboration graph
[legend]

Public Types

enum  CoordsType { MAP_COORDS, PROJECTED_COORDS, GEOGRAPHIC_COORDS, GEOGRAPHIC_COORDS_DMS }
 Describes different display formats for coordinates. More...
 
enum  ZoomOption { ContinuousZoom, DiscreteZoom }
 Describes how a zoom level can be determined. More...
 

Public Slots

QVariant inputMethodQuery (Qt::InputMethodQuery property, const QVariant &argument) const
 Support function for input methods. More...
 
void enableTouchCursor (bool enabled)
 Enables or disables the touch cursor. More...
 

Signals

void cursorPositionChanged ()
 Support function for input methods. More...
 

Public Member Functions

 MapWidget (bool show_help, bool force_antialiasing, QWidget *parent=nullptr)
 Constructs a new MapWidget. More...
 
 ~MapWidget () override
 Destructs the MapWidget. More...
 
void setMapView (MapView *view)
 Sets the map view to use for display. More...
 
MapViewgetMapView () const
 Returns the map view used for display. More...
 
void setTool (MapEditorTool *tool)
 Sets the tool to use in this widget. More...
 
void setActivity (MapEditorActivity *activity)
 Sets the activity to use in this widget. More...
 
void setGesturesEnabled (bool enabled)
 Enables or disables gesture recognition. More...
 
bool gesturesEnabled () const
 Returns true if gesture recognition is enabled. More...
 
void applyMapTransform (QPainter *painter) const
 Applies the complete transform to the painter which enables to draw map objects with map coordinates and have them correctly displayed in the widget with the settings of the used MapView. More...
 
QRectF viewportToView (const QRect &input) const
 Maps viewport (GUI) coordinates to view coordinates (see MapView). More...
 
QPointF viewportToView (const QPoint &input) const
 Maps viewport (GUI) coordinates to view coordinates (see MapView). More...
 
QPointF viewportToView (QPointF input) const
 Maps viewport (GUI) coordinates to view coordinates (see MapView). More...
 
QRectF viewToViewport (const QRectF &input) const
 Maps view coordinates (see MapView) to viewport (GUI) coordinates. More...
 
QRectF viewToViewport (const QRect &input) const
 Maps view coordinates (see MapView) to viewport (GUI) coordinates. More...
 
QPointF viewToViewport (const QPoint &input) const
 Maps view coordinates (see MapView) to viewport (GUI) coordinates. More...
 
QPointF viewToViewport (QPointF input) const
 Maps view coordinates (see MapView) to viewport (GUI) coordinates. More...
 
MapCoord viewportToMap (const QPoint &input) const
 Maps viewport (GUI) coordinates to map coordinates. More...
 
MapCoordF viewportToMapF (const QPoint &input) const
 Maps viewport (GUI) coordinates to map coordinates. More...
 
MapCoordF viewportToMapF (const QPointF &input) const
 Maps viewport (GUI) coordinates to map coordinates. More...
 
QPointF mapToViewport (const MapCoord &input) const
 Maps map coordinates to viewport (GUI) coordinates. More...
 
QPointF mapToViewport (const QPointF &input) const
 Maps map coordinates to viewport (GUI) coordinates. More...
 
QRectF mapToViewport (const QRectF &input) const
 Maps map coordinates to viewport (GUI) coordinates. More...
 
void viewChanged (MapView::ChangeFlags changes)
 Notifies the MapWidget of the view having zoomed, moved or rotated. More...
 
QPoint panOffset () const
 Returns the current offset (in pixel) during a map pan operation. More...
 
void setPanOffset (const QPoint &offset)
 Sets the current offset (in pixel) during a map pan operation. More...
 
void ensureVisibilityOfRect (QRectF map_rect, ZoomOption zoom_option)
 Adjusts the viewport so the given rect is inside the view. More...
 
void adjustViewToRect (QRectF map_rect, ZoomOption zoom_option)
 Sets the view so the rect is centered and zooomed to fill the widget. More...
 
void markTemplateCacheDirty (const QRectF &view_rect, int pixel_border, bool front_cache)
 Mark a rectangular region of a template cache as "dirty", i.e. More...
 
void markObjectAreaDirty (const QRectF &map_rect)
 Mark a rectangular region given in map coordinates of the map cache as dirty, i.e. More...
 
void setDrawingBoundingBox (QRectF map_rect, int pixel_border, bool do_update)
 Set the given rect as bounding box for the current drawing, i.e. More...
 
void clearDrawingBoundingBox ()
 Removes the area set with setDrawingBoundingBox() and triggers a redraw of the widget, if needed. More...
 
void setActivityBoundingBox (QRectF map_rect, int pixel_border, bool do_update)
 Analogon to setDrawingBoundingBox() for activities. More...
 
void clearActivityBoundingBox ()
 Analogon to clearDrawingBoundingBox() for activities. More...
 
void updateDrawing (const QRectF &map_rect, int pixel_border)
 Triggers a redraw of the MapWidget at the given area. More...
 
void updateMapRect (const QRectF &map_rect, int pixel_border, QRect &cache_dirty_rect)
 Triggers a redraw of the MapWidget at the given area. More...
 
void updateViewportRect (QRect viewport_rect, QRect &cache_dirty_rect)
 Triggers a redraw of the MapWidget at the given area. More...
 
void updateDrawingLater (const QRectF &map_rect, int pixel_border)
 Variant of updateDrawing() which waits for some milliseconds before calling update() in order to avoid excessive redraws. More...
 
void updateEverything ()
 Invalidates all caches and redraws the whole widget. More...
 
void updateEverythingInRect (const QRect &dirty_rect)
 Sets all "dirty" region markers to the given rect in viewport coordinates and triggers a redraw of the MapWidget there. More...
 
void setZoomDisplay (std::function< void(const QString &)> setter)
 Sets the function which will be called to display zoom information. More...
 
void setCursorposLabel (QLabel *cursorpos_label)
 Specify the label where the MapWidget will display cursor position information. More...
 
void setCoordsDisplay (CoordsType type)
 Specify the system and format for displaying coordinates in the cursorpos label. More...
 
CoordsType getCoordsDisplay () const
 Returns the coordinate display type set by setCoordsDisplay(). More...
 
int getTimeSinceLastInteraction ()
 Returns the time in milliseconds since the last user interaction (mouse press or drag) with the widget. More...
 
void setGPSDisplay (GPSDisplay *gps_display)
 Sets the GPS display to use. More...
 
void setTemporaryMarkerDisplay (GPSTemporaryMarkers *marker_display)
 Sets the GPS temporary markers display to use. More...
 
QWidgetgetContextMenu ()
 Returns the widget's context menu widget. More...
 
QSize sizeHint () const override
 Returns the widget's preferred size. More...
 
bool keyPressEventFilter (QKeyEvent *event)
 Receives key press events from the main window. Delegates the keyPress to the active tool, or handles some shortcuts itself. More...
 
bool keyReleaseEventFilter (QKeyEvent *event)
 Receives key press events from the main window. Delegates the keyRelease to the active tool. More...
 
QVariant inputMethodQuery (Qt::InputMethodQuery property) const override
 Support function for input methods. More...
 
- Public Member Functions inherited from QWidget
 QWidget (QWidget *parent, Qt::WindowFlags f)
 
virtual ~QWidget ()
 
WId winId () const const
 
WId effectiveWinId () const const
 
QStylestyle () const const
 
void setStyle (QStyle *style)
 
bool isTopLevel () const const
 
bool isWindow () const const
 
bool isModal () const const
 
Qt::WindowModality windowModality () const const
 
void setWindowModality (Qt::WindowModality windowModality)
 
bool isEnabled () const const
 
bool isEnabledTo (const QWidget *ancestor) const const
 
bool isEnabledToTLW () const const
 
void setEnabled (bool)
 
void setDisabled (bool disable)
 
void setWindowModified (bool)
 
QRect frameGeometry () const const
 
const QRectgeometry () const const
 
QRect normalGeometry () const const
 
int x () const const
 
int y () const const
 
QPoint pos () const const
 
QSize frameSize () const const
 
QSize size () const const
 
int width () const const
 
int height () const const
 
QRect rect () const const
 
QRect childrenRect () const const
 
QRegion childrenRegion () const const
 
QSize minimumSize () const const
 
QSize maximumSize () const const
 
int minimumWidth () const const
 
int minimumHeight () const const
 
int maximumWidth () const const
 
int maximumHeight () const const
 
void setMinimumSize (const QSize &)
 
void setMinimumSize (int minw, int minh)
 
void setMaximumSize (const QSize &)
 
void setMaximumSize (int maxw, int maxh)
 
void setMinimumWidth (int minw)
 
void setMinimumHeight (int minh)
 
void setMaximumWidth (int maxw)
 
void setMaximumHeight (int maxh)
 
void setupUi (QWidget *widget)
 
QSize sizeIncrement () const const
 
void setSizeIncrement (const QSize &)
 
void setSizeIncrement (int w, int h)
 
QSize baseSize () const const
 
void setBaseSize (const QSize &)
 
void setBaseSize (int basew, int baseh)
 
void setFixedSize (const QSize &s)
 
void setFixedSize (int w, int h)
 
void setFixedWidth (int w)
 
void setFixedHeight (int h)
 
QPoint mapToGlobal (const QPoint &pos) const const
 
QPoint mapFromGlobal (const QPoint &pos) const const
 
QPoint mapToParent (const QPoint &pos) const const
 
QPoint mapFromParent (const QPoint &pos) const const
 
QPoint mapTo (const QWidget *parent, const QPoint &pos) const const
 
QPoint mapFrom (const QWidget *parent, const QPoint &pos) const const
 
QWidgetwindow () const const
 
QWidgetnativeParentWidget () const const
 
QWidgettopLevelWidget () const const
 
const QPalettepalette () const const
 
void setPalette (const QPalette &)
 
void setBackgroundRole (QPalette::ColorRole role)
 
QPalette::ColorRole backgroundRole () const const
 
void setForegroundRole (QPalette::ColorRole role)
 
QPalette::ColorRole foregroundRole () const const
 
const QFontfont () const const
 
void setFont (const QFont &)
 
QFontMetrics fontMetrics () const const
 
QFontInfo fontInfo () const const
 
QCursor cursor () const const
 
void setCursor (const QCursor &)
 
void unsetCursor ()
 
void setMouseTracking (bool enable)
 
bool hasMouseTracking () const const
 
bool underMouse () const const
 
void setTabletTracking (bool enable)
 
bool hasTabletTracking () const const
 
void setMask (const QBitmap &bitmap)
 
void setMask (const QRegion &region)
 
QRegion mask () const const
 
void clearMask ()
 
void render (QPaintDevice *target, const QPoint &targetOffset, const QRegion &sourceRegion, QWidget::RenderFlags renderFlags)
 
void render (QPainter *painter, const QPoint &targetOffset, const QRegion &sourceRegion, QWidget::RenderFlags renderFlags)
 
QPixmap grab (const QRect &rectangle)
 
QGraphicsEffectgraphicsEffect () const const
 
void setGraphicsEffect (QGraphicsEffect *effect)
 
void grabGesture (Qt::GestureType gesture, Qt::GestureFlags flags)
 
void ungrabGesture (Qt::GestureType gesture)
 
void setWindowTitle (const QString &)
 
void setStyleSheet (const QString &styleSheet)
 
QString styleSheet () const const
 
QString windowTitle () const const
 
void setWindowIcon (const QIcon &icon)
 
QIcon windowIcon () const const
 
void setWindowIconText (const QString &)
 
QString windowIconText () const const
 
void setWindowRole (const QString &role)
 
QString windowRole () const const
 
void setWindowFilePath (const QString &filePath)
 
QString windowFilePath () const const
 
void setWindowOpacity (qreal level)
 
qreal windowOpacity () const const
 
bool isWindowModified () const const
 
void setToolTip (const QString &)
 
QString toolTip () const const
 
void setToolTipDuration (int msec)
 
int toolTipDuration () const const
 
void setStatusTip (const QString &)
 
QString statusTip () const const
 
void setWhatsThis (const QString &)
 
QString whatsThis () const const
 
QString accessibleName () const const
 
void setAccessibleName (const QString &name)
 
QString accessibleDescription () const const
 
void setAccessibleDescription (const QString &description)
 
void setLayoutDirection (Qt::LayoutDirection direction)
 
Qt::LayoutDirection layoutDirection () const const
 
void unsetLayoutDirection ()
 
void setLocale (const QLocale &locale)
 
QLocale locale () const const
 
void unsetLocale ()
 
void setFocus ()
 
bool isActiveWindow () const const
 
void activateWindow ()
 
void clearFocus ()
 
void setFocus (Qt::FocusReason reason)
 
Qt::FocusPolicy focusPolicy () const const
 
void setFocusPolicy (Qt::FocusPolicy policy)
 
bool hasFocus () const const
 
void setFocusProxy (QWidget *w)
 
QWidgetfocusProxy () const const
 
Qt::ContextMenuPolicy contextMenuPolicy () const const
 
void setContextMenuPolicy (Qt::ContextMenuPolicy policy)
 
void grabMouse ()
 
void grabMouse (const QCursor &cursor)
 
void releaseMouse ()
 
void grabKeyboard ()
 
void releaseKeyboard ()
 
int grabShortcut (const QKeySequence &key, Qt::ShortcutContext context)
 
void releaseShortcut (int id)
 
void setShortcutEnabled (int id, bool enable)
 
void setShortcutAutoRepeat (int id, bool enable)
 
bool updatesEnabled () const const
 
void setUpdatesEnabled (bool enable)
 
QGraphicsProxyWidgetgraphicsProxyWidget () const const
 
void update ()
 
void repaint ()
 
void update (int x, int y, int w, int h)
 
void update (const QRect &rect)
 
void update (const QRegion &rgn)
 
void repaint (int x, int y, int w, int h)
 
void repaint (const QRect &rect)
 
void repaint (const QRegion &rgn)
 
virtual void setVisible (bool visible)
 
void setHidden (bool hidden)
 
void show ()
 
void hide ()
 
void showMinimized ()
 
void showMaximized ()
 
void showFullScreen ()
 
void showNormal ()
 
bool close ()
 
void raise ()
 
void lower ()
 
void stackUnder (QWidget *w)
 
void move (int x, int y)
 
void move (const QPoint &)
 
void resize (int w, int h)
 
void resize (const QSize &)
 
void setGeometry (int x, int y, int w, int h)
 
void setGeometry (const QRect &)
 
QByteArray saveGeometry () const const
 
bool restoreGeometry (const QByteArray &geometry)
 
void adjustSize ()
 
bool isVisible () const const
 
bool isVisibleTo (const QWidget *ancestor) const const
 
bool isHidden () const const
 
bool isMinimized () const const
 
bool isMaximized () const const
 
bool isFullScreen () const const
 
Qt::WindowStates windowState () const const
 
void setWindowState (Qt::WindowStates windowState)
 
virtual QSize minimumSizeHint () const const
 
QSizePolicy sizePolicy () const const
 
void setSizePolicy (QSizePolicy)
 
void setSizePolicy (QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical)
 
virtual int heightForWidth (int w) const const
 
virtual bool hasHeightForWidth () const const
 
QRegion visibleRegion () const const
 
void setContentsMargins (int left, int top, int right, int bottom)
 
void setContentsMargins (const QMargins &margins)
 
void getContentsMargins (int *left, int *top, int *right, int *bottom) const const
 
QMargins contentsMargins () const const
 
QRect contentsRect () const const
 
QLayoutlayout () const const
 
void setLayout (QLayout *layout)
 
void updateGeometry ()
 
void setParent (QWidget *parent)
 
void setParent (QWidget *parent, Qt::WindowFlags f)
 
void scroll (int dx, int dy)
 
void scroll (int dx, int dy, const QRect &r)
 
QWidgetfocusWidget () const const
 
QWidgetnextInFocusChain () const const
 
QWidgetpreviousInFocusChain () const const
 
bool acceptDrops () const const
 
void setAcceptDrops (bool on)
 
void addAction (QAction *action)
 
void addActions (QList< QAction * > actions)
 
void insertActions (QAction *before, QList< QAction * > actions)
 
void insertAction (QAction *before, QAction *action)
 
void removeAction (QAction *action)
 
QList< QAction * > actions () const const
 
QWidgetparentWidget () const const
 
void setWindowFlags (Qt::WindowFlags type)
 
Qt::WindowFlags windowFlags () const const
 
void setWindowFlag (Qt::WindowType flag, bool on)
 
void overrideWindowFlags (Qt::WindowFlags flags)
 
Qt::WindowType windowType () const const
 
QWidgetchildAt (int x, int y) const const
 
QWidgetchildAt (const QPoint &p) const const
 
void setAttribute (Qt::WidgetAttribute attribute, bool on)
 
bool testAttribute (Qt::WidgetAttribute attribute) const const
 
virtual QPaintEnginepaintEngine () const const override
 
void ensurePolished () const const
 
bool isAncestorOf (const QWidget *child) const const
 
bool hasEditFocus () const const
 
void setEditFocus (bool enable)
 
bool autoFillBackground () const const
 
void setAutoFillBackground (bool enabled)
 
QBackingStorebackingStore () const const
 
QWindowwindowHandle () const const
 
void windowTitleChanged (const QString &title)
 
void windowIconChanged (const QIcon &icon)
 
void windowIconTextChanged (const QString &iconText)
 
void customContextMenuRequested (const QPoint &pos)
 
Qt::InputMethodHints inputMethodHints () const const
 
void setInputMethodHints (Qt::InputMethodHints hints)
 
 QWIDGETSIZE_MAX QWIDGETSIZE_MAX
 
- Public Member Functions inherited from QObject
virtual const QMetaObjectmetaObject () const const
 
 QObject (QObject *parent)
 
virtual ~QObject ()
 
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)
 
QThreadthread () 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)
 
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 &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
const QObjectListchildren () 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< QByteArraydynamicPropertyNames () const const
 
void destroyed (QObject *obj)
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
bool inherits (const char *className) const const
 
void deleteLater ()
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
qobject_cast (QObject *object)
 
qobject_cast (const QObject *object)
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
 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
 
- Public Member Functions inherited from QPaintDevice
virtual ~QPaintDevice ()
 
bool paintingActive () const const
 
int width () const const
 
int height () const const
 
int widthMM () const const
 
int heightMM () const const
 
int logicalDpiX () const const
 
int logicalDpiY () const const
 
int physicalDpiX () const const
 
int physicalDpiY () const const
 
int devicePixelRatio () const const
 
qreal devicePixelRatioF () const const
 
int colorCount () const const
 
int depth () const const
 

Protected Member Functions

bool event (QEvent *event) override
 
virtual void gestureEvent (QGestureEvent *event)
 
void paintEvent (QPaintEvent *event) override
 
void resizeEvent (QResizeEvent *event) override
 
void mousePressEvent (QMouseEvent *event) override
 
void _mousePressEvent (QMouseEvent *event)
 
void mouseMoveEvent (QMouseEvent *event) override
 
void _mouseMoveEvent (QMouseEvent *event)
 
void mouseReleaseEvent (QMouseEvent *event) override
 
void _mouseReleaseEvent (QMouseEvent *event)
 
void mouseDoubleClickEvent (QMouseEvent *event) override
 
void _mouseDoubleClickEvent (QMouseEvent *event)
 
void wheelEvent (QWheelEvent *event) override
 
void leaveEvent (QEvent *event) override
 
void inputMethodEvent (QInputMethodEvent *event) override
 
void focusOutEvent (QFocusEvent *event) override
 
void contextMenuEvent (QContextMenuEvent *event) override
 
- Protected Member Functions inherited from QWidget
virtual void keyPressEvent (QKeyEvent *event)
 
virtual void keyReleaseEvent (QKeyEvent *event)
 
virtual void focusInEvent (QFocusEvent *event)
 
virtual void enterEvent (QEvent *event)
 
virtual void moveEvent (QMoveEvent *event)
 
virtual void closeEvent (QCloseEvent *event)
 
virtual void tabletEvent (QTabletEvent *event)
 
virtual void actionEvent (QActionEvent *event)
 
virtual void dragEnterEvent (QDragEnterEvent *event)
 
virtual void dragMoveEvent (QDragMoveEvent *event)
 
virtual void dragLeaveEvent (QDragLeaveEvent *event)
 
virtual void dropEvent (QDropEvent *event)
 
virtual void showEvent (QShowEvent *event)
 
virtual void hideEvent (QHideEvent *event)
 
virtual bool nativeEvent (const QByteArray &eventType, void *message, long *result)
 
virtual void changeEvent (QEvent *event)
 
virtual int metric (QPaintDevice::PaintDeviceMetric m) const const override
 
virtual void initPainter (QPainter *painter) const const override
 
void updateMicroFocus ()
 
void create (WId window, bool initializeWindow, bool destroyOldWindow)
 
void destroy (bool destroyWindow, bool destroySubWindows)
 
virtual bool focusNextPrevChild (bool next)
 
bool focusNextChild ()
 
bool focusPreviousChild ()
 
- Protected Member Functions inherited from QObject
QObjectsender () const const
 
int senderSignalIndex () const const
 
int receivers (const char *signal) const const
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
virtual void timerEvent (QTimerEvent *event)
 
virtual void childEvent (QChildEvent *event)
 
virtual void customEvent (QEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
- Protected Member Functions inherited from QPaintDevice
 QPaintDevice ()
 

Friends

class MapView
 

Additional Inherited Members

- Static Public Member Functions inherited from QWidget
void setTabOrder (QWidget *first, QWidget *second)
 
QWidgetmouseGrabber ()
 
QWidgetkeyboardGrabber ()
 
QWidgetfind (WId id)
 
QWidgetcreateWindowContainer (QWindow *window, QWidget *parent, Qt::WindowFlags flags)
 
- Static Public Member Functions inherited from QObject
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)
 
- Public Attributes inherited from QWidget
typedef RenderFlags
 
- Public Attributes inherited from QObject
typedef QObjectList
 
- Properties inherited from QWidget
 modal
 
 windowModality
 
 enabled
 
 geometry
 
 frameGeometry
 
 normalGeometry
 
 x
 
 y
 
 pos
 
 frameSize
 
 size
 
 width
 
 height
 
 rect
 
 childrenRect
 
 childrenRegion
 
 sizePolicy
 
 minimumSize
 
 maximumSize
 
 minimumWidth
 
 minimumHeight
 
 maximumWidth
 
 maximumHeight
 
 sizeIncrement
 
 baseSize
 
 palette
 
 font
 
 cursor
 
 mouseTracking
 
 tabletTracking
 
 isActiveWindow
 
 focusPolicy
 
 focus
 
 contextMenuPolicy
 
 updatesEnabled
 
 visible
 
 minimized
 
 maximized
 
 fullScreen
 
 sizeHint
 
 minimumSizeHint
 
 acceptDrops
 
 windowTitle
 
 windowIcon
 
 windowIconText
 
 windowOpacity
 
 windowModified
 
 toolTip
 
 toolTipDuration
 
 statusTip
 
 whatsThis
 
 accessibleName
 
 accessibleDescription
 
 layoutDirection
 
 windowFlags
 
 autoFillBackground
 
 styleSheet
 
 locale
 
 windowFilePath
 
 inputMethodHints
 
- Properties inherited from QObject
 objectName
 

Detailed Description

QWidget for displaying a map.

Needs a pointer to a MapView which defines the view properties.

For faster display, the widget keeps some cached image internally which are of the same size as the widget area. If then for example the map changes, the other caches do not need to be redrawn.

Member Enumeration Documentation

◆ CoordsType

Describes different display formats for coordinates.

Enumerator
MAP_COORDS 

Map coordinates: millimeters on map paper.

PROJECTED_COORDS 

Projected coordinates, e.g.

UTM

GEOGRAPHIC_COORDS 

Geographic WGS84 coordinates.

GEOGRAPHIC_COORDS_DMS 

Geographic WGS84 coordinates in degrees, minutes, seconds.

◆ ZoomOption

Describes how a zoom level can be determined.

Enumerator
ContinuousZoom 

Allow any zoom value in the valid range.

DiscreteZoom 

Adjust the zoom to the closes valid step.

Constructor & Destructor Documentation

◆ MapWidget()

OpenOrienteering::MapWidget::MapWidget ( bool  show_help,
bool  force_antialiasing,
QWidget parent = nullptr 
)

Constructs a new MapWidget.

Parameters
show_helpIf set to true, the map widget shows help texts for empty maps.
force_antialiasingIf set to true, the map widget uses antialiasing for display, even if it is disabled in the program settings. Useful for the symbol editor.
parentOptional QWidget parent.

◆ ~MapWidget()

OpenOrienteering::MapWidget::~MapWidget ( )
override

Destructs the MapWidget.

Member Function Documentation

◆ _mouseDoubleClickEvent()

void OpenOrienteering::MapWidget::_mouseDoubleClickEvent ( QMouseEvent event)
protected

◆ _mouseMoveEvent()

void OpenOrienteering::MapWidget::_mouseMoveEvent ( QMouseEvent event)
protected

◆ _mousePressEvent()

void OpenOrienteering::MapWidget::_mousePressEvent ( QMouseEvent event)
protected

◆ _mouseReleaseEvent()

void OpenOrienteering::MapWidget::_mouseReleaseEvent ( QMouseEvent event)
protected

◆ adjustViewToRect()

void OpenOrienteering::MapWidget::adjustViewToRect ( QRectF  map_rect,
ZoomOption  zoom_option 
)

Sets the view so the rect is centered and zooomed to fill the widget.

◆ applyMapTransform()

void OpenOrienteering::MapWidget::applyMapTransform ( QPainter painter) const

Applies the complete transform to the painter which enables to draw map objects with map coordinates and have them correctly displayed in the widget with the settings of the used MapView.

◆ clearActivityBoundingBox()

void OpenOrienteering::MapWidget::clearActivityBoundingBox ( )

Analogon to clearDrawingBoundingBox() for activities.

◆ clearDrawingBoundingBox()

void OpenOrienteering::MapWidget::clearDrawingBoundingBox ( )

Removes the area set with setDrawingBoundingBox() and triggers a redraw of the widget, if needed.

◆ contextMenuEvent()

void OpenOrienteering::MapWidget::contextMenuEvent ( QContextMenuEvent event)
overrideprotectedvirtual

Reimplemented from QWidget.

◆ cursorPositionChanged

void OpenOrienteering::MapWidget::cursorPositionChanged ( )
signal

Support function for input methods.

◆ enableTouchCursor

void OpenOrienteering::MapWidget::enableTouchCursor ( bool  enabled)
slot

Enables or disables the touch cursor.

◆ ensureVisibilityOfRect()

void OpenOrienteering::MapWidget::ensureVisibilityOfRect ( QRectF  map_rect,
ZoomOption  zoom_option 
)

Adjusts the viewport so the given rect is inside the view.

◆ event()

bool OpenOrienteering::MapWidget::event ( QEvent event)
overrideprotectedvirtual

Reimplemented from QWidget.

◆ focusOutEvent()

void OpenOrienteering::MapWidget::focusOutEvent ( QFocusEvent event)
overrideprotectedvirtual

Reimplemented from QWidget.

◆ gestureEvent()

void OpenOrienteering::MapWidget::gestureEvent ( QGestureEvent event)
protectedvirtual

◆ gesturesEnabled()

bool OpenOrienteering::MapWidget::gesturesEnabled ( ) const
inline

Returns true if gesture recognition is enabled.

◆ getContextMenu()

QWidget * OpenOrienteering::MapWidget::getContextMenu ( )

Returns the widget's context menu widget.

◆ getCoordsDisplay()

MapWidget::CoordsType OpenOrienteering::MapWidget::getCoordsDisplay ( ) const
inline

Returns the coordinate display type set by setCoordsDisplay().

◆ getMapView()

MapView * OpenOrienteering::MapWidget::getMapView ( ) const
inline

Returns the map view used for display.

◆ getTimeSinceLastInteraction()

int OpenOrienteering::MapWidget::getTimeSinceLastInteraction ( )

Returns the time in milliseconds since the last user interaction (mouse press or drag) with the widget.

◆ inputMethodEvent()

void OpenOrienteering::MapWidget::inputMethodEvent ( QInputMethodEvent event)
overrideprotectedvirtual

Reimplemented from QWidget.

◆ inputMethodQuery() [1/2]

QVariant OpenOrienteering::MapWidget::inputMethodQuery ( Qt::InputMethodQuery  property) const
overridevirtual

Support function for input methods.

Reimplemented from QWidget.

◆ inputMethodQuery [2/2]

QVariant OpenOrienteering::MapWidget::inputMethodQuery ( Qt::InputMethodQuery  property,
const QVariant argument 
) const
slot

Support function for input methods.

This two-argument form is undocumented but attempted to call in QInputMethod::queryFocusObject before doing the query via an event.

◆ keyPressEventFilter()

bool OpenOrienteering::MapWidget::keyPressEventFilter ( QKeyEvent event)

Receives key press events from the main window. Delegates the keyPress to the active tool, or handles some shortcuts itself.

◆ keyReleaseEventFilter()

bool OpenOrienteering::MapWidget::keyReleaseEventFilter ( QKeyEvent event)

Receives key press events from the main window. Delegates the keyRelease to the active tool.

◆ leaveEvent()

void OpenOrienteering::MapWidget::leaveEvent ( QEvent event)
overrideprotectedvirtual

Reimplemented from QWidget.

◆ mapToViewport() [1/3]

QPointF OpenOrienteering::MapWidget::mapToViewport ( const MapCoord input) const

Maps map coordinates to viewport (GUI) coordinates.

◆ mapToViewport() [2/3]

QPointF OpenOrienteering::MapWidget::mapToViewport ( const QPointF input) const

Maps map coordinates to viewport (GUI) coordinates.

◆ mapToViewport() [3/3]

QRectF OpenOrienteering::MapWidget::mapToViewport ( const QRectF input) const

Maps map coordinates to viewport (GUI) coordinates.

◆ markObjectAreaDirty()

void OpenOrienteering::MapWidget::markObjectAreaDirty ( const QRectF map_rect)

Mark a rectangular region given in map coordinates of the map cache as dirty, i.e.

redraw needed. This rect is united with possible previous dirty rects of that cache.

◆ markTemplateCacheDirty()

void OpenOrienteering::MapWidget::markTemplateCacheDirty ( const QRectF view_rect,
int  pixel_border,
bool  front_cache 
)

Mark a rectangular region of a template cache as "dirty", i.e.

redraw needed. This rect is united with possible previous dirty rects of that cache.

Parameters
view_rectAffected rect in view coordinates.
pixel_borderAdditional affected extent around the view rect in pixels. Allows to specify zoom-independent extents.
front_cacheIf set to true, invalidates the cache for templates in front of the map, else invalidates the cache for templates behind the map.

◆ mouseDoubleClickEvent()

void OpenOrienteering::MapWidget::mouseDoubleClickEvent ( QMouseEvent event)
overrideprotectedvirtual

Reimplemented from QWidget.

◆ mouseMoveEvent()

void OpenOrienteering::MapWidget::mouseMoveEvent ( QMouseEvent event)
overrideprotectedvirtual

Reimplemented from QWidget.

◆ mousePressEvent()

void OpenOrienteering::MapWidget::mousePressEvent ( QMouseEvent event)
overrideprotectedvirtual

Reimplemented from QWidget.

◆ mouseReleaseEvent()

void OpenOrienteering::MapWidget::mouseReleaseEvent ( QMouseEvent event)
overrideprotectedvirtual

Reimplemented from QWidget.

◆ paintEvent()

void OpenOrienteering::MapWidget::paintEvent ( QPaintEvent event)
overrideprotectedvirtual

Reimplemented from QWidget.

◆ panOffset()

QPoint OpenOrienteering::MapWidget::panOffset ( ) const
inline

Returns the current offset (in pixel) during a map pan operation.

◆ resizeEvent()

void OpenOrienteering::MapWidget::resizeEvent ( QResizeEvent event)
overrideprotectedvirtual

Reimplemented from QWidget.

◆ setActivity()

void OpenOrienteering::MapWidget::setActivity ( MapEditorActivity activity)

Sets the activity to use in this widget.

Does not take ownership of the activity.

◆ setActivityBoundingBox()

void OpenOrienteering::MapWidget::setActivityBoundingBox ( QRectF  map_rect,
int  pixel_border,
bool  do_update 
)

Analogon to setDrawingBoundingBox() for activities.

◆ setCoordsDisplay()

void OpenOrienteering::MapWidget::setCoordsDisplay ( CoordsType  type)

Specify the system and format for displaying coordinates in the cursorpos label.

See CoordsType for the available types.

◆ setCursorposLabel()

void OpenOrienteering::MapWidget::setCursorposLabel ( QLabel cursorpos_label)

Specify the label where the MapWidget will display cursor position information.

◆ setDrawingBoundingBox()

void OpenOrienteering::MapWidget::setDrawingBoundingBox ( QRectF  map_rect,
int  pixel_border,
bool  do_update 
)

Set the given rect as bounding box for the current drawing, i.e.

the graphical display of the active tool. NOTE: Unlike for markTemplateCacheDirty(), multiple calls to these methodsdo not result in uniting all given rects, instead only the last rect is used! Pass QRect() to disable the current drawing.

Parameters
map_rectAffected rect in map coordinates.
pixel_borderAdditional affected extent around the map rect in pixels. Allows to specify zoom-independent extents.
do_updateIf set to true, triggers a redraw of the widget.

◆ setGesturesEnabled()

void OpenOrienteering::MapWidget::setGesturesEnabled ( bool  enabled)

Enables or disables gesture recognition.

MapWidget can recognize gestures, such as two-finger gestures for panning and zooming. However, this may disturb the work with editing tools. So gestures may be disabled.

Parameters
enabledIf true, enables gesture recognition. Otherwise gestures are disabled.

◆ setGPSDisplay()

void OpenOrienteering::MapWidget::setGPSDisplay ( GPSDisplay gps_display)

Sets the GPS display to use.

This is called internally by the GPSDisplay constructor.

◆ setMapView()

void OpenOrienteering::MapWidget::setMapView ( MapView view)

Sets the map view to use for display.

Does not take ownership of the view.

◆ setPanOffset()

void OpenOrienteering::MapWidget::setPanOffset ( const QPoint offset)

Sets the current offset (in pixel) during a map pan operation.

◆ setTemporaryMarkerDisplay()

void OpenOrienteering::MapWidget::setTemporaryMarkerDisplay ( GPSTemporaryMarkers marker_display)

Sets the GPS temporary markers display to use.

This is called internally by the GPSTemporaryMarkers constructor.

◆ setTool()

void OpenOrienteering::MapWidget::setTool ( MapEditorTool tool)

Sets the tool to use in this widget.

Does not take ownership of the tool.

◆ setZoomDisplay()

void OpenOrienteering::MapWidget::setZoomDisplay ( std::function< void(const QString &)>  setter)

Sets the function which will be called to display zoom information.

◆ sizeHint()

QSize OpenOrienteering::MapWidget::sizeHint ( ) const
overridevirtual

Returns the widget's preferred size.

Reimplemented from QWidget.

◆ updateDrawing()

void OpenOrienteering::MapWidget::updateDrawing ( const QRectF map_rect,
int  pixel_border 
)

Triggers a redraw of the MapWidget at the given area.

Parameters
map_rectAffected rect in map coordinates.
pixel_borderAdditional affected extent around the map rect in pixels. Allows to specify zoom-independent extents.

◆ updateDrawingLater()

void OpenOrienteering::MapWidget::updateDrawingLater ( const QRectF map_rect,
int  pixel_border 
)

Variant of updateDrawing() which waits for some milliseconds before calling update() in order to avoid excessive redraws.

◆ updateEverything()

void OpenOrienteering::MapWidget::updateEverything ( )

Invalidates all caches and redraws the whole widget.

Very slow, try to avoid this.

◆ updateEverythingInRect()

void OpenOrienteering::MapWidget::updateEverythingInRect ( const QRect dirty_rect)

Sets all "dirty" region markers to the given rect in viewport coordinates and triggers a redraw of the MapWidget there.

◆ updateMapRect()

void OpenOrienteering::MapWidget::updateMapRect ( const QRectF map_rect,
int  pixel_border,
QRect cache_dirty_rect 
)

Triggers a redraw of the MapWidget at the given area.

◆ updateViewportRect()

void OpenOrienteering::MapWidget::updateViewportRect ( QRect  viewport_rect,
QRect cache_dirty_rect 
)

Triggers a redraw of the MapWidget at the given area.

◆ viewChanged()

void OpenOrienteering::MapWidget::viewChanged ( MapView::ChangeFlags  changes)

Notifies the MapWidget of the view having zoomed, moved or rotated.

◆ viewportToMap()

MapCoord OpenOrienteering::MapWidget::viewportToMap ( const QPoint input) const

Maps viewport (GUI) coordinates to map coordinates.

◆ viewportToMapF() [1/2]

MapCoordF OpenOrienteering::MapWidget::viewportToMapF ( const QPoint input) const

Maps viewport (GUI) coordinates to map coordinates.

◆ viewportToMapF() [2/2]

MapCoordF OpenOrienteering::MapWidget::viewportToMapF ( const QPointF input) const

Maps viewport (GUI) coordinates to map coordinates.

◆ viewportToView() [1/3]

QRectF OpenOrienteering::MapWidget::viewportToView ( const QRect input) const

Maps viewport (GUI) coordinates to view coordinates (see MapView).

◆ viewportToView() [2/3]

QPointF OpenOrienteering::MapWidget::viewportToView ( const QPoint input) const

Maps viewport (GUI) coordinates to view coordinates (see MapView).

◆ viewportToView() [3/3]

QPointF OpenOrienteering::MapWidget::viewportToView ( QPointF  input) const

Maps viewport (GUI) coordinates to view coordinates (see MapView).

◆ viewToViewport() [1/4]

QRectF OpenOrienteering::MapWidget::viewToViewport ( const QRectF input) const

Maps view coordinates (see MapView) to viewport (GUI) coordinates.

◆ viewToViewport() [2/4]

QRectF OpenOrienteering::MapWidget::viewToViewport ( const QRect input) const

Maps view coordinates (see MapView) to viewport (GUI) coordinates.

◆ viewToViewport() [3/4]

QPointF OpenOrienteering::MapWidget::viewToViewport ( const QPoint input) const

Maps view coordinates (see MapView) to viewport (GUI) coordinates.

◆ viewToViewport() [4/4]

QPointF OpenOrienteering::MapWidget::viewToViewport ( QPointF  input) const

Maps view coordinates (see MapView) to viewport (GUI) coordinates.

◆ wheelEvent()

void OpenOrienteering::MapWidget::wheelEvent ( QWheelEvent event)
overrideprotectedvirtual

Reimplemented from QWidget.

Friends And Related Function Documentation

◆ MapView

friend class MapView
friend

The documentation for this class was generated from the following files: