Translates and reports Qt events for the touch screen device. More...
#include <Inventor/touch/devices/SoQtTouchScreen.h>
Public Member Functions | |
SoQtTouchScreen (SoWidget mWindow) | |
virtual | ~SoQtTouchScreen () |
virtual void | enable (SoWidget w, XtEventHandler f, XtPointer data, void *unused=NULL) |
virtual void | disable (SoWidget w, XtEventHandler f, XtPointer data) |
virtual const SoEvent * | translateEvent (QEvent *event) |
SoTouchManager * | getTouchManager () const |
Translates and reports Qt events for the touch screen device.
This class represents a touch screen input device for the Qt user interface toolkit. It translates and manages messages generated by the touch screen. When the touch screen device is registered in an SoQtRenderArea, the device is able to generate Open Inventor touch events (see SoTouchEvent) and gesture events (see SoGestureEvent) that can be handled (for example) using an SoEventCallback node.
It analyses each touch event and updates events in the SoTouchEvent table of SoTouchManager.
Note: Unlike SoQtMouse and SoQtKeyboard, this device must be explicitly registered with the render area / viewer by the application.
QWidget *mainWindow = SoQt::init(argv[0]); . . . SoQtExaminerViewer* pViewer = new SoQtExaminerViewer(mainWindow); SoQtTouchScreen touchScreenDevice(mainWindow); pViewer->registerDevice(&touchScreenDevice);
SoQtDevice, SoTouchManager, SoTouchEvent, SoGestureEvent
DragGestureRecognizer, FingerDraw, QtTouchEvent, TouchInertia
SoQtTouchScreen::SoQtTouchScreen | ( | SoWidget | mWindow | ) |
virtual SoQtTouchScreen::~SoQtTouchScreen | ( | ) | [virtual] |
virtual void SoQtTouchScreen::disable | ( | SoWidget | w, | |
XtEventHandler | f, | |||
XtPointer | data | |||
) | [virtual] |
Disables the device for the passed widget.
virtual void SoQtTouchScreen::enable | ( | SoWidget | w, | |
XtEventHandler | f, | |||
XtPointer | data, | |||
void * | unused = NULL | |||
) | [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.
SoTouchManager* SoQtTouchScreen::getTouchManager | ( | ) | const |
Gets the SoTouchManager containing events table, recognizers list and methods to use them.
virtual const SoEvent* SoQtTouchScreen::translateEvent | ( | QEvent * | event | ) | [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.