Version: 9.15.0
SUIT_Accel Class Reference

Manager of keyboard accelerator bindings. More...

#include <SUIT_Accel.h>

Inheritance diagram for SUIT_Accel:
Inheritance graph

Public Types

enum  Actions {
  PanLeft = 1 , PanRight , PanUp , PanDown ,
  ZoomIn , ZoomOut , ZoomFit , RotateLeft ,
  RotateRight , RotateUp , RotateDown , LastAction
}
 

Public Member Functions

void setActionKey (const int action, const int key, const QString &type)
 
void unsetActionKey (const int key, const QString &type)
 

Static Public Member Functions

static SUIT_AccelgetAccel ()
 

Protected Member Functions

bool eventFilter (QObject *, QEvent *)
 

Private Types

typedef QMap< int, int > IdActionMap
 maps key to action id More...
 
typedef QMap< QString, IdActionMapViewerTypeIdActionMap
 maps viewer type to IdActionMap More...
 

Private Member Functions

 SUIT_Accel ()
 
int getAccelKey (QEvent *)
 

Private Attributes

ViewerTypeIdActionMap myMap
 viewer actions map More...
 
QMap< int, bool > myOptMap
 Maps key to <not_used> flag map, used for optimization. More...
 

Static Private Attributes

static SUIT_Accelmyself = 0
 

Detailed Description

Manager of keyboard accelerator bindings.

Member Typedef Documentation

◆ IdActionMap

typedef QMap<int, int> SUIT_Accel::IdActionMap
private

maps key to action id

◆ ViewerTypeIdActionMap

typedef QMap<QString, IdActionMap> SUIT_Accel::ViewerTypeIdActionMap
private

maps viewer type to IdActionMap

Member Enumeration Documentation

◆ Actions

Enumerator
PanLeft 
PanRight 
PanUp 
PanDown 
ZoomIn 
ZoomOut 
ZoomFit 
RotateLeft 
RotateRight 
RotateUp 
RotateDown 
LastAction 

Constructor & Destructor Documentation

◆ SUIT_Accel()

SUIT_Accel::SUIT_Accel ( )
private

Constructor [private].

Member Function Documentation

◆ eventFilter()

◆ getAccel()

SUIT_Accel * SUIT_Accel::getAccel ( )
static

getAccel() : public interface for SUIT_Accel object. Only one instance is created and returned.

References myself, and SUIT_Accel().

◆ getAccelKey()

int SUIT_Accel::getAccelKey ( QEvent event)
private

Returns key pressed if

  1. event was KeyPress
  2. pressed key is a registered accelerator

References getKey(), and myOptMap.

◆ setActionKey()

void SUIT_Accel::setActionKey ( const int  action,
const int  key,
const QString &  type 
)

setActionKey() : assign a ceratain action for a key accelerator

References myMap, and myOptMap.

◆ unsetActionKey()

void SUIT_Accel::unsetActionKey ( const int  key,
const QString &  type 
)

unsetActionKey() : unregister a certain key accelerator

References myMap.

Member Data Documentation

◆ myMap

ViewerTypeIdActionMap SUIT_Accel::myMap
private

viewer actions map

◆ myOptMap

QMap<int, bool> SUIT_Accel::myOptMap
private

Maps key to <not_used> flag map, used for optimization.

All registered keys (accelerators) are stored in this map.

◆ myself

SUIT_Accel * SUIT_Accel::myself = 0
staticprivate

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