Back to index

salome-gui  6.5.0
Static Public Member Functions
SalomePyQt Class Reference

The class provides utility functions which can be used in the Python to operate with the SALOME GUI. More...

#include <SalomePyQt.h>

List of all members.

Static Public Member Functions

static QWidget * getDesktop ()
 Get the active application's desktop window.
static QWidget * getMainFrame ()
 Get current application's main frame widget [obsolete].
static QMenuBar * getMainMenuBar ()
 Get current application desktop's main menu.
static QMenu * getPopupMenu (const MenuName)
 Get main menu's child popup submenu by its identifier.
static QMenu * getPopupMenu (const QString &)
 Get main menu's child popup submenu by its name.
static QTreeView * getObjectBrowser ()
 Get object browser.
static SALOME_SelectiongetSelection ()
 Get the selection object for the current study.
static int getStudyId ()
 Get active study's identifier.
static void putInfo (const QString &, const int=0)
 Put an information message to the current application's desktop status bar.
static const QString getActiveComponent ()
 Get the currently active module name (for the current study).
static PyObject * getActivePythonModule ()
 Access to Python module object currently loaded into SALOME_PYQT_ModuleLight container.
static bool activateModule (const QString &)
 Activates SALOME module with the given name.
static void updateObjBrowser (const int=0, bool=true)
 Update an Object Browser of the specified (by identifier) study.
static bool isModified ()
static void setModified (bool)
 SalomePyQt::setModified()
static QString getFileName (QWidget *, const QString &, const QStringList &, const QString &, bool)
 Show 'Open/Save file' dialog box for file selection and return a user's choice (selected file name).
static QStringList getOpenFileNames (QWidget *, const QString &, const QStringList &, const QString &)
 Show 'Open files' dialog box for multiple files selection and return a user's choice (selected file names list).
static QString getExistingDirectory (QWidget *, const QString &, const QString &)
 Show 'Get Directory' dialog box for the directory selection and return a user's choice (selected directory name).
static QString createObject (const QString &parent=QString(""))
static QString createObject (const QString &name, const QString &iconname, const QString &tooltip, const QString &parent=QString(""))
static void removeObject (const QString &obj)
static void removeChild (const QString &obj=QString(""))
static QStringList getChildren (const QString &obj=QString(""), const bool rec=false)
static void setName (const QString &obj, const QString &name)
static void setIcon (const QString &obj, const QString &iconname)
static void setToolTip (const QString &obj, const QString &tooltip)
static QString getName (const QString &obj)
static QString getToolTip (const QString &obj)
static void setColor (const QString &obj, const QColor &color)
static QColor getColor (const QString &obj)
static void setReference (const QString &obj, const QString &refEntry)
static QString getReference (const QString &obj)
static QIcon loadIcon (const QString &, const QString &)
 Load an icon from the module resources by the specified file name.
static void helpContext (const QString &, const QString &)
 Open external browser to display context help information.
static bool dumpView (const QString &)
 Dump the contents of the currently active view window to the image file in the specified format.
static int defaultMenuGroup ()
 Get detault menu group identifier which can be used when creating menus (insert custom menu commands).
static int createTool (const QString &)
 Create toolbar with specified name.
static int createTool (const int, const int, const int=-1)
 Insert action with specified id to the toolbar.
static int createTool (const int, const QString &, const int=-1)
 Insert action with specified id to the toolbar.
static int createTool (QAction *, const int, const int=-1, const int=-1)
 Insert action to the toolbar.
static int createTool (QAction *, const QString &, const int=-1, const int=-1)
 Insert action to the toolbar.
static int createMenu (const QString &, const int=-1, const int=-1, const int=-1, const int=-1)
 Create main menu.
static int createMenu (const QString &, const QString &=QString(), const int=-1, const int=-1, const int=-1)
 Create main menu.
static int createMenu (const int, const int=-1, const int=-1, const int=-1)
 Insert action to the main menu.
static int createMenu (const int, const QString &=QString(), const int=-1, const int=-1)
 Insert action to the main menu.
static int createMenu (QAction *, const int, const int=-1, const int=-1, const int=-1)
 Insert action to the main menu.
static int createMenu (QAction *, const QString &, const int=-1, const int=-1, const int=-1)
 Insert action to the main menu.
static QAction * createSeparator ()
 Create separator action which can be used in the menu or toolbar.
static QAction * createAction (const int, const QString &, const QString &=QString(), const QString &=QString(), const QString &=QString(), const int=0, const bool=false)
 Create an action which can be then used in the menu or toolbar.
static QtxActionGroupcreateActionGroup (const int, const bool=true)
 Create an action group which can be then used in the menu or toolbar.
static QAction * action (const int)
 Get action by specified identifier.
static int actionId (const QAction *)
 Get an action identifier.
static void addSetting (const QString &, const QString &, const double)
 Add double setting to the application preferences.
static void addSetting (const QString &, const QString &, const int)
 Add integer setting to the application preferences.
static void addSetting (const QString &, const QString &, const bool, const int)
 Add boolean setting to the application preferences.
static void addSetting (const QString &, const QString &, const QString &)
 Add string setting to the application preferences.
static void addSetting (const QString &, const QString &, const QColor &)
 Add color setting to the application preferences.
static int integerSetting (const QString &, const QString &, const int=0)
 Get integer setting from the application preferences.
static double doubleSetting (const QString &, const QString &, const double=0)
 Get double setting from the application preferences.
static bool boolSetting (const QString &, const QString &, const bool=0)
 Get boolean setting from the application preferences.
static QString stringSetting (const QString &, const QString &, const QString &=QString(""))
 Get string setting from the application preferences.
static QColor colorSetting (const QString &, const QString &, const QColor &=QColor())
 Get color setting from the application preferences.
static void removeSetting (const QString &, const QString &)
 Remove setting from the application preferences.
static bool hasSetting (const QString &, const QString &)
 Check setting existence in the application preferences.
static void addStringSetting (const QString &, const QString &, bool=true)
 Add string setting to the application preferences.
static void addIntSetting (const QString &, const int, bool=true)
 Add integer setting to the application preferences.
static void addBoolSetting (const QString &, const bool, bool=true)
 Add boolean setting to the application preferences.
static void addDoubleSetting (const QString &, const double, bool=true)
 Add double setting to the application preferences.
static void removeSettings (const QString &)
 Remove setting from the application preferences.
static QString getSetting (const QString &)
 Get application setting value (as string represenation).
static int addGlobalPreference (const QString &)
 Add global (not module-related) preferences group.
static int addPreference (const QString &)
 Add module-related preferences group.
static int addPreference (const QString &, const int, const int=PT_Auto, const QString &=QString(), const QString &=QString())
 Add module-related preferences.
static QVariant preferenceProperty (const int, const QString &)
 Get the preferences property.
static void setPreferenceProperty (const int, const QString &, const QVariant &)
 Set the preferences property.
