Back to index

salome-gui  6.5.0
Functions
SUIT_Accel.cxx File Reference
#include "SUIT_Accel.h"
#include "SUIT_ViewWindow.h"
#include "SUIT_ViewManager.h"
#include "SUIT_ViewModel.h"
#include <QCoreApplication>
#include <QEvent>
#include <QKeyEvent>

Go to the source code of this file.

Functions

SUIT_ViewWindowgetParentViewWindow (const QObject *obj)
 getParentViewWindow() : returns given object or any of its parents-grandparents-.
int getKey (QKeyEvent *keyEvent)
 getKey() : returns integer key code (with modifiers) made of key pressed 'inside' given event

Function Documentation

int getKey ( QKeyEvent *  keyEvent)

getKey() : returns integer key code (with modifiers) made of key pressed 'inside' given event

Definition at line 98 of file SUIT_Accel.cxx.

{
  int key = keyEvent->key(), state = keyEvent->modifiers();
  if ( state & Qt::ShiftModifier )   
    key += Qt::SHIFT;
  if ( state & Qt::ControlModifier )
    key += Qt::CTRL;
  if ( state & Qt::AltModifier )
    key += Qt::ALT;
  if ( state & Qt::MetaModifier )
    key += Qt::META;
  return key;
}

getParentViewWindow() : returns given object or any of its parents-grandparents-.

. if it is a SUIT_ViewWindow

Definition at line 85 of file SUIT_Accel.cxx.

{
  if ( obj )
  {
    if ( obj->inherits( "SUIT_ViewWindow" ) )
      return (SUIT_ViewWindow*)obj;
    else
      return getParentViewWindow( obj->parent() );
  }
  return 0;
}