Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Examples  

QSTool Class Reference

Tool creates and edits QSCObject's on the canvas. More...

#include <qsctool.h>

List of all members.

Public Methods

 QSTool (QObject *parent=NULL)
virtual ~QSTool ()
virtual void activate (QSPlotView *parentView)
virtual void deactivate ()
virtual bool canvasEvent (QEvent *e)
virtual void draw ()

Protected Methods

virtual void canvasClicked (const QPoint &pos, int keyState)
virtual void canvasMiddleButtonClicked (const QPoint &pos, int keyState)
virtual void canvasRightButtonClicked (const QPoint &pos, int keyState)
virtual void canvasDoubleClicked (const QPoint &pos, int keyState)
virtual bool canvasDragStart (const QPoint &pos, int keyState)
virtual void canvasDragMove (const QPoint &pos, const QPoint &prevPos, const QPoint &startPos, int keyState, int prevKeyState, int startKeyState)
virtual void canvasDragEnd (const QPoint &pos, const QPoint &startPos, int keyState, int startKeyState)
virtual void canvasMove (const QPoint &pos)
QSPt2f snapToGrid (const QPoint &pos, int keyState=0)
QSPt2f snapToGrid (const QSPt2f &pos, int keyState=0)
double snapToGridX (double canvas_x, int keyState=0)
double snapToGridY (double canvas_y, int keyState=0)
int snapAngle (int angle, int keyState=0)
virtual bool eventMouseDblClick (QMouseEvent *)
virtual bool eventMousePress (QMouseEvent *)
virtual bool eventMouseRelease (QMouseEvent *)
virtual bool eventMouseMove (QMouseEvent *)
virtual bool eventKeyPress (QKeyEvent *)
virtual bool eventKeyRelease (QKeyEvent *)
QSDrvQtdriver ()

Protected Attributes

QSDrvQtm_drv
QSPlotViewm_view


Detailed Description

Tool creates and edits QSCObject's on the canvas.

It works in conjuction with QSPlotView, see QSPlotView::setTool(). It do nothing, but offers virtual functions notifing about some events on the canvas such as mouse button click, key press, drag, etc. See also activate(), deactivate().


Constructor & Destructor Documentation

QSTool::QSTool QObject *    parent = NULL
 

Constructor.

virtual QSTool::~QSTool   [virtual]
 

Destructor


Member Function Documentation

virtual void QSTool::activate QSPlotView   parentView [virtual]
 

Called when the tool is activated. QSPlotView::currentPage(), QSPlotView::zoom(), QSPlotView::dpi() QSPlotView::fullPage() are constant between activate() and deactivate(). If zoom is going to change deactivate() is called, zoom changes and activate() is called next().

virtual void QSTool::canvasClicked const QPoint &    pos,
int    keyState
[protected, virtual]
 

Canvas event. Left button click over the canvas. 'button' consist of 'ButtonState' flags ORed together

virtual void QSTool::canvasDoubleClicked const QPoint &    pos,
int    keyState
[protected, virtual]
 

Right button double-click. Warning ! two canvasClicked events are emitted before they are became double click event.

virtual void QSTool::canvasDragEnd const QPoint &    pos,
const QPoint &    startPos,
int    keyState,
int    startKeyState
[protected, virtual]
 

Canvas event. User relesed mouse pointer after drawing operation. It is guaranteed that the last mouse canvasDragMove event had the same 'pos' as this event.

virtual void QSTool::canvasDragMove const QPoint &    pos,
const QPoint &    prevPos,
const QPoint &    startPos,
int    keyState,
int    prevKeyState,
int    startKeyState
[protected, virtual]
 

Canvas event. User drags ( moves the mouse with the button pressed ) around.

virtual bool QSTool::canvasDragStart const QPoint &    pos,
int    keyState
[protected, virtual]
 

Canvas event. Drags start - user pressed the mouse and is going to move the mouse with the button pressed. If function returns false drag is not started ( canvasDragEnd() is not emitted in this case ).

virtual bool QSTool::canvasEvent QEvent *    e [virtual]
 

Mouse and key event handler for a canvas. If event wasn't proccesed this function should return FALSE. There is no need to use this function directly - use canvas...() functions insted.

virtual void QSTool::canvasMiddleButtonClicked const QPoint &    pos,
int    keyState
[protected, virtual]
 

Canvas event. Middle button click over the canvas.

virtual void QSTool::canvasMove const QPoint &    pos [protected, virtual]
 

Mouse move over the canvas. This event is not sent during dragging

virtual void QSTool::canvasRightButtonClicked const QPoint &    pos,
int    keyState
[protected, virtual]
 

Canvas event. Right mouse button pressed over the canvas.

virtual void QSTool::deactivate   [virtual]
 

Called when the tool is deactivated. Tools should not perform any action when they are deactivated.

virtual void QSTool::draw   [inline, virtual]
 

Intended to draw handles, frames etc. around active objects. Called when drawing ends in a parent widget ( after graphics has been closed ).

QSDrvQt* QSTool::driver   [protected]
 

Returns a graphics driver, which can be used to draw on the canvas, and enters in th edit mode.

virtual bool QSTool::eventKeyPress QKeyEvent *    [protected, virtual]
 

Canvas event - this is low-level function.

virtual bool QSTool::eventKeyRelease QKeyEvent *    [protected, virtual]
 

Canvas event - this is low-level function.

virtual bool QSTool::eventMouseDblClick QMouseEvent *    [protected, virtual]
 

Canvas event - this is low-level function.

virtual bool QSTool::eventMouseMove QMouseEvent *    [protected, virtual]
 

Canvas event - this is low-level function. Use 'canvasDragMove' instead.

virtual bool QSTool::eventMousePress QMouseEvent *    [protected, virtual]
 

Canvas event - this is low-level function. Use 'canvasClicked' instead.

virtual bool QSTool::eventMouseRelease QMouseEvent *    [protected, virtual]
 

Canvas event - this is low-level function. Use 'canvasClicked' instead.

int QSTool::snapAngle int    angle,
int    keyState = 0
[protected]
 

Rounds range

QSPt2f QSTool::snapToGrid const QSPt2f   pos,
int    keyState = 0
[protected]
 

Rounds canvas coordinates to view's grid.( if SHIFT key is not pressed ).

QSPt2f QSTool::snapToGrid const QPoint &    pos,
int    keyState = 0
[protected]
 

Rounds canvas coordinates to view's grid.( if SHIFT key is not pressed ).

double QSTool::snapToGridX double    canvas_x,
int    keyState = 0
[protected]
 

Rounds x canvas coordinate to view's grid.Always set 'snap_to_grid' to true.

double QSTool::snapToGridY double    canvas_y,
int    keyState = 0
[protected]
 

Rounds y canvas coordinate to view's grid.


The documentation for this class was generated from the following file:
Generated on Mon Mar 18 19:16:58 2002 for KMatplot library by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002