static void addPreferenceProperty (const int, const QString &, const int, const QVariant &)
 Add the property value to the list of values.
static void message (const QString &, bool=true)
 Put the message to the Log messages output window.
static void clearMessages ()
 Remove all the messages from the Log messages output window.
static QList< int > getViews ()
 Get list of integer identifiers of all the currently opened views.
static int getActiveView ()
 Get integer identifier of the currently active view.
static QString getViewType (const int)
 

Get type of the specified view, e.g.

static bool setViewTitle (const int, const QString &)
 Change view caption.
static QString getViewTitle (const int)
 Get view caption.
static QList< int > findViews (const QString &)
 Get list of integer identifiers of all the currently opened views of the specified type.
static bool activateView (const int)
 Activate view.
static int createView (const QString &)
 Create new view and activate it.
static int createView (const QString &, QWidget *)
 Create new view with custom widget embedded and activate it.
static bool closeView (const int)
 Close view.
static int cloneView (const int)
 Clone view (if this operation is supported for specified view type)
static bool isViewVisible (const int)
 Check whether view is visible ( i.e.
static void setViewClosable (const int, const bool)
 Set / clear view's "closable" option.
static bool isViewClosable (const int)
 Check whether view is closable (i.e.
static bool groupAllViews ()
 Group all views to the single tab area.
static bool splitView (const int, const Orientation, const Action)
 Split tab area to which view with identifier belongs to.
static bool moveView (const int, const int, const bool)
 Move view with the first identifier to the same area which another view with the second identifier belongs to.
static QList< int > neighbourViews (const int)
 Get list of views identifiers that belongs to the same area as specified view (excluding it)

Detailed Description

The class provides utility functions which can be used in the Python to operate with the SALOME GUI.

All the functionality of this class is implemented as static methods, so they can be called with the class name prefixed or via creation of the class instance. For example, next both ways of SalomePyQt class usage are legal:

  from SalomePyQt import *
  sg = SalomePyQt()
  # using SalomePyQt class instance
  desktop = sg.getDesktop()
  # using SalomePyQt class directly
  menubar = SalomePyQt.getMainMenuBar()

Definition at line 119 of file SalomePyQt.h.


Member Function Documentation

QAction * SalomePyQt::action ( const int  id) [static]

Get action by specified identifier.

Returns:
action or 0 if action is not registered

Definition at line 1930 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TActionEvent( id ) );
}

Here is the call graph for this function:

int SalomePyQt::actionId ( const QAction *  a) [static]

Get an action identifier.

Returns:
action ID or -1 if action is not registered

Definition at line 1956 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TActionIdEvent( a ) );
}

Here is the call graph for this function:

bool SalomePyQt::activateModule ( const QString &  modName) [static]

Activates SALOME module with the given name.

Returns:
True if the module has been activated and False otherwise.

Definition at line 568 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TActivateModuleEvent( modName ) );
}

Here is the call graph for this function:

bool SalomePyQt::activateView ( const int  id) [static]

Activate view.

Parameters:
idwindow identifier
Returns:
true if operation is completed successfully and false otherwise

Definition at line 2481 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TActivateView( id ) );
}

Here is the call graph for this function:

void SalomePyQt::addBoolSetting ( const QString &  name,
const bool  value,
bool  autoValue = true 
) [static]

Add boolean setting to the application preferences.

The parameter autoValue is obsolete parameter and currently is not used. This parameter will be removed in future, so try to avoid its usage in your code.

This function is obsolete. Use one of addSetting() instead.

Parameters:
namesetting name (it should be of kind <section:setting> where section is resources section name and setting is setting name)
valuenew setting value
autoValue(not used)

Definition at line 822 of file SalomePyQt.cxx.

{
  class TEvent: public SALOME_Event 
  {
    QString myName;
    bool    myValue;
    bool    myAutoValue;
  public:
    TEvent( const QString& name, const bool value, bool autoValue ) 
      : myName( name ), myValue( value ), myAutoValue( autoValue ) {}
    virtual void Execute() 
    {
      if ( SUIT_Session::session() ) {
        SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
        QStringList sl = myName.split( ":", QString::SkipEmptyParts );
        QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION );
        QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" );
        if ( !_sec.isEmpty() && !_nam.isEmpty() )
          resMgr->setValue( _sec, _nam, myValue );
      }
    }
  };
  ProcessVoidEvent( new TEvent( name, value, autoValue ) );
}

Here is the call graph for this function:

void SalomePyQt::addDoubleSetting ( const QString &  name,
const double  value,
bool  autoValue = true 
) [static]

Add double setting to the application preferences.

The parameter autoValue is obsolete parameter and currently is not used. This parameter will be removed in future, so try to avoid its usage in your code.

This function is obsolete. Use one of addSetting() instead.

Parameters:
namesetting name (it should be of kind <section:setting> where section is resources section name and setting is setting name)
valuenew setting value
autoValue(not used)

Definition at line 783 of file SalomePyQt.cxx.

{
  class TEvent: public SALOME_Event 
  {
    QString myName;
    double  myValue;
    bool    myAutoValue;
  public:
    TEvent( const QString& name, const double value, bool autoValue ) 
      : myName( name ), myValue( value ), myAutoValue( autoValue ) {}
    virtual void Execute() 
    {
      if ( SUIT_Session::session() ) {
        SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
        QStringList sl = myName.split( ":", QString::SkipEmptyParts );
        QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION );
        QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" );
        if ( !_sec.isEmpty() && !_nam.isEmpty() )
          resMgr->setValue( _sec, _nam, myValue );
      }
    }
  };
  ProcessVoidEvent( new TEvent( name, value, autoValue ) );
}

Here is the call graph for this function:

int SalomePyQt::addGlobalPreference ( const QString &  label) [static]

Add global (not module-related) preferences group.

Parameters:
labelglobal preferences group name
Returns:
preferences group identifier

Definition at line 1983 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TAddGlobalPrefEvent( label ) );
}

Here is the call graph for this function:

void SalomePyQt::addIntSetting ( const QString &  name,
const int  value,
bool  autoValue = true 
) [static]

Add integer setting to the application preferences.

The parameter autoValue is obsolete parameter and currently is not used. This parameter will be removed in future, so try to avoid its usage in your code.

This function is obsolete. Use one of addSetting() instead.

Parameters:
namesetting name (it should be of kind <section:setting> where section is resources section name and setting is setting name)
valuenew setting value
autoValue(not used)

Definition at line 744 of file SalomePyQt.cxx.

{
  class TEvent: public SALOME_Event 
  {
    QString myName;
    int     myValue;
    bool    myAutoValue;
  public:
    TEvent( const QString& name, const int value, bool autoValue ) 
      : myName( name ), myValue( value ), myAutoValue( autoValue ) {}
    virtual void Execute()
    {
      if ( SUIT_Session::session() ) {
        SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
        QStringList sl = myName.split( ":", QString::SkipEmptyParts );
        QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION );
        QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" );
        if ( !_sec.isEmpty() && !_nam.isEmpty() )
          resMgr->setValue( _sec, _nam, myValue );
      }
    }
  };
  ProcessVoidEvent( new TEvent( name, value, autoValue ) );
}

