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

Shows all symbols from a map in a size-constrained widget. More...

#include <symbol_render_widget.h>

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

Public Slots

void updateAll ()
 Updates the layout and marks all icons for repainting. More...
 
void updateSingleIcon (int i)
 Marks the icon with the given index for repainting. More...
 
void settingsChanged ()
 Observes settings changes related to symbol display. More...
 

Signals

void selectedSymbolsChanged ()
 The collection of selected symbols changed. More...
 
void switchSymbolClicked ()
 The user triggered "Switch symbol". More...
 
void fillBorderClicked ()
 The user triggered "Fill/Create border". More...
 
void selectObjectsClicked (bool exclusively)
 The user triggered selecting objects with the active symbol. More...
 
void deselectObjectsClicked ()
 The user triggered deselecting objects with the active symbol. More...
 

Public Member Functions

 SymbolRenderWidget (Map *map, bool mobile_mode, QWidget *parent=nullptr)
 Constructs a new SymbolRenderWidget. More...
 
 ~SymbolRenderWidget () override
 Destroys the SymbolRenderWidget. More...
 
int selectedSymbolsCount () const
 Returns the number of selected symbols. More...
 
bool isSymbolSelected (const Symbol *symbol) const
 Checks if the symbol is selected. More...
 
bool isSymbolSelected (int i) const
 Checks if the symbol with given index is selected. More...
 
const SymbolsingleSelectedSymbol () const
 If exactly one symbol is selected, returns this symbol. More...
 
SymbolsingleSelectedSymbol ()
 If exactly one symbol is selected, returns this symbol. More...
 
void selectSingleSymbol (const Symbol *symbol)
 Selects the given symbol exclusively. More...
 
void selectSingleSymbol (int i)
 Selects the given symbol exclusively. More...
 
QSize sizeHint () const override
 Returns the recommended size for the widget. More...
 
void showContextMenu (const QPoint &global_pos)
 Opens the context menu at the given global position. 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)
 
virtual QVariant inputMethodQuery (Qt::InputMethodQuery query) const const
 
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 Slots

void symbolChanged (int pos, const OpenOrienteering::Symbol *new_symbol, const OpenOrienteering::Symbol *old_symbol)
 Updates icon and selection when a symbol changes. More...
 
void symbolDeleted (int pos, const OpenOrienteering::Symbol *old_symbol)
 Updates the widget and the current selection. More...
 
void newPointSymbol ()
 
void newLineSymbol ()
 
void newAreaSymbol ()
 
void newTextSymbol ()
 
void newCombinedSymbol ()
 
void editSymbol ()
 
void scaleSymbol ()
 
void deleteSymbols ()
 
void duplicateSymbol ()
 
void copySymbols ()
 
void pasteSymbols ()
 
void setSelectedSymbolVisibility (bool checked)
 
void setSelectedSymbolProtection (bool checked)
 
void selectObjectsExclusively ()
 
void selectObjectsAdditionally ()
 
void deselectObjects ()
 
void selectAll ()
 
void selectUnused ()
 
void invertSelection ()
 
void sortByNumber ()
 
void sortByColor ()
 
void sortByColorPriority ()
 
void setCustomIconsVisible (bool checked)
 

Protected Member Functions

void resizeEvent (QResizeEvent *event) override
 
void adjustLayout ()
 Recalculates the layout and size. More...
 
QPoint iconPosition (int i) const
 Returns the top-left coordinates of a symbol's icon. More...
 
int symbolIndexAt (const QPoint &pos) const
 Returns the index of the symbol represented at a particular location. More...
 
void paintEvent (QPaintEvent *event) override
 
void drawIcon (QPainter &painter, int i) const
 Draws the icon and its decoration (hidden, protected). More...
 
void mouseMoveEvent (QMouseEvent *event) override
 
void mousePressEvent (QMouseEvent *event) override
 
void mouseReleaseEvent (QMouseEvent *event) override
 
void mouseDoubleClickEvent (QMouseEvent *event) override
 
void leaveEvent (QEvent *event) override
 
void hover (const QPoint &pos)
 Handles hovering over the icons, i.e. More...
 
void dragEnterEvent (QDragEnterEvent *event) override
 
void dragMoveEvent (QDragMoveEvent *event) override
 
void dropEvent (QDropEvent *event) override
 
bool dropPosition (const QPoint &pos, int &row, int &pos_in_row)
 Determines the drop location for a given pointing device position. More...
 
QRect dropIndicatorRect (int row, int pos_in_row)
 Determines a drop indicator rectangle for a given location in the icons. More...
 
