Mouse manager for the Qt4 graphics framework.
Mouse management for the Qt4 graphics framework is implemented by a set of MouseMode objects, that provide specific event handlers and behave like a descriptor, and a manager object that catches mouse events and dispatch them to the appropriate hendler.
The MouseManager provides methods for eddeing/removing mouse modes, making the system expandible, and also methods to register objects (QGraphicsScene and QGraphicsView) to be controlled.
|MouseMode||Base class for mouse mode desctiptors.|
|RubberBandMode||Mouse mode for rubber band selection.|
Return the mouse mode object
mouse mode name
SIGNAL: it is emitted when the mouse mode is changed
|C++ signature:||void modeChanged(const QString&)|
Register a Qt graphics object to be monitored by the mouse manager.
QGraphicsScene and QGrapgicsViews (and descending classes) objects can be registered to be monitored by the mouse manager.
Scene objects associated to views (passes as argument) are automatically registered.
Unregister monitored objects.
If the object passed as argument is not a registered object nothing happens.
this method never tries to unregister scene objects associated to the view passed as argument.
Base class for mouse mode desctiptors.
Qt Graphics Framework mouse mode descriptors define some basic property for mouse related matters:
The first three properties (not to be intender as python progremming language property) are strongly characterizing of the way the mouse works.
In particular the eventFilter method is used to filter all events coming from graphics scenes an graphics views.
in order to work properly the eventFilter should be installed on both graphics scene and view and also on the scrollbars of the graphics view. So please always use the register method of MouseManager for a proper installaton of al event filters.
Basic implementation of the eventFilter method.
The dafault implementation makes some basic operation such setting the mouse cursor anc dispatch the event to specific methods:
In most of the cases derived classes only need to specialize one or more of this specific methods.
Mouse mode for rubber band selection.
SIGNAL: it is emitted when a rectangular area is selected
|C++ signature:||void rubberBandSeclection(const QRectF&)|