Here is the call graph for this function:

int SalomePyQt::addPreference ( const QString &  label) [static]

Add module-related preferences group.

Parameters:
labelpreferences group name
Returns:
preferences group identifier

Definition at line 2010 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TAddPrefEvent( label ) );
}

Here is the call graph for this function:

int SalomePyQt::addPreference ( const QString &  label,
const int  pId,
const int  type = PT_Auto,
const QString &  section = QString(),
const QString &  param = QString() 
) [static]

Add module-related preferences.

Parameters:
labelpreferences group name
pIdparent preferences group id
typepreferences type
sectionresources file section name
paramresources file setting name
Returns:
preferences identifier

Definition at line 2051 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TAddPrefParamEvent( label, pId, type, section, param ) );
}

Here is the call graph for this function:

void SalomePyQt::addPreferenceProperty ( const int  id,
const QString &  prop,
const int  idx,
const QVariant &  var 
) [static]

Add the property value to the list of values.

This method allows creating properties which are QList<QVariant>

  • there is no way to pass such values directly to QVariant parameter with PyQt.
Parameters:
idpreferences identifier
proppreferences property name
idxpreferences property index
varpreferences property value for the index idx

Definition at line 2125 of file SalomePyQt.cxx.

{
  class TEvent: public SALOME_Event
  {
    int      myId;
    QString  myProp;
    int      myIdx;
    QVariant myVar;
  public:
    TEvent( const int id, const QString& prop, const int idx, const QVariant& var ) 
      : myId( id ), myProp( prop ), myIdx( idx), myVar( var ) {}
    virtual void Execute()
    {
      SALOME_PYQT_ModuleLight* module = getActiveModule();
      if ( module ) {
        QVariant var =  module->preferenceProperty( myId, myProp );
        if ( var.isValid() ) {
          if ( var.type() == QVariant::StringList ) {
            QStringList sl = var.toStringList();
            if ( myIdx >= 0 && myIdx < sl.count() ) 
              sl[myIdx] = myVar.toString();
            else
              sl.append( myVar.toString() );
            module->setPreferenceProperty( myId, myProp, sl );
          }
          else if ( var.type() == QVariant::List ) {
            QList<QVariant> vl = var.toList();
            if ( myIdx >= 0 && myIdx < vl.count() ) 
              vl[myIdx] = myVar;
            else
              vl.append( myVar );
            module->setPreferenceProperty( myId, myProp, vl );
          }
        }
        else {
          QList<QVariant> vl;
          vl.append( myVar );
          module->setPreferenceProperty( myId, myProp, vl );
        }
      }
    }
  };
  ProcessVoidEvent( new TEvent( id, prop, idx, var) );
}

Here is the call graph for this function:

void SalomePyQt::addSetting ( const QString &  section,
const QString &  name,
const double  value 
) [static]

Add double setting to the application preferences.

Parameters:
sectionresources file section name
namesetting name
valuenew setting value

Definition at line 916 of file SalomePyQt.cxx.

{
  class TEvent: public SALOME_Event 
  {
    QString mySection;
    QString myName;
    double  myValue;
  public:
    TEvent( const QString& section, const QString& name, double value ) 
      : mySection( section ), myName( name ), myValue( value ) {}
    virtual void Execute() 
    {
      if ( SUIT_Session::session() ) {
        SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
        if ( !mySection.isEmpty() && !myName.isEmpty() )
          resMgr->setValue( mySection, myName, myValue );
      }
    }
  };
  ProcessVoidEvent( new TEvent( section, name, value ) );
}

Here is the call graph for this function:

void SalomePyQt::addSetting ( const QString &  section,
const QString &  name,
const int  value 
) [static]

Add integer setting to the application preferences.

Parameters:
sectionresources file section name
namesetting name
valuenew setting value

Definition at line 944 of file SalomePyQt.cxx.

{
  class TEvent: public SALOME_Event 
  {
    QString mySection;
    QString myName;
    int     myValue;
  public:
    TEvent( const QString& section, const QString& name, int value ) 
      : mySection( section ), myName( name ), myValue( value ) {}
    virtual void Execute() 
    {
      if ( SUIT_Session::session() ) {
        SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
        if ( !mySection.isEmpty() && !myName.isEmpty() )
          resMgr->setValue( mySection, myName, myValue );
      }
    }
  };
  ProcessVoidEvent( new TEvent( section, name, value ) );
}

Here is the call graph for this function:

void SalomePyQt::addSetting ( const QString &  section,
const QString &  name,
const bool  value,
const int   
) [static]

Add boolean setting to the application preferences.

Parameters:
sectionresources file section name
namesetting name
valuenew setting value
dumbthis parameter is used in order to avoid sip compilation error because of conflicting int and bool types

Definition at line 974 of file SalomePyQt.cxx.

{
  class TEvent: public SALOME_Event 
  {
    QString mySection;
    QString myName;
    bool    myValue;
  public:
    TEvent( const QString& section, const QString& name, bool value ) 
      : mySection( section ), myName( name ), myValue( value ) {}
    virtual void Execute() 
    {
      if ( SUIT_Session::session() ) {
        SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
        if ( !mySection.isEmpty() && !myName.isEmpty() )
          resMgr->setValue( mySection, myName, myValue );
      }
    }
  };
  ProcessVoidEvent( new TEvent( section, name, value ) );
}

Here is the call graph for this function:

void SalomePyQt::addSetting ( const QString &  section,
const QString &  name,
const QString &  value 
) [static]

Add string setting to the application preferences.

Parameters:
sectionresources file section name
namesetting name
valuenew setting value

Definition at line 1002 of file SalomePyQt.cxx.

{
  class TEvent: public SALOME_Event 
  {
    QString mySection;
    QString myName;
    QString myValue;
  public:
    TEvent( const QString& section, const QString& name, const QString& value ) 
      : mySection( section ), myName( name ), myValue( value ) {}
    virtual void Execute() 
    {
      if ( SUIT_Session::session() ) {
        SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
        if ( !mySection.isEmpty() && !myName.isEmpty() )
          resMgr->setValue( mySection, myName, myValue );
      }
    }
  };
  ProcessVoidEvent( new TEvent( section, name, value ) );
}

Here is the call graph for this function:

void SalomePyQt::addSetting ( const QString &  section,
const QString &  name,
const QColor &  value 
) [static]

Add color setting to the application preferences.

Parameters:
sectionresources file section name
namesetting name
valuenew setting value

Definition at line 1030 of file SalomePyQt.cxx.

{
  class TEvent: public SALOME_Event 
  {
    QString mySection;
    QString myName;
    QColor  myValue;
  public:
    TEvent( const QString& section, const QString& name, const QColor& value ) 
      : mySection( section ), myName( name ), myValue( value ) {}
    virtual void Execute() 
    {
      if ( SUIT_Session::session() ) {
        SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
        if ( !mySection.isEmpty() && !myName.isEmpty() )
          resMgr->setValue( mySection, myName, myValue );
      }
    }
  };
  ProcessVoidEvent( new TEvent( section, name, value ) );
}

Here is the call graph for this function:

void SalomePyQt::addStringSetting ( const QString &  name,
const QString &  value,
bool  autoValue = true 
) [static]

Add string setting to the application preferences.

The parameter autoValue is obsolete parameter and currently is not used. This parameter will be removed in future, so try to avoid its usage in your code.

This function is obsolete. Use one of addSetting() instead.

Parameters:
namesetting name (it should be of kind <section:setting> where section is resources section name and setting is setting name)
valuenew setting value
autoValue(not used)

Definition at line 706 of file SalomePyQt.cxx.

{
  class TEvent: public SALOME_Event
  {
    QString myName;
    QString myValue;
    bool    myAutoValue;
  public:
    TEvent( const QString& name, const QString& value, bool autoValue ) 
      : myName( name ), myValue( value ), myAutoValue( autoValue ) {}
    virtual void Execute() {
      if ( SUIT_Session::session() ) {
        SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
        QStringList sl = myName.split( ":", QString::SkipEmptyParts );
        QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION );
        QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" );
        if ( !_sec.isEmpty() && !_nam.isEmpty() )
          resMgr->setValue( _sec, _nam, myValue );
      }
    }
  };
  ProcessVoidEvent( new TEvent( name, value, autoValue ) );
}

Here is the call graph for this function:

bool SalomePyQt::boolSetting ( const QString &  section,
const QString &  name,
const bool  def = 0 
) [static]

Get boolean setting from the application preferences.

Parameters:
sectionresources file section name
namesetting name
defdefault value which is returned if the setting is not found
Returns:
setting value

Definition at line 1149 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TGetBoolSettingEvent( section, name, def ) );
}

Here is the call graph for this function:

Remove all the messages from the Log messages output window.

Definition at line 2203 of file SalomePyQt.cxx.

{
  class TEvent: public SALOME_Event
  {
  public:
    TEvent() {}
    virtual void Execute()
    {
      if ( LightApp_Application* anApp = getApplication() ) {
        LogWindow* lw = anApp->logWindow();
        if ( lw )
          lw->clear();
      }
    }
  };
  ProcessVoidEvent( new TEvent() );
}

Here is the call graph for this function:

int SalomePyQt::cloneView ( const int  id) [static]

Clone view (if this operation is supported for specified view type)

Parameters:
idwindow identifier
Returns:
integer identifier of the cloned view or -1 or operation could not be performed

Definition at line 2643 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TCloneView( id ) );
}

Here is the call graph for this function:

bool SalomePyQt::closeView ( const int  id) [static]

Close view.

Parameters:
idwindow identifier
Returns:
true if operation is completed successfully and false otherwise

Definition at line 2591 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TCloseView( id ) );
}

Here is the call graph for this function:

QColor SalomePyQt::colorSetting ( const QString &  section,
const QString &  name,
const QColor &  def = QColor() 
) [static]

Get color setting from the application preferences.

Parameters:
sectionresources file section name
namesetting name
defdefault value which is returned if the setting is not found
Returns:
setting value

Definition at line 1217 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TGetColorSettingEvent( section, name, def ) );
}

Here is the call graph for this function:

QAction * SalomePyQt::createAction ( const int  id,
const QString &  menuText,
const QString &  tipText = QString(),
const QString &  statusText = QString(),
const QString &  icon = QString(),
const int  key = 0,
const bool  toggle = false 
) [static]

Create an action which can be then used in the menu or toolbar.

Parameters:
idthe unique id action to be registered to
menuTextaction text which should appear in menu
tipTexttext which should appear in the tooltip
statusTexttext which should appear in the status bar when action is activated
iconthe name of the icon file (the actual icon file name can be coded in the translation files)
keythe key accelrator for the action
toggleif true the action is checkable

Definition at line 1876 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TCreateActionEvent( id, menuText, tipText, statusText, icon, key, toggle ) );
}

Here is the call graph for this function:

QtxActionGroup * SalomePyQt::createActionGroup ( const int  id,
const bool  exclusive = true 
) [static]

Create an action group which can be then used in the menu or toolbar.

Parameters:
id: the unique id action group to be registered to
exclusive: if true the action group does exclusive toggling

Definition at line 1904 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TcreateActionGroupEvent( id, exclusive ) );
}

Here is the call graph for this function:

int SalomePyQt::createMenu ( const QString &  subMenu,
const int  menu = -1,
const int  id = -1,
const int  group = -1,
const int  idx = -1 
) [static]

Create main menu.

Parameters:
subMenumenu name
menuparent menu ID
idrequired menu ID
groupmenu group ID
idxrequired index in the menu
Returns:
menu ID or -1 if menu could not be added

Definition at line 1739 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TCreateMenuEvent( CrMenu( subMenu, menu, id, group, idx ) ) );
}

Here is the call graph for this function:

int SalomePyQt::createMenu ( const QString &  subMenu,
const QString &  menu = QString(),
const int  id = -1,
const int  group = -1,
const int  idx = -1 
) [static]

Create main menu.

Parameters:
subMenumenu name
menuparent menu name (list of menu names separated by "|")
idrequired menu ID
groupmenu group ID
idxrequired index in the menu
Returns:
menu ID or -1 if menu could not be added

Definition at line 1753 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TCreateMenuEvent( CrMenu( subMenu, menu, id, group, idx ) ) );
}

Here is the call graph for this function:

int SalomePyQt::createMenu ( const int  id,
const int  menu = -1,
const int  group = -1,
const int  idx = -1 
) [static]

Insert action to the main menu.

Parameters:
idaction ID
menuparent menu ID
groupmenu group ID
idxrequired index in the menu
Returns:
action ID or -1 if action could not be added

Definition at line 1766 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TCreateMenuEvent( CrMenu( id, menu, group, idx ) ) );
}

Here is the call graph for this function:

int SalomePyQt::createMenu ( const int  id,
const QString &  menu = QString(),
const int  group = -1,
const int  idx = -1 
) [static]

Insert action to the main menu.

Parameters:
idaction ID
menuparent menu name (list of menu names separated by "|")
groupmenu group ID
idxrequired index in the menu
Returns:
action ID or -1 if action could not be added

Definition at line 1779 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TCreateMenuEvent( CrMenu( id, menu, group, idx ) ) );
}

Here is the call graph for this function:

int SalomePyQt::createMenu ( QAction *  a,
const int  menu,
const int  id = -1,
const int  group = -1,
const int  idx = -1 
) [static]

Insert action to the main menu.

