Translates and reports events for the mouse device. More...
#include <Inventor/Qt/devices/SoQtMouse.h>
Public Member Functions | |
SoQtMouse (EventMask mask=SO_QT_ALL_MOUSE_EVENTS) | |
Constructor. | |
~SoQtMouse () | |
Destructor. | |
virtual void | enable (QWidget *w, XtEventHandler f, XtPointer data, void *unused=NULL) |
Enables the device for the passed widget. | |
virtual void | disable (QWidget *w, XtEventHandler f, XtPointer data) |
Disables the device for the passed widget. | |
virtual const SoEvent * | translateEvent (QEvent *event) |
Attempts to convert the passed event into an SoEvent. | |
Public Member Functions inherited from SoQtDevice | |
void | setWindowSize (const SbVec2s &s) |
Sets the size of the window this device is registered for. | |
const SbVec2s & | getWindowSize () const |
Gets the size of the window, in pixels, this device is registered for. | |
Translates and reports events for the mouse device.
This class manages events generated by the mouse, including mouse motion (SoLocation2Event), and mouse button press and release events (SoMouseButtonEvent).
SoQtDevice, SoLocation2Event, SoMouseButtonEvent SoMouseWheelEvent
Definition at line 58 of file SoQtMouse.h.
SoQtMouse::SoQtMouse | ( | EventMask | mask = SO_QT_ALL_MOUSE_EVENTS | ) |
Constructor.
To the constructor, pass which mouse messages you are interested in as a bitwise OR of the following values:
ButtonPressMask - Mouse down events
ButtonReleaseMask - Mouse up events
PointerMotionMask - Mouse motion with no buttons
ButtonMotionMask - Mouse motion with buttons pressed
Or simply pass the defined value SO_QT_ALL_MOUSE_EVENTS for all mouse events. The device will only report events of this type for the window it is enabled on.
SoQtMouse::~SoQtMouse | ( | ) |
Destructor.
|
virtual |
Disables the device for the passed widget.
Implements SoQtDevice.
|
virtual |
Enables the device for the passed widget.
When enabled, the callback function f will be invoked when events occur in the window. data is the clientData which will be passed.
Implements SoQtDevice.
|
virtual |
Attempts to convert the passed event into an SoEvent.
Returns a pointer to an internal SoEvent object owned by the class. Do not delete this object. If the message was not generated by this device, then NULL is returned.
Implements SoQtDevice.