Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SoQtDevice Class Referenceabstract

VSG extension Abstract base class for input devices. More...

#include <Inventor/Qt/devices/SoQtDevice.h>

+ Inheritance diagram for SoQtDevice:

Public Member Functions

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.
 
virtual const SoEventtranslateEvent (QEvent *event)=0
 Attempts to convert the passed event into an SoEvent.
 
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

VSG extension Abstract base class for input devices.

This is the abstract base class for devices in the Open Inventor Qt component and utility library. When a device is registered with an SoQtRenderArea, the device is able to generate messages in the render area window.

Used internally by SoQtRenderArea and derived classes. Can also be used by the application to translate system events into SoEvent objects.

SEE ALSO

SoQtMouse, SoQtKeyboard, SoQtRenderArea, SoQtTouchScreen

Definition at line 101 of file SoQtDevice.h.

Member Function Documentation

◆ disable()

virtual void SoQtDevice::disable ( QWidget *  w,
XtEventHandler  f,
XtPointer  data 
)
pure virtual

Disables the device for the passed widget.

Implemented in SoQtKeyboard, SoQtMouse, and SoQtSpaceball.

◆ enable()

virtual void SoQtDevice::enable ( QWidget *  w,
XtEventHandler  f,
XtPointer  data,
void *  unused = NULL 
)
pure 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.

Implemented in SoQtKeyboard, SoQtMouse, and SoQtSpaceball.

◆ getWindowSize()

const SbVec2s & SoQtDevice::getWindowSize ( ) const
inline

Gets the size of the window, in pixels, this device is registered for.

Definition at line 141 of file SoQtDevice.h.

◆ setWindowSize()

void SoQtDevice::setWindowSize ( const SbVec2s s)

Sets the size of the window this device is registered for.

This allows the device to correctly convert position information from X window coordinates (origin at top left) to Open Inventor window coordinates (origin at bottom left). (SoQtRenderArea will automatically call this method for each device registered on it whenever the window size changes.) Note: Setting the window size only affects the size as perceived by the device and not the actual window size.

◆ translateEvent()

virtual const SoEvent * SoQtDevice::translateEvent ( QEvent *  event)
pure 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.

Implemented in SoQtKeyboard, SoQtMouse, SoQtTouchScreen, and SoQtSpaceball.


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