Parameters:
aaction
menuparent menu ID
groupmenu group ID
idxrequired index in the menu
Returns:
action ID or -1 if action could not be added

Definition at line 1792 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TCreateMenuEvent( CrMenu( a, menu, id, group, idx ) ) );
}

Here is the call graph for this function:

int SalomePyQt::createMenu ( QAction *  a,
const QString &  menu,
const int  id = -1,
const int  group = -1,
const int  idx = -1 
) [static]

Insert action to the main menu.

Parameters:
aaction
menuparent menu name (list of menu names separated by "|")
groupmenu group ID
idxrequired index in the menu
Returns:
action ID or -1 if action could not be added

Definition at line 1805 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TCreateMenuEvent( CrMenu( a, menu, id, group, idx ) ) );
}

Here is the call graph for this function:

QString SalomePyQt::createObject ( const QString &  parent = QString("")) [static]

Definition at line 2938 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TCreateEmptyObjectEvent(parent) );
}

Here is the call graph for this function:

QString SalomePyQt::createObject ( const QString &  name,
const QString &  iconname,
const QString &  tooltip,
const QString &  parent = QString("") 
) [static]

Definition at line 2969 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TCreateObjectEvent(name, iconname, tooltip, parent) );
}

Here is the call graph for this function:

QAction * SalomePyQt::createSeparator ( ) [static]

Create separator action which can be used in the menu or toolbar.

Returns:
new separator action

Definition at line 1830 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TCreateSepEvent() );
}

Here is the call graph for this function:

int SalomePyQt::createTool ( const QString &  tBar) [static]

Create toolbar with specified name.

Parameters:
tBartoolbar name
Returns:
toolbar ID or -1 if toolbar creation is failed

Definition at line 1609 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TCreateToolEvent( CrTool( tBar ) ) );
}

Here is the call graph for this function:

int SalomePyQt::createTool ( const int  id,
const int  tBar,
const int  idx = -1 
) [static]

Insert action with specified id to the toolbar.

Parameters:
idaction ID
tBartoolbar ID
idxrequired index in the toolbar
Returns:
action ID or -1 if action could not be added

Definition at line 1621 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TCreateToolEvent( CrTool( id, tBar, idx ) ) );
}

Here is the call graph for this function:

int SalomePyQt::createTool ( const int  id,
const QString &  tBar,
const int  idx = -1 
) [static]

Insert action with specified id to the toolbar.

Parameters:
idaction ID
tBartoolbar name
idxrequired index in the toolbar
Returns:
action ID or -1 if action could not be added

Definition at line 1633 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TCreateToolEvent( CrTool( id, tBar, idx ) ) );
}

Here is the call graph for this function:

int SalomePyQt::createTool ( QAction *  a,
const int  tBar,
const int  id = -1,
const int  idx = -1 
) [static]

Insert action to the toolbar.

Parameters:
aaction
tBartoolbar ID
idrequired action ID
idxrequired index in the toolbar
Returns:
action ID or -1 if action could not be added

Definition at line 1646 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TCreateToolEvent( CrTool( a, tBar, id, idx ) ) );
}

Here is the call graph for this function:

int SalomePyQt::createTool ( QAction *  a,
const QString &  tBar,
const int  id = -1,
const int  idx = -1 
) [static]

Insert action to the toolbar.

Parameters:
aaction
tBartoolbar name
idrequired action ID
idxrequired index in the toolbar
Returns:
action ID or -1 if action could not be added

Definition at line 1659 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TCreateToolEvent( CrTool( a, tBar, id, idx ) ) );
}

Here is the call graph for this function:

int SalomePyQt::createView ( const QString &  type) [static]

Create new view and activate it.

Parameters:
typeviewer type
Returns:
integer identifier of created view (or -1 if view could not be created)

Definition at line 2517 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TCreateView( type ) );
}

Here is the call graph for this function:

int SalomePyQt::createView ( const QString &  type,
QWidget *  w 
) [static]

Create new view with custom widget embedded and activate it.

Parameters:
typeviewer type
wcustom widget
Returns:
integer identifier of created view (or -1 if view could not be created)

Definition at line 2556 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TCreateViewWg( type, w ) );
}

Here is the call graph for this function:

int SalomePyQt::defaultMenuGroup ( ) [static]

Get detault menu group identifier which can be used when creating menus (insert custom menu commands).

Returns:
default menu group ID

Definition at line 1542 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TDefMenuGroupEvent() );
}

Here is the call graph for this function:

double SalomePyQt::doubleSetting ( const QString &  section,
const QString &  name,
const double  def = 0 
) [static]

Get double setting from the application preferences.

Parameters:
sectionresources file section name
namesetting name
defdefault value which is returned if the setting is not found
Returns:
setting value

Definition at line 1115 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TGetDblSettingEvent( section, name, def ) );
}

Here is the call graph for this function:

bool SalomePyQt::dumpView ( const QString &  filename) [static]

Dump the contents of the currently active view window to the image file in the specified format.

For the current moment JPEG, PNG and BMP images formats are supported. The image format is defined automatically by the file name extension. By default, BMP format is used.

Parameters:
filenameimage file name
Returns:
operation status (true on success)

Definition at line 1519 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TDumpViewEvent( filename ) );
}

Here is the call graph for this function:

QList< int > SalomePyQt::findViews ( const QString &  type) [static]

Get list of integer identifiers of all the currently opened views of the specified type.

Parameters:
typeviewer type
Returns:
list of integer identifiers

Definition at line 2450 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TFindViews( type ) );
}

Here is the call graph for this function:

const QString SalomePyQt::getActiveComponent ( ) [static]

Get the currently active module name (for the current study).

Returns:
active module name or empty string if there is no active module

Definition at line 518 of file SalomePyQt.cxx.

Here is the call graph for this function:

PyObject * SalomePyQt::getActivePythonModule ( ) [static]

Access to Python module object currently loaded into SALOME_PYQT_ModuleLight container.

Returns:
Python module object currently loaded into SALOME_PYQT_ModuleLight container

Definition at line 542 of file SalomePyQt.cxx.

Here is the call graph for this function:

int SalomePyQt::getActiveView ( ) [static]

Get integer identifier of the currently active view.

Returns:
integer identifier of the currently active view

Definition at line 2314 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TGetActiveView() );
}

Here is the call graph for this function:

QStringList SalomePyQt::getChildren ( const QString &  obj = QString(""),
const bool  rec = false 
) [static]

Definition at line 3248 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TGetChildrenEvent(obj,rec) ); 
}

Here is the call graph for this function:

QColor SalomePyQt::getColor ( const QString &  obj) [static]

Definition at line 3179 of file SalomePyQt.cxx.

{
  return ProcessEvent(new TGetColorEvent(obj));
}

Here is the call graph for this function:

QWidget * SalomePyQt::getDesktop ( ) [static]

Get the active application's desktop window.

Returns:
desktop window or 0 if there is no any

Definition at line 253 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TGetDesktopEvent() );
}

Here is the call graph for this function:

QString SalomePyQt::getExistingDirectory ( QWidget *  parent,
const QString &  initial,
const QString &  caption 
) [static]

Show 'Get Directory' dialog box for the directory selection and return a user's choice (selected directory name).

Parameters:
parentparent widget
initialinitial directory the dialog box to be opened in
captiondialog box title
Returns:
selected directory name (null string if user cancels operation)

Definition at line 1410 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TGetExistingDirectoryEvent( parent, initial, caption ) );
}

Here is the call graph for this function:

QString SalomePyQt::getFileName ( QWidget *  parent,
const QString &  initial,
const QStringList &  filters,
const QString &  caption,
bool  open 
) [static]

Show 'Open/Save file' dialog box for file selection and return a user's choice (selected file name).

Parameters:
parentparent widget
initialinitial directory the dialog box to be opened in
filterslist of files filters (wildcards)
captiondialog box title
openif true, "Open File" dialog box is shown; otherwise "Save File" dialog box is shown
Returns:
selected file name (null string if user cancels operation)

Definition at line 1322 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TGetFileNameEvent( parent, initial, filters, caption, open ) );
}

Here is the call graph for this function:

QWidget * SalomePyQt::getMainFrame ( ) [static]

Get current application's main frame widget [obsolete].

Main frame widget is an internal widget of the application desktop window (workspace).

Returns:
workspace widget (0 on any error)

Definition at line 282 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TGetMainFrameEvent() );
}

Here is the call graph for this function:

QMenuBar * SalomePyQt::getMainMenuBar ( ) [static]

Get current application desktop's main menu.

Returns:
main menu object (0 on any error)

Definition at line 306 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TGetMainMenuBarEvent() );
}

Here is the call graph for this function:

QString SalomePyQt::getName ( const QString &  obj) [static]

Definition at line 3113 of file SalomePyQt.cxx.

{
  return ProcessEvent(new TGetNameEvent(obj));
}

Here is the call graph for this function:

QTreeView * SalomePyQt::getObjectBrowser ( ) [static]

Get object browser.

Returns:
object browser for the active study or 0 in case of error

Definition at line 412 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TGetObjectBrowserEvent() );
}

Here is the call graph for this function:

QStringList SalomePyQt::getOpenFileNames ( QWidget *  parent,
const QString &  initial,
const QStringList &  filters,
const QString &  caption 
) [static]

Show 'Open files' dialog box for multiple files selection and return a user's choice (selected file names list).

Parameters:
parentparent widget
initialinitial directory the dialog box to be opened in
filterslist of files filters (wildcards)
captiondialog box title
Returns:
selected file names list (empty list if user cancels operation)

Definition at line 1369 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TGetOpenFileNamesEvent( parent, initial, filters, caption ) );
}

Here is the call graph for this function:

QMenu * SalomePyQt::getPopupMenu ( const MenuName  menu) [static]

Get main menu's child popup submenu by its identifier.

This function is obsolete. Use QMenu* SalomePyQt::getPopupMenu( const QString& menu ) instead.

Parameters:
menumenu identifier
Returns:
popup submenu object or 0 if it does not exist

Definition at line 366 of file SalomePyQt.cxx.

{
  QString menuName;
  switch( menu ) {
  case File:
    menuName = getMenuName( "MEN_DESK_FILE" );        break;
  case View:
    menuName = getMenuName( "MEN_DESK_VIEW" );        break;
  case Edit:
    menuName = getMenuName( "MEN_DESK_EDIT" );        break;
  case Preferences:
    menuName = getMenuName( "MEN_DESK_PREFERENCES" ); break;
  case Tools:
    menuName = getMenuName( "MEN_DESK_TOOLS" );       break;
  case Window:
    menuName = getMenuName( "MEN_DESK_WINDOW" );      break;
  case Help:
    menuName = getMenuName( "MEN_DESK_HELP" );        break;
  }
  return ProcessEvent( new TGetPopupMenuEvent( menuName ) );
}

Here is the call graph for this function:

QMenu * SalomePyQt::getPopupMenu ( const QString &  menu) [static]

Get main menu's child popup submenu by its name.

The function creates menu if it does not exist.

Parameters:
menumenu name
Returns:
popup submenu object (0 on any error)

Definition at line 387 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TGetPopupMenuEvent( menu ) );
}

Here is the call graph for this function:

QString SalomePyQt::getReference ( const QString &  obj) [static]

Definition at line 3157 of file SalomePyQt.cxx.

{
  return ProcessEvent(new TGetRefEvent(obj));
}

Here is the call graph for this function:

Get the selection object for the current study.

Creates a Selection object if it has not been created yet.

Returns:
selection object (0 on error)

Definition at line 461 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TGetSelectionEvent() );
}

Here is the call graph for this function:

QString SalomePyQt::getSetting ( const QString &  name) [static]

Get application setting value (as string represenation).

This function is obsolete. Use stringSetting(), integerSetting(), boolSetting(), stringSetting() or colorSetting() instead.

Parameters:
namesetting name (it should be of kind <section:setting> where section is resources section name and setting is setting name)
Returns:
setting name (empty string if setting name is invalid)

Definition at line 905 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TGetSettingEvent( name ) );
}

Here is the call graph for this function:

int SalomePyQt::getStudyId ( ) [static]

Get active study's identifier.

Returns:
active study ID or 0 if there is no active study

Definition at line 436 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TGetStudyIdEvent() );
}

Here is the call graph for this function:

QString SalomePyQt::getToolTip ( const QString &  obj) [static]

Definition at line 3135 of file SalomePyQt.cxx.

{
  return ProcessEvent(new TGetToolTipEvent(obj));
}

Here is the call graph for this function:

QList< int > SalomePyQt::getViews ( ) [static]

Get list of integer identifiers of all the currently opened views.

Returns:
list of integer identifiers of all the currently opened views

Definition at line 2281 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TGetViews() );
}

Here is the call graph for this function:

QString SalomePyQt::getViewTitle ( const int  id) [static]

Get view caption.

Parameters:
idwindow identifier
Returns:
view caption

Definition at line 2407 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TGetViewTitle( id ) );
}

Here is the call graph for this function:

QString SalomePyQt::getViewType ( const int  id) [static]

Get type of the specified view, e.g.

"OCCViewer"

Parameters:
idwindow identifier
Returns:
view type

Definition at line 2345 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TGetViewType( id ) );
}

Here is the call graph for this function:

bool SalomePyQt::groupAllViews ( ) [static]

Group all views to the single tab area.

Returns:
true if operation is completed successfully and false otherwise

Definition at line 2765 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TGroupAllViews() );
}

Here is the call graph for this function:

bool SalomePyQt::hasSetting ( const QString &  section,
const QString &  name 
) [static]

Check setting existence in the application preferences.

Parameters:
sectionresources file section name
namesetting name
Returns:
true if setting exists

