libs/flake
KoCreatePathTool Class Reference
Tool for creating path shapes. More...
#include <KoCreatePathTool.h>

Public Slots | |
| virtual void | activate (bool temporary=false) |
| virtual void | deactivate () |
| virtual void | resourceChanged (int key, const QVariant &res) |
Public Member Functions | |
| KoCreatePathTool (KoCanvasBase *canvas) | |
| virtual | ~KoCreatePathTool () |
| virtual void | keyPressEvent (QKeyEvent *event) |
| void | mouseDoubleClickEvent (KoPointerEvent *event) |
| void | mouseMoveEvent (KoPointerEvent *event) |
| void | mousePressEvent (KoPointerEvent *event) |
| void | mouseReleaseEvent (KoPointerEvent *event) |
| void | paint (QPainter &painter, const KoViewConverter &converter) |
Protected Member Functions | |
| virtual void | addPathShape () |
| virtual QMap< QString, QWidget * > | createOptionWidgets () |
Protected Attributes | |
| KoPathShape * | m_shape |
Detailed Description
Tool for creating path shapes.
Definition at line 37 of file KoCreatePathTool.h.
Constructor & Destructor Documentation
| KoCreatePathTool::KoCreatePathTool | ( | KoCanvasBase * | canvas | ) | [explicit] |
Constructor for the tool that allows you to create new paths by hand.
- Parameters:
-
canvas the canvas this tool will be working for.
Definition at line 116 of file KoCreatePathTool.cpp.
| KoCreatePathTool::~KoCreatePathTool | ( | ) | [virtual] |
Definition at line 132 of file KoCreatePathTool.cpp.
Member Function Documentation
| void KoCreatePathTool::activate | ( | bool | temporary = false |
) | [virtual, slot] |
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.
There is one case where two tools are activated at the same. This is the case where one tool delegates work to another temporarily. For example, while shift is being held down. The second tool will get activated with temporary=true and it should emit done() when the state that activated it is ended.
One of the important tasks of activate is to call useCursor()
- Parameters:
-
temporary if true, this tool is only temporarily actived and should emit done when it is done.
- See also:
- deactivate()
Reimplemented from KoTool.
Definition at line 352 of file KoCreatePathTool.cpp.
| void KoCreatePathTool::addPathShape | ( | ) | [protected, virtual] |
add path shape to document
Definition at line 397 of file KoCreatePathTool.cpp.
| void KoCreatePathTool::deactivate | ( | ) | [virtual, slot] |
This method is called whenever this tool is no longer the active tool.
- See also:
- activate()
Reimplemented from KoTool.
Definition at line 365 of file KoCreatePathTool.cpp.
| void KoCreatePathTool::keyPressEvent | ( | QKeyEvent * | event | ) | [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.
- Parameters:
-
event state and reason of this key press
Reimplemented from KoTool.
Definition at line 344 of file KoCreatePathTool.cpp.
| void KoCreatePathTool::mouseDoubleClickEvent | ( | KoPointerEvent * | event | ) | [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.
- Parameters:
-
event state and reason of this mouse or stylus press
Reimplemented from KoTool.
Definition at line 267 of file KoCreatePathTool.cpp.
| void KoCreatePathTool::mouseMoveEvent | ( | KoPointerEvent * | event | ) | [virtual] |
Called when the mouse or stylus moved over the canvas.
Implementors should call event->ignore() if they do not actually use the event.
- Parameters:
-
event state and reason of this mouse or stylus move
Implements KoTool.
Definition at line 279 of file KoCreatePathTool.cpp.
| void KoCreatePathTool::mousePressEvent | ( | KoPointerEvent * | event | ) | [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.
- Parameters:
-
event state and reason of this mouse or stylus press
Implements KoTool.
Definition at line 193 of file KoCreatePathTool.cpp.
| void KoCreatePathTool::mouseReleaseEvent | ( | KoPointerEvent * | event | ) | [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.
- Parameters:
-
event state and reason of this mouse or stylus release
Implements KoTool.
Definition at line 325 of file KoCreatePathTool.cpp.
| void KoCreatePathTool::paint | ( | QPainter & | painter, | |
| const KoViewConverter & | converter | |||
| ) | [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.
- Parameters:
-
painter used for painting the shape converter to convert between internal and view coordinates.
Implements KoTool.
Definition at line 136 of file KoCreatePathTool.cpp.
| void KoCreatePathTool::resourceChanged | ( | int | key, | |
| const QVariant & | res | |||
| ) | [virtual, slot] |
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 from KoTool.
Definition at line 385 of file KoCreatePathTool.cpp.
Member Data Documentation
KoPathShape* KoCreatePathTool::m_shape [protected] |
Definition at line 67 of file KoCreatePathTool.h.
The documentation for this class was generated from the following files:
