libs/flake
KoShapeRubberSelectStrategy Class Reference
Implement the rubber band selection of flake objects. More...
#include <KoShapeRubberSelectStrategy.h>

Public Member Functions | |
| KoShapeRubberSelectStrategy (KoTool *tool, KoCanvasBase *canvas, const QPointF &clicked, bool useSnapToGrid=false) | |
| virtual | ~KoShapeRubberSelectStrategy () |
| virtual QUndoCommand * | createCommand () |
| virtual void | finishInteraction (Qt::KeyboardModifiers modifiers) |
| void | handleMouseMove (const QPointF &mouseLocation, Qt::KeyboardModifiers modifiers) |
| void | paint (QPainter &painter, const KoViewConverter &converter) |
Protected Member Functions | |
| const QRectF | selectRect () const |
Detailed Description
Implement the rubber band selection of flake objects.
Definition at line 41 of file KoShapeRubberSelectStrategy.h.
Constructor & Destructor Documentation
| KoShapeRubberSelectStrategy::KoShapeRubberSelectStrategy | ( | KoTool * | tool, | |
| KoCanvasBase * | canvas, | |||
| const QPointF & | clicked, | |||
| bool | useSnapToGrid = false | |||
| ) |
Constructor that initiates the rubber select.
A rubber select is basically rectangle area that the user drags out from clicked to a point later provided in the handleMouseMove() continuously showing a semi-transarant 'rubber-mat' over the objects it is about to select.
- Parameters:
-
tool the parent tool which controls this strategy canvas The canvas that owns the tool for this strategy. clicked the initial point that the user depressed (in pt). useSnapToGrid use the snap-to-grid settings while doing the rubberstamp.
Definition at line 35 of file KoShapeRubberSelectStrategy.cpp.
| KoShapeRubberSelectStrategy::~KoShapeRubberSelectStrategy | ( | ) | [virtual] |
Definition at line 45 of file KoShapeRubberSelectStrategy.cpp.
Member Function Documentation
| virtual QUndoCommand* KoShapeRubberSelectStrategy::createCommand | ( | ) | [inline, virtual] |
For interactions that are undo-able this method should be implemented to return such a command.
Implementations should return 0 otherwise.
- Returns:
- a command, or 0.
Implements KoInteractionStrategy.
Reimplemented in KoCreateShapeStrategy.
Definition at line 59 of file KoShapeRubberSelectStrategy.h.
| void KoShapeRubberSelectStrategy::finishInteraction | ( | Qt::KeyboardModifiers | modifiers | ) | [virtual] |
Override to make final changes to the data on the end of an interaction.
Implements KoInteractionStrategy.
Reimplemented in KoCreateShapeStrategy, KoPathPointRubberSelectStrategy, and KoZoomStrategy.
Definition at line 107 of file KoShapeRubberSelectStrategy.cpp.
| void KoShapeRubberSelectStrategy::handleMouseMove | ( | const QPointF & | mouseLocation, | |
| Qt::KeyboardModifiers | modifiers | |||
| ) | [virtual] |
Extending classes should implement this method to update the selectedShapes based on the new mouse position.
- Parameters:
-
mouseLocation the new location in pt modifiers OR-ed set of keys pressed.
Implements KoInteractionStrategy.
Reimplemented in KoCreateShapeStrategy.
Definition at line 67 of file KoShapeRubberSelectStrategy.cpp.
| void KoShapeRubberSelectStrategy::paint | ( | QPainter & | painter, | |
| const KoViewConverter & | converter | |||
| ) | [virtual] |
Reimplement this if the action needs to draw a "blob" on the canvas; that is, a transient decoration like a rubber band.
Reimplemented from KoInteractionStrategy.
Reimplemented in KoCreateShapeStrategy.
Definition at line 50 of file KoShapeRubberSelectStrategy.cpp.
| const QRectF KoShapeRubberSelectStrategy::selectRect | ( | ) | const [protected] |
Return the rectangle that the user dragged.
The rectangle is normalized and immutable.
- Returns:
- a rectangle in pt.
Definition at line 121 of file KoShapeRubberSelectStrategy.cpp.
The documentation for this class was generated from the following files:
