|
Krita Source Code Documentation
|
#include <KoToolBase.h>
Inheritance diagram for KoToolBase:Public Slots | |
| virtual void | activate (const QSet< KoShape * > &shapes) |
| 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 | |
| void | activateTool (const QString &id) |
| void | cursorChanged (const QCursor &cursor) |
| void | selectionChanged (bool hasSelection) |
| void | statusTextChanged (const QString &statusText) |
| void | textModeChanged (bool inTextMode) |
Public Member Functions | |
| 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 |
| virtual void | keyPressEvent (QKeyEvent *event) |
| virtual void | keyReleaseEvent (QKeyEvent *event) |
| KoToolBase (KoCanvasBase *canvas) | |
| bool | maskSyntheticEvents () const |
| virtual void | mouseDoubleClickEvent (KoPointerEvent *event) |
| virtual void | mouseMoveEvent (KoPointerEvent *event)=0 |
| virtual void | mousePressEvent (KoPointerEvent *event)=0 |
| virtual void | mouseReleaseEvent (KoPointerEvent *event)=0 |
| virtual void | mouseTripleClickEvent (KoPointerEvent *event) |
| QList< QPointer< QWidget > > | optionWidgets () |
| virtual void | paint (QPainter &painter, const KoViewConverter &converter)=0 |
| 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 | |
Protected Member Functions | |
| virtual QWidget * | createOptionWidget () |
| virtual QList< QPointer< QWidget > > | createOptionWidgets () |
| int | grabSensitivity () const |
| Convenience function to get the current grab sensitivity. | |
| qreal | handleDocRadius () const |
| QRectF | handleGrabRect (const QPointF &position) const |
| QRectF | handlePaintRect (const QPointF &position) const |
| int | handleRadius () const |
| Convenience function to get the current handle radius. | |
| bool | isActivated () const |
| KoToolBase (KoToolBasePrivate &dd) | |
| KoPointerEvent * | lastDeliveredPointerEvent () const |
| void | setAbstractResource (KoAbstractCanvasResourceInterfaceSP abstractResource) |
| void | setConverter (KoDerivedResourceConverterSP converter) |
| void | setIsOpacityPresetMode (bool value) |
| void | setMaskSyntheticEvents (bool value) |
| void | setTextMode (bool value) |
| QHash< int, KoAbstractCanvasResourceInterfaceSP > | toolAbstractResources () |
| QHash< int, KoDerivedResourceConverterSP > | toolConverters () |
| void | useCursor (const QCursor &cursor) |
Protected Attributes | |
| KoToolBasePrivate * | d_ptr |
Private Member Functions | |
| KoToolBase () | |
| KoToolBase (const KoToolBase &) | |
| KoToolBase & | operator= (const KoToolBase &) |
| void | setFactory (KoToolFactoryBase *factory) |
Friends | |
| class | KoToolManager |
Abstract base class for all tools. Tools can create or manipulate flake shapes, canvas state or any other thing that a user may wish to do to his document or his view on a document with a pointing device.
There exists an instance of every tool for every pointer device. These instances are managed by the toolmanager..
Definition at line 56 of file KoToolBase.h.
|
explicit |
Constructor, normally only called by the factory (see KoToolFactoryBase)
| canvas | the canvas interface this tool will work for. |
Definition at line 41 of file KoToolBase.cpp.
|
override |
|
protected |
Definition at line 48 of file KoToolBase.cpp.
|
private |
|
private |
| QAction * KoToolBase::action | ( | const QString & | name | ) | const |
Retrieve an action by name.
Definition at line 202 of file KoToolBase.cpp.
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 in KisToolColorSampler, KoPencilTool, KoPathTool, KoZoomTool, KisToolPolylineBase, KisToolRectangleBase, KisToolSelectBase< __KisToolSelectEllipticalLocal >, KisToolSelectBase< __KisToolSelectOutlineLocal >, KisToolSelectBase< __KisToolSelectPolygonalLocal >, KisToolSelectBase< __KisToolSelectRectangularLocal >, KisToolLine, KarbonCalligraphyTool, SvgTextTool, and KisToolDyna.
Definition at line 77 of file KoToolBase.cpp.
|
signal |
Emitted when this tool wants itself to be replaced by another tool.
| id | the identification of the desired tool |
| KoCanvasBase * KoToolBase::canvas | ( | ) | const |
Returns the canvas the tool is working on.
Definition at line 262 of file KoToolBase.cpp.
|
virtualslot |
This method is called whenever a property in the resource provider associated with the canvas this tool belongs to changes. An example is currently selected foreground color.
Reimplemented in DefaultTool, KisToolCrop, and KisToolPaint.
Definition at line 91 of file KoToolBase.cpp.
|
virtual |
copies the tools selection to the clipboard. The default implementation is empty to aid tools that don't have any selection.
Reimplemented in DefaultTool, and SvgTextTool.
Definition at line 362 of file KoToolBase.cpp.
|
protectedvirtual |
Reimplement this if your tool actually has an option widget. Sets the option widget to 0 by default.
Reimplemented in KoZoomTool, KisTool, KisToolPaint, KisToolSelectBase< __KisToolSelectEllipticalLocal >, KisToolSelectBase< __KisToolSelectOutlineLocal >, KisToolSelectBase< __KisToolSelectPolygonalLocal >, KisToolSelectBase< __KisToolSelectRectangularLocal >, KisToolShape, KisAssistantTool, KisToolBrush, KisToolColorSampler, KisToolFill, KisToolGradient, KisToolLine, KisToolMeasure, KisToolMove, KisToolMultihand, ToolReferenceImages, SvgTextTool, KisToolCrop, KisToolDyna, KisToolEncloseAndFill, KisDynamicDelegatedTool< KisToolShape >, KisToolLazyBrush, KisToolPolyline, KisToolSmartPatch, and KisToolTransform.
Definition at line 211 of file KoToolBase.cpp.
Reimplemented in KoCreatePathTool, KoPencilTool, KoPathTool, KisToolRectangleBase, __KisToolPathLocalTool, __KisToolPencilLocalTool, DefaultTool, ToolReferenceImages, KarbonCalligraphyTool, __KisToolSelectPathLocalTool, and KisToolPathLocalTool.
Definition at line 216 of file KoToolBase.cpp.
References createOptionWidget(), and toolId().
| QCursor KoToolBase::cursor | ( | ) | const |
return the last emitted cursor
Definition at line 246 of file KoToolBase.cpp.
|
signal |
Emitted by useCursor() when the cursor to display on the canvas is changed. The KoToolManager should connect to this signal to handle cursors further.
|
virtual |
Called when a custom device moved over the canvas. Implementors should call event->ignore() if they do not actually use the event.
| event | state and reason of this custom device move |
Definition at line 180 of file KoToolBase.cpp.
|
virtual |
Called when (one of) a custom device buttons is pressed. Implementors should call event->ignore() if they do not actually use the event.
| event | state and reason of this custom device press |
Definition at line 170 of file KoToolBase.cpp.
|
virtual |
Called when (one of) a custom device buttons is released. Implementors should call event->ignore() if they do not actually use the event.
| event | state and reason of this custom device release |
Definition at line 175 of file KoToolBase.cpp.
|
virtual |
Cut the tools selection and copy it to the clipboard. The default implementation calls copy() and then deleteSelection()
Definition at line 256 of file KoToolBase.cpp.
References copy(), and deleteSelection().
|
virtualslot |
This method is called whenever this tool is no longer the active tool
Reimplemented in KoPencilTool, KoPathTool, KisToolPolylineBase, KisToolRectangleBase, KisToolSelectBase< __KisToolSelectEllipticalLocal >, KisToolSelectBase< __KisToolSelectOutlineLocal >, KisToolSelectBase< __KisToolSelectPolygonalLocal >, KisToolSelectBase< __KisToolSelectRectangularLocal >, KisToolColorSampler, KisToolLine, KarbonCalligraphyTool, and SvgTextTool.
Definition at line 85 of file KoToolBase.cpp.
|
virtual |
Reimplemented in KoCreatePathTool, KoPathTool, DefaultTool, SvgTextTool, and KisDynamicDelegatedTool< KisToolShape >.
Definition at line 407 of file KoToolBase.cpp.
| int KoToolBase::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);
Definition at line 295 of file KoToolBase.cpp.
|
virtual |
Delete the tools selection. The default implementation is empty to aid tools that don't have any selection.
Reimplemented in KoPathTool, KisTool, DefaultTool, ToolReferenceImages, and SvgTextTool.
Definition at line 252 of file KoToolBase.cpp.
|
virtual |
deselect the tool should clear the selection if it has one.
Reimplemented in KoPathTool, DefaultTool, and SvgTextTool.
Definition at line 358 of file KoToolBase.cpp.
|
virtualslot |
This method is called whenever a property in the resource provider associated with the document this tool belongs to changes. An example is the handle radius
Definition at line 97 of file KoToolBase.cpp.
|
virtual |
Handle the dragLeaveEvent Basically just a notification that the drag is no long relevant The tool should Accept the event if it is meaningful; Default implementation does not.
Definition at line 372 of file KoToolBase.cpp.
|
virtual |
Handle the dragMoveEvent A tool typically has one or more shapes selected and dropping into should do something meaningful for this specific shape and tool combination. For example dropping text in a text tool. The tool should Accept the event if it is meaningful; Default implementation does not.
Definition at line 366 of file KoToolBase.cpp.
|
virtual |
Handle the dropEvent A tool typically has one or more shapes selected and dropping into should do something meaningful for this specific shape and tool combination. For example dropping text in a text tool. The tool should Accept the event if it is meaningful; Default implementation does not.
Definition at line 377 of file KoToolBase.cpp.
|
virtual |
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.
Reimplemented in KoPathTool, DefaultTool, KisDynamicDelegatedTool< KisToolShape >, and KisToolLazyBrush.
Definition at line 129 of file KoToolBase.cpp.
| KoToolFactoryBase * KoToolBase::factory | ( | ) | const |
The factory holds properties common to all instances of the same tool type, such as the string identifying the class or the icon name.
Not all tool instances have a factory reference, for example the "delegated" inner implementations to which events are forwarded don't have one, as well as instances created by regression tests.
Every instance used by the tool manager has a factory reference and a tool identifier, but they're not available during construction.
Definition at line 234 of file KoToolBase.cpp.
|
virtual |
This passes on the focusInEven from the canvas widget, which can be used to activate animating decorations (like a cursor blink effect in the text tool).
Reimplemented in SvgTextTool.
Definition at line 160 of file KoToolBase.cpp.
|
virtual |
This passes on the focusInEven from the canvas widget, which can be used to deactivate animating decorations (like a cursor blink effect in the text tool).
Reimplemented in SvgTextTool.
Definition at line 165 of file KoToolBase.cpp.
|
protected |
Convenience function to get the current grab sensitivity.
Definition at line 309 of file KoToolBase.cpp.
|
protected |
Convenience function to get the current handle radius measured in document coordinates (points)
Definition at line 287 of file KoToolBase.cpp.
References handleRadius(), and KoViewConverter::viewToDocument().
|
protected |
Returns a handle grab rect at the given position.
The position is expected to be in document coordinates. The grab sensitivity canvas resource is used for the dimension of the rectangle.
Definition at line 320 of file KoToolBase.cpp.
References grabSensitivity(), and KoViewConverter::viewToDocument().
|
protected |
Returns a handle paint rect at the given position.
The position is expected to be in document coordinates. The handle radius canvas resource is used for the dimension of the rectangle.
Definition at line 330 of file KoToolBase.cpp.
References handleRadius(), and KoViewConverter::viewToDocument().
|
protected |
Convenience function to get the current handle radius.
Definition at line 273 of file KoToolBase.cpp.
|
virtual |
Reimplemented in ToolReferenceImages, and SvgTextTool.
Definition at line 383 of file KoToolBase.cpp.
References KoToolSelection::hasSelection(), and selection().
|
virtual |
Text entry of complex text, like CJK, can be made more interactive if a tool implements this and the InputMethodQuery() methods. Reimplementing this only provides the user with a more responsive text experience, since the default implementation forwards the typed text as key pressed events.
| event | the input method event. |
Reimplemented in SvgTextTool.
Definition at line 151 of file KoToolBase.cpp.
References keyPressEvent().
|
virtual |
This method is used to query a set of properties of the tool to be able to support complex input method operations as support for surrounding text and reconversions. Default implementation returns simple defaults, for tools that want to provide a more responsive text entry experience for CJK languages it would be good to reimplement.
| query | specifies which property is queried. |
| converter | the view converter for the current canvas. |
Reimplemented in SvgTextTool.
Definition at line 133 of file KoToolBase.cpp.
References isInTextMode().
|
protected |
Returns true if activate() has been called (more times than deactivate :) )
Definition at line 61 of file KoToolBase.cpp.
| bool KoToolBase::isInTextMode | ( | ) | const |
This method can be reimplemented in a subclass.
Definition at line 412 of file KoToolBase.cpp.
| bool KoToolBase::isOpacityPresetMode | ( | ) | const |
Definition at line 451 of file KoToolBase.cpp.
|
virtual |
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 in KoPencilTool, KoInteractionTool, KoPathTool, KoZoomTool, KisToolRectangleBase, KisToolSelectBase< __KisToolSelectEllipticalLocal >, KisToolSelectBase< __KisToolSelectOutlineLocal >, KisToolSelectBase< __KisToolSelectPolygonalLocal >, KisToolSelectBase< __KisToolSelectRectangularLocal >, KisToolOutlineBase, KisAssistantTool, KisToolPan, DefaultTool, SvgTextTool, and KisDynamicDelegatedTool< KisToolShape >.
Definition at line 118 of file KoToolBase.cpp.
|
virtual |
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 in KoInteractionTool, KoPathTool, KoZoomTool, KisToolRectangleBase, KisToolSelectBase< __KisToolSelectEllipticalLocal >, KisToolSelectBase< __KisToolSelectOutlineLocal >, KisToolSelectBase< __KisToolSelectPolygonalLocal >, KisToolSelectBase< __KisToolSelectRectangularLocal >, KisToolOutlineBase, SvgTextTool, and KisDynamicDelegatedTool< KisToolShape >.
Definition at line 123 of file KoToolBase.cpp.
|
protected |
Returns the last pointer event that was delivered to the canvas, the tool belongs to. This event might be used as an approximation for the event0 handlers not having their own events, like activate()/deactivate().
Definition at line 67 of file KoToolBase.cpp.
| bool KoToolBase::maskSyntheticEvents | ( | ) | const |
For example, the guides tool should allow click and drag with touch, while the same touch events should be rejected by the freehand tool.
These events are sent by the OS in Windows
Definition at line 439 of file KoToolBase.cpp.
|
virtual |
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 in ToolReferenceImages, KoCreatePathTool, KoPathTool, KoZoomTool, KisTool, DefaultTool, SvgTextTool, and KisDynamicDelegatedTool< KisToolShape >.
Definition at line 108 of file KoToolBase.cpp.
|
pure virtual |
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 |
Implemented in KisToolCrop, KisToolTransform, KoCreatePathTool, KoPencilTool, KoInteractionTool, KoPathTool, KoZoomTool, KisTool, KisToolFreehand, KisToolPaint, KisToolPolylineBase, KisToolSelectBase< __KisToolSelectEllipticalLocal >, KisToolSelectBase< __KisToolSelectOutlineLocal >, KisToolSelectBase< __KisToolSelectPolygonalLocal >, KisToolSelectBase< __KisToolSelectRectangularLocal >, KisToolOutlineBase, KisAssistantTool, KisToolColorSampler, KisToolMove, KisToolMultihand, DefaultTool, KarbonCalligraphyTool, SvgTextTool, KisDynamicDelegatedTool< KisToolShape >, and KisToolBasicBrushBase.
|
pure virtual |
Called when (one of) the mouse or stylus buttons is pressed. Implementors should call event->ignore() if they do not actually use the event.
| event | state and reason of this mouse or stylus press |
Implemented in KisToolTransform, KoCreatePathTool, KoPencilTool, KoInteractionTool, KoPathTool, KisTool, KisToolPaint, DefaultTool, KarbonCalligraphyTool, SvgTextTool, and KisDynamicDelegatedTool< KisToolShape >.
|
pure virtual |
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 |
Implemented in KisToolTransform, KoCreatePathTool, KoPencilTool, KoInteractionTool, KoPathTool, KoZoomTool, KisTool, KisToolPaint, DefaultTool, KarbonCalligraphyTool, SvgTextTool, and KisDynamicDelegatedTool< KisToolShape >.
|
virtual |
Called when (one of) the mouse or stylus buttons is triple 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 in KisTool, SvgTextTool, and KisDynamicDelegatedTool< KisToolShape >.
Definition at line 113 of file KoToolBase.cpp.
|
private |
Return the option widgets for this tool. Create them if they do not exist yet. If the tool does not have an option widget, this method return an empty list. (After discussion with Thomas, who prefers the toolmanager to handle that case.)
Definition at line 192 of file KoToolBase.cpp.
References createOptionWidgets().
|
pure virtual |
Called by the canvas to paint any decorations that the tool deems needed. The painter has the top left of the canvas as its origin.
| painter | used for painting the shape |
| converter | to convert between internal and view coordinates. |
Implemented in KisToolPaint, KisToolPolylineBase, KisToolRectangleBase, KisToolOutlineBase, KisAssistantTool, KisToolColorSampler, KisToolLine, KisToolMeasure, KisToolMove, KisToolMultihand, SvgTextTool, KisToolBasicBrushBase, KisToolTransform, KoCreatePathTool, KoPencilTool, KoInteractionTool, KoPathTool, KisToolGradient, KisToolPan, __KisToolPencilLocalTool, DefaultTool, KarbonCalligraphyTool, KisToolCrop, KisDynamicDelegatedTool< KisToolShape >, and KisToolSmartPatch.
|
virtual |
Paste the clipboard selection. A tool typically has one or more shapes selected and pasting should do something meaningful for this specific shape and tool combination. Inserting text in a text tool, for example.
Reimplemented in DefaultTool, and SvgTextTool.
Definition at line 348 of file KoToolBase.cpp.
|
inlinevirtual |
Reimplemented in KoPathTool, KisToolSelectBase< __KisToolSelectEllipticalLocal >, KisToolSelectBase< __KisToolSelectOutlineLocal >, KisToolSelectBase< __KisToolSelectPolygonalLocal >, KisToolSelectBase< __KisToolSelectRectangularLocal >, DefaultTool, ToolReferenceImages, KisToolCrop, KisDynamicDelegatedTool< KisToolShape >, and KisToolTransform.
Definition at line 334 of file KoToolBase.h.
|
inlinevirtual |
popupActionsMenu() does not return null. Reimplemented in KisToolPaint, KisToolPolylineBase, KisToolSelectBase< __KisToolSelectEllipticalLocal >, KisToolSelectBase< __KisToolSelectOutlineLocal >, KisToolSelectBase< __KisToolSelectPolygonalLocal >, KisToolSelectBase< __KisToolSelectRectangularLocal >, KisToolOutlineBase, KarbonCalligraphyTool, SvgTextTool, and KisDynamicDelegatedTool< KisToolShape >.
Definition at line 340 of file KoToolBase.h.
|
virtualslot |
request a repaint of the decorations to be made. This triggers an update call on the canvas, but does not paint directly.
Reimplemented in KoPathTool.
Definition at line 394 of file KoToolBase.cpp.
References canvas(), decorationsRect(), and KoCanvasBase::updateCanvas().
|
virtualslot |
Called when the user requested redo while the stroke is active. If your tool supports redo and maintains an intermediate state which can interfere with redo override this method to handle the state.
Definition at line 427 of file KoToolBase.cpp.
|
virtualslot |
Called when the user requested the cancellation of the current stroke. If you tool supports cancelling, override this method and do the needed work there
Reimplemented in KoPathTool, KisToolPolylineBase, KisToolLine, and SvgTextTool.
Definition at line 431 of file KoToolBase.cpp.
|
virtualslot |
Called when the image decided that the stroke should better be ended. If you tool supports long strokes, override this method and do the needed work there
Reimplemented in KoPathTool, KisToolPolylineBase, KisToolLine, and SvgTextTool.
Definition at line 435 of file KoToolBase.cpp.
|
virtualslot |
Called when the user requested undo while the stroke is active. If you tool supports undo of the part of its actions, override this method and do the needed work there.
NOTE: Default implementation forwards this request to requestStrokeCancellation() method, so that the stroke would be cancelled.
Default implementation just cancels the stroke
Reimplemented in KoPathTool.
Definition at line 418 of file KoToolBase.cpp.
References requestStrokeCancellation().
|
virtual |
selectAll select all data the tool can select.
Reimplemented in KoPathTool, DefaultTool, and SvgTextTool.
Definition at line 353 of file KoToolBase.cpp.
|
virtual |
Returns the internal selection object of this tool. Each tool can have a selection which is private to that tool and the specified shape that it comes with. The default returns 0.
Reimplemented in KoPathTool, DefaultTool, and SvgTextTool.
Definition at line 389 of file KoToolBase.cpp.
|
signal |
A tool can have a selection that is copy-able, this signal is emitted when that status changes.
| hasSelection | is true when the tool holds selected data. |
|
protected |
Definition at line 468 of file KoToolBase.cpp.
|
protected |
Definition at line 463 of file KoToolBase.cpp.
|
private |
Set the KoToolFactoryBase that created this tool.
| factory | the KoToolFactoryBase |
Definition at line 228 of file KoToolBase.cpp.
References factory().
|
protected |
Sets the opacity mode to either preset (true) or tool (false).
Definition at line 457 of file KoToolBase.cpp.
References value().
|
protected |
Allows subclasses to specify whether synthetic mouse events should be accepted.
Definition at line 445 of file KoToolBase.cpp.
References value().
|
slot |
This method just relays the given text via the tools statusTextChanged signal.
| statusText | the new status text |
Definition at line 268 of file KoToolBase.cpp.
References statusTextChanged().
|
protected |
You should set the text mode to true in subclasses, if this tool is in text input mode, eg if the users are able to type. If you don't set it, then single key shortcuts will get the key event and not this tool.
Definition at line 340 of file KoToolBase.cpp.
References textModeChanged(), and value().
|
signal |
Emitted when the tool wants to display a different status text
| statusText | the new status text |
|
signal |
Emitted when the tool's text mode has changed.
| inTextMode | whether it is now in text mode. |
|
protected |
Definition at line 473 of file KoToolBase.cpp.
|
protected |
Definition at line 479 of file KoToolBase.cpp.
| QString KoToolBase::toolId | ( | ) | const |
get the identifier code from the KoToolFactoryBase that created this tool.
Definition at line 240 of file KoToolBase.cpp.
|
slot |
force the update of the icons on the cached options widget
Definition at line 485 of file KoToolBase.cpp.
References KisIconUtils::updateIconCommon().
|
protected |
Classes inheriting from this one can call this method to signify which cursor the tool wants to display at this time. Logical place to call it is after an incoming event has been handled.
| cursor | the new cursor. |
Definition at line 185 of file KoToolBase.cpp.
References cursor(), and cursorChanged().
|
virtual |
Return if dragging (moving with the mouse down) to the edge of a canvas should scroll the canvas (default is true).
Reimplemented in KisToolFreehand, KisToolFill, KisToolMove, KisToolPan, DefaultTool, KisToolEncloseAndFill, KisDynamicDelegatedTool< KisToolShape >, and KisToolTransform.
Definition at line 103 of file KoToolBase.cpp.
|
friend |
Definition at line 572 of file KoToolBase.h.
|
protected |
Definition at line 567 of file KoToolBase.h.