Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SUIT_Accel Class Reference

Manager of keyboard accelerator bindings.

#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,
IdActionMap
ViewerTypeIdActionMap
 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
 

Member Typedef Documentation

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

Member Enumeration Documentation

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

Constructor & Destructor Documentation

SUIT_Accel::SUIT_Accel ( )
private

Constructor [private].

Member Function Documentation

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().

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.

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.

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

unsetActionKey() : unregister a certain key accelerator

References myMap.

Member Data Documentation

ViewerTypeIdActionMap SUIT_Accel::myMap
private
QMap<int, bool> SUIT_Accel::myOptMap
private

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

SUIT_Accel * SUIT_Accel::myself = 0
staticprivate

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