bool newSymbol (Symbol *prototype)
 Takes care of editing and inserting a newly created symbol. More...
 
template<typename T >
void sort (T compare)
 Sorts the map's symbol set by arbitrary criteria. More...
 
void updateSelectedIcons ()
 Marks the icons of the selected symbols for repainting. More...
 
void emitGuarded_selectedSymbolsChanged ()
 Emits selectedSymbolsChanged() while temporarily locking the symbol selection against changes. More...
 
void contextMenuEvent (QContextMenuEvent *event) override
 Receives context menu events and opens the context menu. More...
 
void updateContextMenuState ()
 Updates the state of the actions in the context menu. More...
 
- Protected Member Functions inherited from QWidget
virtual bool event (QEvent *event) override
 
virtual void wheelEvent (QWheelEvent *event)
 
virtual void keyPressEvent (QKeyEvent *event)
 
virtual void keyReleaseEvent (QKeyEvent *event)
 
virtual void focusInEvent (QFocusEvent *event)
 
virtual void focusOutEvent (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 dragLeaveEvent (QDragLeaveEvent *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
 
virtual void inputMethodEvent (QInputMethodEvent *event)
 
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 ()
 

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

Shows all symbols from a map in a size-constrained widget.

SymbolRenderWidget lets the user select symbols and perform actions on them. It is a plain widget which does not implement scrolling but takes as much height as necessary for given width and number of symbols. Scrolling is realized by SymbolWidget.

Constructor & Destructor Documentation

◆ SymbolRenderWidget()

OpenOrienteering::SymbolRenderWidget::SymbolRenderWidget ( Map map,
bool  mobile_mode,
QWidget parent = nullptr 
)

Constructs a new SymbolRenderWidget.

Parameters
mapThe map which provides the symbols. Must not be nullptr.
mobile_modeIf true, enables a special mode for mobile devices.
parentThe parent QWidget.

◆ ~SymbolRenderWidget()

OpenOrienteering::SymbolRenderWidget::~SymbolRenderWidget ( )
override

Destroys the SymbolRenderWidget.

Member Function Documentation

◆ adjustLayout()

void OpenOrienteering::SymbolRenderWidget::adjustLayout ( )
protected

Recalculates the layout and size.

This function reads the icon size from the settings and the widget's current width and adjusts the number of icons per row, the number of rows and the widget's height to fit the current number of symbols.

◆ contextMenuEvent()

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

Receives context menu events and opens the context menu.

Reimplemented from QWidget.

◆ copySymbols

void OpenOrienteering::SymbolRenderWidget::copySymbols ( )
protectedslot

◆ deleteSymbols

void OpenOrienteering::SymbolRenderWidget::deleteSymbols ( )
protectedslot

◆ deselectObjects

void OpenOrienteering::SymbolRenderWidget::deselectObjects ( )
protectedslot

◆ deselectObjectsClicked

void OpenOrienteering::SymbolRenderWidget::deselectObjectsClicked ( )
signal

The user triggered deselecting objects with the active symbol.

◆ dragEnterEvent()

void OpenOrienteering::SymbolRenderWidget::dragEnterEvent ( QDragEnterEvent event)
overrideprotectedvirtual

Reimplemented from QWidget.

◆ dragMoveEvent()

void OpenOrienteering::SymbolRenderWidget::dragMoveEvent ( QDragMoveEvent event)
overrideprotectedvirtual

Reimplemented from QWidget.

◆ drawIcon()

void OpenOrienteering::SymbolRenderWidget::drawIcon ( QPainter painter,
int  i 
) const
protected

Draws the icon and its decoration (hidden, protected).

The icon is drawn at (0, 0) with the current icon size.

Parameters
painterThe QPainter to be used (must be active).
iThe index of the symbol.

◆ dropEvent()

void OpenOrienteering::SymbolRenderWidget::dropEvent ( QDropEvent event)
overrideprotectedvirtual

Reimplemented from QWidget.

◆ dropIndicatorRect()

QRect OpenOrienteering::SymbolRenderWidget::dropIndicatorRect ( int  row,
int  pos_in_row 
)
protected

Determines a drop indicator rectangle for a given location in the icons.

Parameters
rowThe icon row where to insert the dropped symbol.
pos_in_rowThe position in the row where to insert the dropped symbol.

◆ dropPosition()

bool OpenOrienteering::SymbolRenderWidget::dropPosition ( const QPoint pos,
int &  row,
int &  pos_in_row 
)
protected

Determines the drop location for a given pointing device position.

Parameters
posThe pointing device position.
rowThe icon row where to insert the dropped symbol.
pos_in_rowThe position in the row where to insert the dropped symbol.
Returns
If there is a valid drop position, returns true, otherwise false.

◆ duplicateSymbol

void OpenOrienteering::SymbolRenderWidget::duplicateSymbol ( )
protectedslot

◆ editSymbol

void OpenOrienteering::SymbolRenderWidget::editSymbol ( )
protectedslot

◆ emitGuarded_selectedSymbolsChanged()

void OpenOrienteering::SymbolRenderWidget::emitGuarded_selectedSymbolsChanged ( )
protected

Emits selectedSymbolsChanged() while temporarily locking the symbol selection against changes.

An active tool could catch the selectedSymbolsChanged() signal and finish its editing for that reason. It would than insert a new object to the map and so trigger another change of selection. Emitting selectedSymbolsChanged() via this method suppresses behavior by setting the selection_locked flag before emitting the actual signal and resetting the flag on return.

◆ fillBorderClicked

void OpenOrienteering::SymbolRenderWidget::fillBorderClicked ( )
signal

The user triggered "Fill/Create border".

Todo:
Merge with/Reuse corresponding action in MapEditorController.

◆ hover()

void OpenOrienteering::SymbolRenderWidget::hover ( const QPoint pos)
protected

Handles hovering over the icons, i.e.

controlling the tool tip.

Parameters
posThe current location of the pointing device.

◆ iconPosition()

QPoint OpenOrienteering::SymbolRenderWidget::iconPosition ( int  i) const
protected

Returns the top-left coordinates of a symbol's icon.

Parameters
iThe index of the symbol.

◆ invertSelection

void OpenOrienteering::SymbolRenderWidget::invertSelection ( )
protectedslot

◆ isSymbolSelected() [1/2]

bool OpenOrienteering::SymbolRenderWidget::isSymbolSelected ( const Symbol symbol) const

Checks if the symbol is selected.

◆ isSymbolSelected() [2/2]

bool OpenOrienteering::SymbolRenderWidget::isSymbolSelected ( int  i) const

Checks if the symbol with given index is selected.

◆ leaveEvent()

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

Reimplemented from QWidget.

◆ mouseDoubleClickEvent()

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

Reimplemented from QWidget.

◆ mouseMoveEvent()

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

Reimplemented from QWidget.

◆ mousePressEvent()

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

Reimplemented from QWidget.

◆ mouseReleaseEvent()

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

Reimplemented from QWidget.

◆ newAreaSymbol

void OpenOrienteering::SymbolRenderWidget::newAreaSymbol ( )
protectedslot

◆ newCombinedSymbol

void OpenOrienteering::SymbolRenderWidget::newCombinedSymbol ( )
protectedslot

◆ newLineSymbol

void OpenOrienteering::SymbolRenderWidget::newLineSymbol ( )
protectedslot

◆ newPointSymbol

void OpenOrienteering::SymbolRenderWidget::newPointSymbol ( )
protectedslot

◆ newSymbol()

bool OpenOrienteering::SymbolRenderWidget::newSymbol ( Symbol prototype)
protected

Takes care of editing and inserting a newly created symbol.

Parameters
prototypeThe symbol which will be edited and inserted in the map.
Returns
If editing is cancelled, returns false. Otherwise returns true.

◆ newTextSymbol

void OpenOrienteering::SymbolRenderWidget::newTextSymbol ( )
protectedslot

◆ paintEvent()

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

Reimplemented from QWidget.

◆ pasteSymbols

void OpenOrienteering::SymbolRenderWidget::pasteSymbols ( )
protectedslot
Todo:
Adjust message to this particular action, and remove Map context. See also MapEditor::importMap.

◆ resizeEvent()

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

Reimplemented from QWidget.

◆ scaleSymbol

void OpenOrienteering::SymbolRenderWidget::scaleSymbol ( )
protectedslot

◆ selectAll

void OpenOrienteering::SymbolRenderWidget::selectAll ( )
protectedslot

◆ selectedSymbolsChanged

void OpenOrienteering::SymbolRenderWidget::selectedSymbolsChanged ( )
signal

The collection of selected symbols changed.

◆ selectedSymbolsCount()

int OpenOrienteering::SymbolRenderWidget::selectedSymbolsCount ( ) const
inline

Returns the number of selected symbols.

◆ selectObjectsAdditionally

void OpenOrienteering::SymbolRenderWidget::selectObjectsAdditionally ( )
protectedslot

◆ selectObjectsClicked

void OpenOrienteering::SymbolRenderWidget::selectObjectsClicked ( bool  exclusively)
signal

The user triggered selecting objects with the active symbol.

Parameters
exclusivelyIf true, an existing selection is replaced, otherwise it is extend.

◆ selectObjectsExclusively

void OpenOrienteering::SymbolRenderWidget::selectObjectsExclusively ( )
protectedslot

◆ selectSingleSymbol() [1/2]

void OpenOrienteering::SymbolRenderWidget::selectSingleSymbol ( const Symbol symbol)

Selects the given symbol exclusively.

Deselects other symbols, if there was a different selection before.

◆ selectSingleSymbol() [2/2]

void OpenOrienteering::SymbolRenderWidget::selectSingleSymbol ( int  i)

Selects the given symbol exclusively.

Selects the symbol with the given number. Deselects other symbols, if there was a different selection before.

◆ selectUnused

void OpenOrienteering::SymbolRenderWidget::selectUnused ( )
protectedslot

◆ setCustomIconsVisible

void OpenOrienteering::SymbolRenderWidget::setCustomIconsVisible ( bool  checked)
protectedslot

◆ setSelectedSymbolProtection

void OpenOrienteering::SymbolRenderWidget::setSelectedSymbolProtection ( bool  checked)
protectedslot

◆ setSelectedSymbolVisibility

void OpenOrienteering::SymbolRenderWidget::setSelectedSymbolVisibility ( bool  checked)
protectedslot

◆ settingsChanged

void OpenOrienteering::SymbolRenderWidget::settingsChanged ( )
slot

Observes settings changes related to symbol display.

◆ showContextMenu()

void OpenOrienteering::SymbolRenderWidget::showContextMenu ( const QPoint global_pos)

Opens the context menu at the given global position.

◆ singleSelectedSymbol() [1/2]

const Symbol * OpenOrienteering::SymbolRenderWidget::singleSelectedSymbol ( ) const

If exactly one symbol is selected, returns this symbol.

Otherwise returns nullptr.

◆ singleSelectedSymbol() [2/2]

Symbol * OpenOrienteering::SymbolRenderWidget::singleSelectedSymbol ( )

If exactly one symbol is selected, returns this symbol.

Otherwise returns nullptr.

◆ sizeHint()

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

Returns the recommended size for the widget.

Reimplemented from QWidget::sizeHint().

Reimplemented from QWidget.

◆ sort()

template<typename T >
void OpenOrienteering::SymbolRenderWidget::sort ( compare)
protected

Sorts the map's symbol set by arbitrary criteria.

◆ sortByColor

void OpenOrienteering::SymbolRenderWidget::sortByColor ( )
protectedslot

◆ sortByColorPriority

void OpenOrienteering::SymbolRenderWidget::sortByColorPriority ( )
protectedslot

◆ sortByNumber

void OpenOrienteering::SymbolRenderWidget::sortByNumber ( )
protectedslot

◆ switchSymbolClicked

void OpenOrienteering::SymbolRenderWidget::switchSymbolClicked ( )
signal

The user triggered "Switch symbol".

Todo:
Merge with/Reuse corresponding action in MapEditorController.

◆ symbolChanged

void OpenOrienteering::SymbolRenderWidget::symbolChanged ( int  pos,
const OpenOrienteering::Symbol new_symbol,
const OpenOrienteering::Symbol old_symbol 
)
protectedslot

Updates icon and selection when a symbol changes.

See also
Map::symbolChanged()

◆ symbolDeleted

void OpenOrienteering::SymbolRenderWidget::symbolDeleted ( int  pos,
const OpenOrienteering::Symbol old_symbol 
)
protectedslot

Updates the widget and the current selection.

See also
Map::symbolDeleted()

◆ symbolIndexAt()

int OpenOrienteering::SymbolRenderWidget::symbolIndexAt ( const QPoint pos) const
protected

Returns the index of the symbol represented at a particular location.

Parameters
posThe location

◆ updateAll

void OpenOrienteering::SymbolRenderWidget::updateAll ( )
slot

Updates the layout and marks all icons for repainting.

◆ updateContextMenuState()

void OpenOrienteering::SymbolRenderWidget::updateContextMenuState ( )
protected

Updates the state of the actions in the context menu.

◆ updateSelectedIcons()

void OpenOrienteering::SymbolRenderWidget::updateSelectedIcons ( )
protected

Marks the icons of the selected symbols for repainting.

◆ updateSingleIcon

void OpenOrienteering::SymbolRenderWidget::updateSingleIcon ( int  i)
slot

Marks the icon with the given index for repainting.


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