Image Component Library (ICL)
|
MouseEvent Handler. More...
#include <MouseHandler.h>
Public Types | |
typedef void(* | mouse_handler) (const MouseEvent &event) |
mouse_handler function type More... | |
Public Slots | |
void | handleEvent (const MouseEvent &event) |
connected to the ICLWidget's signal mouseEventOccured More... | |
Public Member Functions | |
MouseHandler (mouse_handler handler) | |
Create a mouse handler with given callback function. More... | |
virtual void | process (const MouseEvent &event) |
this function is called automatically when the handleEvent slot is invoked More... | |
Protected Member Functions | |
MouseHandler () | |
This constructor can be called from derived classes. More... | |
Private Attributes | |
mouse_handler | m_handler |
internal mouse handler function More... | |
Friends | |
class | ICLWidget |
ICLWidget is allowed to connect to the private slot handleEvent. More... | |
MouseEvent Handler.
Here's a short example:
typedef void(* icl::qt::MouseHandler::mouse_handler) (const MouseEvent &event) |
mouse_handler function type
|
inlineexplicit |
Create a mouse handler with given callback function.
In most cases a MouseHandler can be used directly by passing a mouse_handler function to it's constructor. The mouse handler function is called by virtual void process automatically
|
inlineprotected |
This constructor can be called from derived classes.
derived classes will reimplement virtual void process(const MouseEvent &event), so in this case, no external mouse_handler function needs to be passed
|
slot |
connected to the ICLWidget's signal mouseEventOccured
|
virtual |
this function is called automatically when the handleEvent slot is invoked
It can be reimplemented for custom mouse interaction. If a mouse handling function is enough for your purpose, you can also pass a function of type mouse_handler to the constructor of a MouseHandler instance. The default implementation of process calls the handler function if it's not null.
Reimplemented in icl::geom::SceneMouseHandler, icl::qt::DefineRectanglesMouseHandler, icl::qt::DragRectangleMouseHandler, icl::qt::DefineQuadrangleMouseHandler, icl::qt::AdjustGridMouseHandler, icl::physics::PhysicsMouseHandler, and icl::physics::PhysicsPaper3MouseHandler.
|
private |
internal mouse handler function