Definition at line 1272 of file SalomePyQt.cxx.

{
  return ProcessEvent( new THasColorSettingEvent( section, name ) );
}

Here is the call graph for this function:

void SalomePyQt::helpContext ( const QString &  source,
const QString &  context 
) [static]

Open external browser to display context help information.

Todo:

Current implementation does nothing.

Parameters:
sourcedocumentation (HTML) file name
contextcontext (for example, HTML ancor name)

Definition at line 1460 of file SalomePyQt.cxx.

{
  class TEvent: public SALOME_Event 
  {
    QString mySource;
    QString myContext;
  public:
    TEvent( const QString& source, const QString& context ) 
      : mySource( source ), myContext( context ) {}
    virtual void Execute() 
    {
      if ( LightApp_Application* anApp = getApplication() ) {
        anApp->onHelpContextModule( "", mySource, myContext );
      }
    }
  };
  ProcessVoidEvent( new TEvent( source, context ) );
}

Here is the call graph for this function:

int SalomePyQt::integerSetting ( const QString &  section,
const QString &  name,
const int  def = 0 
) [static]

Get integer setting from the application preferences.

Parameters:
sectionresources file section name
namesetting name
defdefault value which is returned if the setting is not found
Returns:
setting value

Definition at line 1081 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TGetIntSettingEvent( section, name, def ) );
}

Here is the call graph for this function:

bool SalomePyQt::isModified ( ) [static]

Definition at line 641 of file SalomePyQt.cxx.

{
  return ProcessEvent(new TIsModifiedEvent());
}

Here is the call graph for this function:

bool SalomePyQt::isViewClosable ( const int  id) [static]

Check whether view is closable (i.e.

can be closed by the user)

Parameters:
idwindow identifier
Returns:
true if view is closable or false otherwise

Definition at line 2729 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TIsViewClosable( id ) );
}

Here is the call graph for this function:

bool SalomePyQt::isViewVisible ( const int  id) [static]

Check whether view is visible ( i.e.

it is on the top of the views stack)

Parameters:
idwindow identifier
Returns:
true if view is visible and false otherwise

Definition at line 2674 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TIsViewVisible( id ) );
}

Here is the call graph for this function:

QIcon SalomePyQt::loadIcon ( const QString &  module,
const QString &  filename 
) [static]

Load an icon from the module resources by the specified file name.

Parameters:
filenameicon file name
Returns:
icon object

Definition at line 1446 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TLoadIconEvent( module, filename ) );
}

Here is the call graph for this function:

void SalomePyQt::message ( const QString &  msg,
bool  addSeparator = true 
) [static]

Put the message to the Log messages output window.

Parameters:
msgmessage text (it can be of simple rich text format)
addSeparatorboolean flag which specifies if it is necessary to separate the message with predefined separator

Definition at line 2179 of file SalomePyQt.cxx.

{
  class TEvent: public SALOME_Event
  {
    QString  myMsg;
    bool     myAddSep;
  public:
    TEvent( const QString& msg, bool addSeparator ) 
      : myMsg( msg ), myAddSep( addSeparator ) {}
    virtual void Execute()
    {
      if ( LightApp_Application* anApp = getApplication() ) {
        LogWindow* lw = anApp->logWindow();
        if ( lw )
          lw->putMessage( myMsg, myAddSep );
      }
    }
  };
  ProcessVoidEvent( new TEvent( msg, addSeparator ) );
}

Here is the call graph for this function:

bool SalomePyQt::moveView ( const int  id,
const int  id_to,
const bool  before 
) [static]

Move view with the first identifier to the same area which another view with the second identifier belongs to.

Parameters:
idsource window identifier
id_todestination window identifier param before specifies whether the first viewt has to be moved before or after the second view
Returns:
true if operation is completed successfully and false otherwise

Definition at line 2873 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TMoveView( id, id_to, before ) );
}

Here is the call graph for this function:

QList< int > SalomePyQt::neighbourViews ( const int  id) [static]

Get list of views identifiers that belongs to the same area as specified view (excluding it)

Parameters:
idwindow identifier
Returns:
list of views identifiers

Definition at line 2916 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TNeighbourViews( id ) );
}

Here is the call graph for this function:

QVariant SalomePyQt::preferenceProperty ( const int  id,
const QString &  prop 
) [static]

Get the preferences property.

Parameters:
idpreferences identifier
proppreferences property name
Returns:
preferences property value or null QVariant if property is not set

Definition at line 2081 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TPrefPropEvent( id, prop ) );
}

Here is the call graph for this function:

void SalomePyQt::putInfo ( const QString &  msg,
const int  sec = 0 
) [static]

Put an information message to the current application's desktop status bar.

Optional second delay parameter (sec) can be used to specify time of the message diplaying in seconds. If this parameter is less or equal to zero, the constant message will be put.

Parameters:
msgmessage text
secmessage displaying time in seconds

Definition at line 492 of file SalomePyQt.cxx.

{
  ProcessVoidEvent( new TPutInfoEvent( msg, sec ) );
}

Here is the call graph for this function:

void SalomePyQt::removeChild ( const QString &  obj = QString("")) [static]

Definition at line 3200 of file SalomePyQt.cxx.

Here is the call graph for this function:

void SalomePyQt::removeObject ( const QString &  obj) [static]

Definition at line 3222 of file SalomePyQt.cxx.

Here is the call graph for this function:

void SalomePyQt::removeSetting ( const QString &  section,
const QString &  name 
) [static]

Remove setting from the application preferences.

Parameters:
sectionresources file section name
namesetting name

Definition at line 1227 of file SalomePyQt.cxx.

{
  class TEvent: public SALOME_Event 
  {
    QString mySection;
    QString myName;
  public:
    TEvent( const QString& section, const QString& name ) : mySection( section ), myName( name ) {}
    virtual void Execute() 
    {
      if ( SUIT_Session::session() ) {
        SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
        if ( !mySection.isEmpty() && !myName.isEmpty() )
          resMgr->remove( mySection, myName );
      }
    }
  };
  ProcessVoidEvent( new TEvent( section, name ) );
}

Here is the call graph for this function:

void SalomePyQt::removeSettings ( const QString &  name) [static]

Remove setting from the application preferences.

This function is obsolete. Use removeSetting() instead.

Parameters:
namesetting name (it should be of kind <section:setting> where section is resources section name and setting is setting name)

Definition at line 855 of file SalomePyQt.cxx.

{
  class TEvent: public SALOME_Event {
    QString myName;
  public:
    TEvent( const QString& name ) : myName( name ) {}
    virtual void Execute() {
      if ( SUIT_Session::session() ) {
        SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
        QStringList sl = myName.split( ":", QString::SkipEmptyParts );
        QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION );
        QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" );
        if ( !_sec.isEmpty() && !_nam.isEmpty() )
          resMgr->remove( _sec, _nam );
      }
    }
  };
  ProcessVoidEvent( new TEvent( name ) );
}

