|
Krita Source Code Documentation
|
#include <KoZoomTool.h>
Inheritance diagram for KoZoomTool:Public Member Functions | |
| void | activate (const QSet< KoShape * > &shapes) override |
| void | keyPressEvent (QKeyEvent *event) override |
| void | keyReleaseEvent (QKeyEvent *event) override |
| KoZoomTool (KoCanvasBase *canvas) | |
| void | mouseDoubleClickEvent (KoPointerEvent *event) override |
| void | mouseMoveEvent (KoPointerEvent *event) override |
| void | mouseReleaseEvent (KoPointerEvent *event) override |
| void | setCanvasController (KoCanvasController *controller) |
| void | setZoomInMode (bool zoomIn) |
Public Member Functions inherited from KoInteractionTool | |
| KoInteractionTool (KoCanvasBase *canvas) | |
| void | mousePressEvent (KoPointerEvent *event) override |
| void | paint (QPainter &painter, const KoViewConverter &converter) override |
| ~KoInteractionTool () override | |
Public Member Functions inherited from KoToolBase | |
| QAction * | action (const QString &name) const |
| KoCanvasBase * | canvas () const |
| Returns the canvas the tool is working on. | |
| virtual void | copy () const |
| QCursor | cursor () const |
| return the last emitted cursor | |
| virtual void | customMoveEvent (KoPointerEvent *event) |
| virtual void | customPressEvent (KoPointerEvent *event) |
| virtual void | customReleaseEvent (KoPointerEvent *event) |
| virtual void | cut () |
| virtual QRectF | decorationsRect () const |
| int | decorationThickness () const |
| decorationThickness The minimum thickness for tool decoration lines, this is derived from the screen magnification, thus the HiDPI settings. Note: to use this effectively, also set the pen to isCosmetic(true); | |
| virtual void | deleteSelection () |
| virtual void | deselect () |
| deselect the tool should clear the selection if it has one. | |
| virtual void | dragLeaveEvent (QDragLeaveEvent *event) |
| virtual void | dragMoveEvent (QDragMoveEvent *event, const QPointF &point) |
| virtual void | dropEvent (QDropEvent *event, const QPointF &point) |
| virtual void | explicitUserStrokeEndRequest () |
| explicitUserStrokeEndRequest is called by the input manager when the user presses Enter key or any equivalent. This callback comes before requestStrokeEnd(), which comes from a different source. | |
| KoToolFactoryBase * | factory () const |
| virtual void | focusInEvent (QFocusEvent *event) |
| virtual void | focusOutEvent (QFocusEvent *event) |
| virtual bool | hasSelection () |
| virtual void | inputMethodEvent (QInputMethodEvent *event) |
| virtual QVariant | inputMethodQuery (Qt::InputMethodQuery query) const |
| bool | isInTextMode () const |
| bool | isOpacityPresetMode () const |
| KoToolBase (KoCanvasBase *canvas) | |
| bool | maskSyntheticEvents () const |
| virtual void | mouseTripleClickEvent (KoPointerEvent *event) |
| QList< QPointer< QWidget > > | optionWidgets () |
| virtual bool | paste () |
| virtual QMenu * | popupActionsMenu () |
| virtual KisPopupWidgetInterface * | popupWidget () |
| virtual bool | selectAll () |
| selectAll select all data the tool can select. | |
| virtual KoToolSelection * | selection () |
| Q_INVOKABLE QString | toolId () const |
| virtual bool | wantsAutoScroll () const |
| ~KoToolBase () override | |
Private Member Functions | |
| KoInteractionStrategy * | createStrategy (KoPointerEvent *event) override |
| void | updateCursor (bool swap) |
Private Attributes | |
| KoCanvasController * | m_controller |
| QCursor | m_inCursor |
| QCursor | m_outCursor |
| bool | m_zoomInMode |
Additional Inherited Members | |
Public Slots inherited from KoToolBase | |
| virtual void | canvasResourceChanged (int key, const QVariant &res) |
| virtual void | deactivate () |
| virtual void | documentResourceChanged (int key, const QVariant &res) |
| virtual void | repaintDecorations () |
| virtual void | requestRedoDuringStroke () |
| virtual void | requestStrokeCancellation () |
| virtual void | requestStrokeEnd () |
| virtual void | requestUndoDuringStroke () |
| void | setStatusText (const QString &statusText) |
| void | updateOptionsWidgetIcons () |
Signals inherited from KoToolBase | |
| void | activateTool (const QString &id) |
| void | cursorChanged (const QCursor &cursor) |
| void | selectionChanged (bool hasSelection) |
| void | statusTextChanged (const QString &statusText) |
| void | textModeChanged (bool inTextMode) |
Protected Attributes inherited from KoToolBase | |
| KoToolBasePrivate * | d_ptr |
Definition at line 20 of file KoZoomTool.h.
|
explicit |
Create a new tool; typically not called by applications, only by the KoToolManager
| canvas | the canvas this tool works for. |
Definition at line 21 of file KoZoomTool.cpp.
References m_inCursor, and m_outCursor.
This method is called when this tool instance is activated. For any main window there is only one tool active at a time, which then gets all user input. Switching between tools will call deactivate on one and activate on the new tool allowing the tool to flush items (like a selection) when it is not in use.
| shapes | the set of shapes that are selected or suggested for editing by a selected shape for the tool to work on. Not all shapes will be meant for this tool. |
Reimplemented from KoToolBase.
Definition at line 61 of file KoZoomTool.cpp.
References updateCursor().
|
overrideprotectedvirtual |
Reimplement this if your tool actually has an option widget. Sets the option widget to 0 by default.
Reimplemented from KoToolBase.
Definition at line 88 of file KoZoomTool.cpp.
|
overrideprivatevirtual |
Implements KoInteractionTool.
Definition at line 71 of file KoZoomTool.cpp.
References KoPointerEvent::button(), KoZoomStrategy::forceZoomIn(), KoZoomStrategy::forceZoomOut(), m_controller, m_zoomInMode, KoPointerEvent::modifiers(), and KoPointerEvent::point.
|
overridevirtual |
Called when a key is pressed. Implementors should call event->ignore() if they do not actually use the event. Default implementation ignores this event.
| event | state and reason of this key press |
Reimplemented from KoInteractionTool.
Definition at line 45 of file KoZoomTool.cpp.
References KoInteractionTool::keyPressEvent(), and updateCursor().
|
overridevirtual |
Called when a key is released Implementors should call event->ignore() if they do not actually use the event. Default implementation ignores this event.
| event | state and reason of this key release |
Reimplemented from KoInteractionTool.
Definition at line 53 of file KoZoomTool.cpp.
References KoInteractionTool::keyReleaseEvent(), and updateCursor().
|
overridevirtual |
Called when (one of) the mouse or stylus buttons is double clicked. Implementors should call event->ignore() if they do not actually use the event. Default implementation ignores this event.
| event | state and reason of this mouse or stylus press |
Reimplemented from KoToolBase.
Definition at line 66 of file KoZoomTool.cpp.
References KoInteractionTool::mousePressEvent().
|
overridevirtual |
Called when the mouse or stylus moved over the canvas. Implementors should call event->ignore() if they do not actually use the event.
| event | state and reason of this mouse or stylus move |
Reimplemented from KoInteractionTool.
Definition at line 38 of file KoZoomTool.cpp.
References KoPointerEvent::modifiers(), KoInteractionTool::mouseMoveEvent(), and updateCursor().
|
overridevirtual |
Called when (one of) the mouse or stylus buttons is released. Implementors should call event->ignore() if they do not actually use the event.
| event | state and reason of this mouse or stylus release |
Reimplemented from KoInteractionTool.
Definition at line 33 of file KoZoomTool.cpp.
References KoInteractionTool::mouseReleaseEvent().
|
inline |
Definition at line 35 of file KoZoomTool.h.
References m_controller.
| void KoZoomTool::setZoomInMode | ( | bool | zoomIn | ) |
Definition at line 93 of file KoZoomTool.cpp.
References m_zoomInMode, and updateCursor().
|
private |
Definition at line 99 of file KoZoomTool.cpp.
References m_inCursor, m_outCursor, m_zoomInMode, and KoToolBase::useCursor().
|
private |
Definition at line 49 of file KoZoomTool.h.
|
private |
Definition at line 50 of file KoZoomTool.h.
|
private |
Definition at line 51 of file KoZoomTool.h.
|
private |
Definition at line 52 of file KoZoomTool.h.