#include <qsctool.h>
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 *) |
QSDrvQt * | driver () |
Protected Attributes | |
QSDrvQt * | m_drv |
QSPlotView * | m_view |
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 |
|
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(). |
|
Canvas event. Left button click over the canvas. 'button' consist of 'ButtonState' flags ORed together |
|
Right button double-click. Warning ! two canvasClicked events are emitted before they are became double click event. |
|
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. |
|
Canvas event. User drags ( moves the mouse with the button pressed ) around. |
|
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 ). |
|
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. |
|
Canvas event. Middle button click over the canvas. |
|
Mouse move over the canvas. This event is not sent during dragging |
|
Canvas event. Right mouse button pressed over the canvas. |
|
Called when the tool is deactivated. Tools should not perform any action when they are deactivated. |
|
Intended to draw handles, frames etc. around active objects. Called when drawing ends in a parent widget ( after graphics has been closed ). |
|
Returns a graphics driver, which can be used to draw on the canvas, and enters in th edit mode. |
|
Canvas event - this is low-level function. |
|
Canvas event - this is low-level function. |
|
Canvas event - this is low-level function. |
|
Canvas event - this is low-level function. Use 'canvasDragMove' instead. |
|
Canvas event - this is low-level function. Use 'canvasClicked' instead. |
|
Canvas event - this is low-level function. Use 'canvasClicked' instead. |
|
Rounds range |
|
Rounds canvas coordinates to view's grid.( if SHIFT key is not pressed ). |
|
Rounds canvas coordinates to view's grid.( if SHIFT key is not pressed ). |
|
Rounds x canvas coordinate to view's grid.Always set 'snap_to_grid' to true. |
|
Rounds y canvas coordinate to view's grid. |