Here is the call graph for this function:

void SalomePyQt::setColor ( const QString &  obj,
const QColor &  color 
) [static]

Definition at line 3090 of file SalomePyQt.cxx.

{
  ProcessVoidEvent(new TSetColorEvent(obj,color));
}

Here is the call graph for this function:

void SalomePyQt::setIcon ( const QString &  obj,
const QString &  iconname 
) [static]

Definition at line 3021 of file SalomePyQt.cxx.

{
  ProcessVoidEvent(new TSetIconEvent(obj,iconname));
}

Here is the call graph for this function:

void SalomePyQt::setModified ( bool  flag) [static]

SalomePyQt::setModified()

Sets the modification status of the data model for the currently active Python module. This method should be used by the Python code in order to enable/disable "Save" operation depending on the module's data state.

Parameters:
Newmodification status of the data model
See also:
isModified()

Definition at line 658 of file SalomePyQt.cxx.

{  
  class TEvent: public SALOME_Event
  {
    bool myFlag;
  public:
    TEvent( bool flag ) 
      : myFlag( flag ) {}
    virtual void Execute()
    {
      SALOME_PYQT_ModuleLight* module = getActiveModule();
      if ( !module )
       return;

      SALOME_PYQT_DataModelLight* aModel =
       dynamic_cast<SALOME_PYQT_DataModelLight*>( module->dataModel() );
      LightApp_Application* aLApp = 
       dynamic_cast<LightApp_Application*>( module->application() );
      if ( !aModel || !aLApp )
       return;

      aModel->setModified( myFlag );
      aLApp->updateActions();
    }
  };
  ProcessVoidEvent( new TEvent( flag ) );
}

Here is the call graph for this function:

void SalomePyQt::setName ( const QString &  obj,
const QString &  name 
) [static]

Definition at line 2996 of file SalomePyQt.cxx.

{
  ProcessVoidEvent(new TSetNameEvent(obj,name));
}

Here is the call graph for this function:

void SalomePyQt::setPreferenceProperty ( const int  id,
const QString &  prop,
const QVariant &  var 
) [static]

Set the preferences property.

Parameters:
idpreferences identifier
proppreferences property name
varpreferences property value

Definition at line 2092 of file SalomePyQt.cxx.

{
  class TEvent: public SALOME_Event
  {
    int      myId;
    QString  myProp;
    QVariant myVar;
  public:
    TEvent( const int id, const QString& prop, const QVariant& var ) 
      : myId( id ), myProp( prop ), myVar( var ) {}
    virtual void Execute() 
    {
      SALOME_PYQT_ModuleLight* module = getActiveModule();
      if ( module )
        module->setPreferenceProperty( myId, myProp, myVar );
    }
  };
  ProcessVoidEvent( new TEvent( id, prop, var) );
}

Here is the call graph for this function:

void SalomePyQt::setReference ( const QString &  obj,
const QString &  refEntry 
) [static]

Definition at line 3067 of file SalomePyQt.cxx.

{
  ProcessVoidEvent(new TSetRefEvent(obj,refEntry));
}

Here is the call graph for this function:

void SalomePyQt::setToolTip ( const QString &  obj,
const QString &  tooltip 
) [static]

Definition at line 3044 of file SalomePyQt.cxx.

{
  ProcessVoidEvent(new TSetToolTipEvent(obj,tooltip));
}

Here is the call graph for this function:

void SalomePyQt::setViewClosable ( const int  id,
const bool  on 
) [static]

Set / clear view's "closable" option.

By default any view is closable (i.e. can be closed by the user).

Parameters:
idwindow identifier
onnew "closable" option's value

Definition at line 2687 of file SalomePyQt.cxx.

{
  class TEvent: public SALOME_Event
  {
    int myWndId;
    bool myOn;
  public:
    TEvent( const int id, const bool on )
      : myWndId( id ), myOn( on ) {}
    virtual void Execute()
    {
      SUIT_ViewWindow* wnd = getWnd( myWndId );
      if ( wnd ) wnd->setClosable( myOn );
    }
  };
  ProcessVoidEvent( new TEvent( id, on ) );
}

Here is the call graph for this function:

bool SalomePyQt::setViewTitle ( const int  id,
const QString &  title 
) [static]

Change view caption.

Parameters:
idwindow identifier
titlenew window title
Returns:
true if operation is completed successfully and false otherwise

Definition at line 2379 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TSetViewTitle( id, title ) );
}

Here is the call graph for this function:

bool SalomePyQt::splitView ( const int  id,
const Orientation  ori,
const Action  action 
) [static]

Split tab area to which view with identifier belongs to.

Parameters:
idwindow identifier
oriorientation of split operation
actionaction to be performed
Returns:
true if operation is completed successfully false otherwise

Definition at line 2831 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TSplitView( id, ori, action ) );
}

Here is the call graph for this function:

QString SalomePyQt::stringSetting ( const QString &  section,
const QString &  name,
const QString &  def = QString("") 
) [static]

Get string setting from the application preferences.

Parameters:
sectionresources file section name
namesetting name
defdefault value which is returned if the setting is not found
Returns:
setting value

Definition at line 1183 of file SalomePyQt.cxx.

{
  return ProcessEvent( new TGetStrSettingEvent( section, name, def ) );
}

Here is the call graph for this function:

void SalomePyQt::updateObjBrowser ( const int  studyId = 0,
bool  updateSelection = true 
) [static]

Update an Object Browser of the specified (by identifier) study.

If studyId <= 0 the active study's object browser is updated. The updateSelection parameter is obsolete and currently is not used. This parameter will be removed in future, so try to avoid its usage in your code.

studyId study identifier updateSelection update selection flag (not used)

See also:
getActiveStudy()

Definition at line 585 of file SalomePyQt.cxx.

{  
  class TEvent: public SALOME_Event
  {
    int  myStudyId;
    bool myUpdateSelection;
  public:
    TEvent( const int studyId, bool updateSelection ) 
      : myStudyId( studyId ), myUpdateSelection( updateSelection ) {}
    virtual void Execute()
    {
      if ( SUIT_Session::session() ) {
        if ( getActiveStudy() && myStudyId <= 0 )
          myStudyId = getActiveStudy()->id();
        if ( myStudyId > 0 ) {
          QList<SUIT_Application*> apps = SUIT_Session::session()->applications();
          QList<SUIT_Application*>::Iterator it;
          for( it = apps.begin(); it != apps.end(); ++it ) {
            LightApp_Application* anApp = dynamic_cast<LightApp_Application*>( *it );
            if ( anApp && anApp->activeStudy() && anApp->activeStudy()->id() == myStudyId ) {
              anApp->updateObjectBrowser();
              return;
            }
          }
        }
      }
    }
  };
  ProcessVoidEvent( new TEvent( studyId, updateSelection ) );
}

Here is the call graph for this function:


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