Open Inventor Release 2024.1.1
 
Loading...
Searching...
No Matches
SoQtTouchScreen Class Reference

Translates and reports Qt events for the touch screen device. More...

#include <Inventor/touch/devices/SoQtTouchScreen.h>

+ Inheritance diagram for SoQtTouchScreen:

Public Member Functions

 SoQtTouchScreen (SoWidget mWindow)
 
virtual ~SoQtTouchScreen ()
 
virtual void enable (SoWidget w, XtEventHandler f, XtPointer data, void *unused=NULL)
 Enables the device for the passed widget.
 
virtual void disable (SoWidget w, XtEventHandler f, XtPointer data)
 Disables the device for the passed widget.
 
virtual const SoEventtranslateEvent (QEvent *event)
 Attempts to convert the passed event into an SoEvent.
 
SoTouchManagergetTouchManager () const
 Gets the SoTouchManager containing events table, recognizers list and methods to use them.
 
- Public Member Functions inherited from SoQtDevice
virtual void enable (QWidget *w, XtEventHandler f, XtPointer data, void *unused=NULL)=0
 Enables the device for the passed widget.
 
virtual void disable (QWidget *w, XtEventHandler f, XtPointer data)=0
 Disables the device for the passed widget.
 
void setWindowSize (const SbVec2s &s)
 Sets the size of the window this device is registered for.
 
const SbVec2sgetWindowSize () const
 Gets the size of the window, in pixels, this device is registered for.
 

Detailed Description

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);
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Viewer component...
static SoNONUNICODE QWidget * init(const char *appName, const char *className="Inventor")
This is called to initialize Open Inventor and Qt, and bind Open Inventor with Qt message handling so...
Translates and reports Qt events for the touch screen device.

SEE ALSO

SoQtDevice, SoTouchManager, SoTouchEvent, SoGestureEvent

Definition at line 71 of file SoQtTouchScreen.h.

Constructor & Destructor Documentation

◆ SoQtTouchScreen()

SoQtTouchScreen::SoQtTouchScreen ( SoWidget  mWindow)

◆ ~SoQtTouchScreen()

virtual SoQtTouchScreen::~SoQtTouchScreen ( )
virtual

Member Function Documentation

◆ disable()

virtual void SoQtTouchScreen::disable ( SoWidget  w,
XtEventHandler  f,
XtPointer  data 
)
virtual

Disables the device for the passed widget.

◆ enable()

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.

◆ getTouchManager()

SoTouchManager * SoQtTouchScreen::getTouchManager ( ) const

Gets the SoTouchManager containing events table, recognizers list and methods to use them.

◆ translateEvent()

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.


The documentation for this class was generated from the following file: