SelectTool Class Reference

Tool for selecting and moving objects and handles. More...

#include <selecttool.h>

Collaboration diagram for SelectTool:

Collaboration graph
[legend]

List of all members.

Signals

void selectionChanged ()

Public Member Functions

 SelectTool (PDFScene *scene)
void activate ()
 Activate this Tool: set it to the current one in the Scene, set an appropriate cursor, emit activated(), etc.
void mouseMoveEvent (QGraphicsSceneMouseEvent *ev)
void mousePressEvent (QGraphicsSceneMouseEvent *ev)
void mouseReleaseEvent (QGraphicsSceneMouseEvent *ev)
void mouseLeftClickEvent (QGraphicsSceneMouseEvent *ev)

Private Attributes

QGraphicsRectItem * rubberBand
Rectangleresizing
Rectangledragging
Rectangle::ResizeHandleIdx resizingHandle


Detailed Description

Tool for selecting and moving objects and handles.

This Tool provides the following kinds of functionality:

The GraphicsView already provides most of this functionality, so if the "handles" were separate QGraphicsRectItems for example, maybe the SelectTool would not be necessary (just as a Pan tool is not necessary because the view provides that functionality). However, handles are implemented virtually: each object paints its own handles if it is selected. Therefore the SelectTool must query the object for the handle locations.

Definition at line 25 of file selecttool.h.


Constructor & Destructor Documentation

SelectTool::SelectTool ( PDFScene scene  ) 

Definition at line 5 of file selecttool.cpp.

References rubberBand.


Member Function Documentation

void SelectTool::activate (  )  [virtual]

Activate this Tool: set it to the current one in the Scene, set an appropriate cursor, emit activated(), etc.

Implements Tool.

Definition at line 19 of file selecttool.cpp.

References Tool::activated(), Tool::scene, and PDFScene::setTool().

Referenced by MainWindow::on_actionSelect_toggled().

Here is the call graph for this function:

Here is the caller graph for this function:

void SelectTool::mouseLeftClickEvent ( QGraphicsSceneMouseEvent *  ev  )  [virtual]

Implements Tool.

Definition at line 128 of file selecttool.cpp.

References Tool::scene.

void SelectTool::mouseMoveEvent ( QGraphicsSceneMouseEvent *  ev  )  [virtual]

Implements Tool.

Definition at line 74 of file selecttool.cpp.

References Rectangle::buttonDownPos(), dragging, Rectangle::resize(), resizing, resizingHandle, rubberBand, and Tool::scene.

Here is the call graph for this function:

void SelectTool::mousePressEvent ( QGraphicsSceneMouseEvent *  ev  )  [virtual]

Todo:
We need an intermediate class for such items, but for now there is only Rectangle.

Implements Tool.

Definition at line 30 of file selecttool.cpp.

References dragging, Rectangle::handleAt(), resizing, resizingHandle, Rectangle::RH_NONE, rubberBand, and Tool::scene.

Here is the call graph for this function:

void SelectTool::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  ev  )  [virtual]

Implements Tool.

Definition at line 102 of file selecttool.cpp.

References dragging, Rectangle::resizeDone(), resizing, rubberBand, Tool::scene, and selectionChanged().

Here is the call graph for this function:

void SelectTool::selectionChanged (  )  [signal]

Referenced by mouseReleaseEvent().

Here is the caller graph for this function:


Member Data Documentation

Definition at line 42 of file selecttool.h.

Referenced by mouseMoveEvent(), mousePressEvent(), and mouseReleaseEvent().

Definition at line 41 of file selecttool.h.

Referenced by mouseMoveEvent(), mousePressEvent(), and mouseReleaseEvent().

Definition at line 44 of file selecttool.h.

Referenced by mouseMoveEvent(), and mousePressEvent().

QGraphicsRectItem* SelectTool::rubberBand [private]

Definition at line 40 of file selecttool.h.

Referenced by mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), and SelectTool().


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

Generated on Tue Sep 8 15:09:50 2009 for Taborca by  doxygen 1.5.8