Version: 9.12.0
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>

Static Public Member Functions

static QString getAppName ()
 Get application name. More...
 
static bool isLightApp ()
 Check if SALOME GUI is running in "light" mode. More...
 
static QWidgetgetDesktop ()
 Get the active application's desktop window. More...
 
static QWidgetgetMainFrame ()
 Get current application's main frame widget [obsolete]. More...
 
static QMenuBar * getMainMenuBar ()
 Get current application desktop's main menu. More...
 
static QMenugetPopupMenu (const MenuName)
 Get main menu's child popup submenu by its identifier. More...
 
static QMenugetPopupMenu (const QString &)
 Get main menu's child popup submenu by its name. More...
 
static QTreeViewgetObjectBrowser ()
 Get object browser. More...
 
static void enableSelector ()
 enable PyQt_Selector (on module activation, for instance) More...
 
static void disableSelector ()
 disable PyQt_Selector (on module activation, for instance) More...
 
static SALOME_SelectiongetSelection ()
 Get the selection object for the current study. More...
 
static QStringList getComponents ()
 Get all modules used in current GUI session. More...
 
static void setSelection (const QStringList &)
 Send local selection for notification. More...
 
static const QString getActiveComponent ()
 Get the currently active module name (for the current study). More...
 
static PyObject * getActivePythonModule ()
 Access to Python module object currently loaded into SALOME_PYQT_ModuleLight container. More...
 
static bool activateModule (const QString &)
 Activates SALOME module with the given name. More...
 
static void registerModule (const QString &)
 Registers module in the study tree. More...
 
static void updateObjBrowser ()
 Update an Object Browser of the study. More...
 
static void infoSetTitle (const QString &)
 Set the title to the Help panel. More...
 
static int infoAddLabel (const QString &, const int=-1)
 Insert left-aligned text label into the Help panel. More...
 
static int infoAddLabel (const QString &, Qt::Alignment, const int=-1)
 Insert text label into the Help panel. More...
 
static int infoAddAction (QAction *, const int=-1)
 Insert action button into the Help panel. More...
 
static int infoAddGroup (const QString &, const int=-1)
 Create a (sub-)group in the Help panel. More...
 
static void infoRemove (const int)
 Remove item from the Help panel. More...
 
static void infoClear (const int=-1)
 Clear Help panel's contents. More...
 
static void infoSetVisible (const int, bool)
 Set item's visibility in the Help panel. More...
 
static void infoSetEnabled (const int, bool)
 Enable/disable item in the Help panel. More...
 
static void putInfo (const QString &, const int=0)
 Put an information message to the current application's desktop status bar. More...
 
static int showNotification (const QString &, const QString &, const int=-1)
 Show notification in the application's desktop window. More...
 
static void hideNotification (const QString &)
 Remove notification with given message text from the application's desktop. More...
 
static void hideNotification (const int)
 Remove notification with given id from the application's desktop. More...
 
static bool isModified ()
 
static void setModified (bool)
 
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). More...
 
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). More...
 
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). More...
 
static void createRoot ()
 Initialize root data object. More...
 
static QString createObject (const QString &parent=QString())
 Create empty data object. More...
 
static QString createObject (const QString &, const QString &, const QString &, const QString &=QString())
 Create new data object with specified name, icon and tooltip. More...
 
static void removeObject (const QString &)
 Remove object by entry. More...
 
static void removeChildren (const QString &=QString())
 Remove all child data objects from specified data object. More...
 
static QStringList getChildren (const QString &=QString(), const bool=false)
 Get entries of all child data objects of specified data object. More...
 
static void setName (const QString &, const QString &)
 Set data object name. More...
 
static void setIcon (const QString &, const QString &)
 Set data object icon. More...
 
static void setToolTip (const QString &, const QString &)
 Set data object tooltip. More...
 
static QString getName (const QString &)
 Get data object name. More...
 
static QString getToolTip (const QString &)
 Get data object tooltip. More...
 
static void setVisibilityState (const QString &, VisibilityState)
 Set visibility state for given object. More...
 
static VisibilityState getVisibilityState (const QString &)
 Get visibility state for given object. More...
 
static void setObjectPosition (const QString &, int)
 Set position of given object in the tree. More...
 
static int getObjectPosition (const QString &)
 Get position of given object in the tree. More...
 
static void setColor (const QString &, const QColor &)
 Set data object color. More...
 
static QColor getColor (const QString &)
 Get data object color. More...
 
static void setReference (const QString &, const QString &)
 Set reference to another data object. More...
 
static QString getReference (const QString &)
 
static QIcon loadIcon (const QString &, const QString &)
 Load an icon from the module resources by the specified file name. More...
 
static void helpContext (const QString &, const QString &)
 Open external browser to display context help information. More...
 
static bool dumpView (const QString &, const int=0)
 Dump the contents of the id view window. If id is 0 then current active view is processed. to the image file in the specified format. More...
 
static int defaultMenuGroup ()
 Get detault menu group identifier which can be used when creating menus (insert custom menu commands). More...
 
static int createTool (const QString &, const QString &=QString())
 Create toolbar with specified name. More...
 
static int createTool (const int, const int, const int=-1)
 Insert action with specified id to the toolbar. More...
 
static int createTool (const int, const QString &, const int=-1)
 Insert action with specified id to the toolbar. More...
 
static int createTool (QAction *, const int, const int=-1, const int=-1)
 Insert action to the toolbar. More...
 
static int createTool (QAction *, const QString &, const int=-1, const int=-1)
 Insert action to the toolbar. More...
 
static void clearTool (const QString &)
 Clear given toolbar. More...
 
static int createMenu (const QString &, const int=-1, const int=-1, const int=-1, const int=-1)
 Create main menu. More...
 
static int createMenu (const QString &, const QString &=QString(), const int=-1, const int=-1, const int=-1)
 Create main menu. More...
 
static int createMenu (const int, const int=-1, const int=-1, const int=-1)
 Insert action to the main menu. More...
 
static int createMenu (const int, const QString &=QString(), const int=-1, const int=-1)
 Insert action to the main menu. More...
 
static int createMenu (QAction *, const int, const int=-1, const int=-1, const int=-1)
 Insert action to the main menu. More...
 
static int createMenu (QAction *, const QString &, const int=-1, const int=-1, const int=-1)
 Insert action to the main menu. More...
 
static QActioncreateSeparator ()
 Create separator action which can be used in the menu or toolbar. More...
 
static QActioncreateAction (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. More...
 
static QtxActionGroupcreateActionGroup (const int, const bool=true)
 Create an action group which can be then used in the menu or toolbar. More...
 
static QActionaction (const int)
 Get action by specified identifier. More...
 
static int actionId (const QAction *)
 Get an action identifier. More...
 
static QString constant (const QString &)
 Get constant's value from application's resource manager. More...
 
static void setConstant (const QString &, const QString &)
 Add constant to the application's resource manager. More...
 
static void addSetting (const QString &, const QString &, const double)
 Add double setting to the application preferences. More...
 
static void addSetting (const QString &, const QString &, const int)
 Add integer setting to the application preferences. More...
 
static void addSetting (const QString &, const QString &, const bool, const int)
 Add boolean setting to the application preferences. More...
 
static void addSetting (const QString &, const QString &, const QString &)
 Add string setting to the application preferences. More...
 
static void addSetting (const QString &, const QString &, const QColor &)
 Add color setting to the application preferences. More...
 
static void addSetting (const QString &, const QString &, const QByteArray &)
 Add byte array setting to the application preferences. More...
 
static void addSetting (const QString &, const QString &, const QFont &)
 Add font setting to the application preferences. More...
 
static int integerSetting (const QString &, const QString &, const int=0)
 Get integer setting from the application preferences. More...
 
static double doubleSetting (const QString &, const QString &, const double=0)
 Get double setting from the application preferences. More...
 
static bool boolSetting (const QString &, const QString &, const bool=0)
 Get boolean setting from the application preferences. More...
 
static QString stringSetting (const QString &, const QString &, const QString &=QString(""), const bool=true)
 Get string setting from the application preferences. More...
 
static QColor colorSetting (const QString &, const QString &, const QColor &=QColor())
 Get color setting from the application preferences. More...
 
static QByteArray byteArraySetting (const QString &, const QString &, const QByteArray &=QByteArray())
 Get byte array setting from the application preferences. More...
 
static QFont fontSetting (const QString &, const QString &, const QFont &=QFont())
 Get font setting from the application preferences. More...
 
static void removeSetting (const QString &, const QString &)
 Remove setting from the application preferences. More...
 
static bool hasSetting (const QString &, const QString &)
 Check setting existence in the application preferences. More...
 
static QStringList parameters (const QString &)
 Get names of preference items stored within the given section. More...
 
static QStringList parameters (const QStringList &)
 Get names of preference items stored within the given section. More...
 
static int addGlobalPreference (const QString &)
 Add global (not module-related) preferences group. More...
 
static int addPreference (const QString &)
 Add module-related preferences group. More...
 
static int addPreference (const QString &, const int, const int=PT_Auto, const QString &=QString(), const QString &=QString())
 Add module-related preferences. More...
 
static QVariant preferenceProperty (const int, const QString &)
 Get the preferences property. More...
 
static void setPreferenceProperty (const int, const QString &, const QVariant &)
 Set the preferences property. More...
 
static void setPreferencePropertyWg (const int, const QString &, UserDefinedContent *)
 Set specific widget as a custom preferences item. More...
 
static void addPreferenceProperty (const int, const QString &, const int, const QVariant &)
 Add the property value to the list of values. More...
 
static void message (const QString &, bool=true)
 Put the message to the Log messages output window. More...
 
static void clearMessages ()
 Remove all the messages from the Log messages output window. More...
 
static QList< int > getViews ()
 Get list of integer identifiers of all the currently opened views. More...
 
static int getActiveView ()
 Get integer identifier of the currently active view. More...
 
static QString getViewType (const int)
 Get type of the specified view, e.g. "OCCViewer". More...
 
static bool setViewTitle (const int, const QString &)
 Change view caption
More...
 
static QString getViewTitle (const int)
 Get view caption
More...
 
static bool setViewSize (const int, const int, const int=0)
 Set view size. More...
 
static bool setViewRotationPoint (const double, const double, const double, const int=0)
 Set view rotation point. More...
 
static QList< int > findViews (const QString &)
 Get list of integer identifiers of all the currently opened views of the specified type. More...
 
static bool activateView (const int)
 Activate view. More...
 
static bool activateViewManagerAndView (const int)
 
static QWidgetgetViewWidget (const int)
 
static int createView (const QString &, bool visible=true, const int width=0, const int height=0, bool detached=false)
 
static int createView (const QString &, QWidget *)
 Create new view with custom widget embedded and activate it. More...
 
static bool closeView (const int)
 Close view. More...
 
static int cloneView (const int)
 Clone view (if this operation is supported for specified view type) More...
 
static void setViewVisible (const int id, bool visible=true)
 Set view visibility. More...
 
static bool isViewVisible (const int)
 Check whether view is visible ( i.e. it is on the top of the views stack) More...
 
static void setViewClosable (const int, const bool)
 Set / clear view's "closable" option. By default any view is closable (i.e. can be closed by the user). More...
 
static bool isViewClosable (const int)
 Check whether view is closable (i.e. can be closed by the user) More...
 
static bool groupAllViews ()
 Group all views to the single tab area. More...
 
static bool splitView (const int, const Orientation, const Action)
 Split tab area to which view with identifier belongs to. More...
 
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. More...
 
static QList< int > neighbourViews (const int)
 Get list of views identifiers that belongs to the same area as specified view (excluding it) More...
 
static void displayCurve (const int, Plot2d_Curve *)
 Display theCurve in view. More...
 
static void eraseCurve (const int, Plot2d_Curve *)
 Erase theCurve in view. More...
 
static void eraseCurve (Plot2d_Curve *)
 
static void updateCurves (const int)
 updateCurves (repaint) curves in view window. More...
 
static QString getPlot2dTitle (const int, ObjectType=MainTitle)
 Get title of corresponding type. More...
 
static void setPlot2dTitle (const int, const QString &, ObjectType=MainTitle, bool=true)
 Set title of corresponding type. More...
 
static QList< double > getPlot2dFitRangeByCurves (const int)
 Get list of Plot2d view ranges. More...
 
static QList< double > getPlot2dFitRangeCurrent (const int)
 Get list of current Plot2d view ranges. More...
 
static void setPlot2dFitRange (const int, const double XMin, const double XMax, const double YMin, const double YMax)
 Set range of Plot2d view. More...
 
static void processEvents ()
 Process Qt event loop. More...
 
static void addStringSetting (const QString &, const QString &, bool=true)
 Add string setting to the application preferences. More...
 
static void addIntSetting (const QString &, const int, bool=true)
 Add integer setting to the application preferences. More...
 
static void addBoolSetting (const QString &, const bool, bool=true)
 Add boolean setting to the application preferences. More...
 
static void addDoubleSetting (const QString &, const double, bool=true)
 Add double setting to the application preferences. More...
 
static void removeSettings (const QString &)
 Remove setting from the application preferences. More...
 
static QString getSetting (const QString &)
 Get application setting value (as string represenation). More...
 
static void removeChild (const QString &=QString())
 
static void startPyLog (const QString &)
 Start recordind a log of Python commands from embedded console. More...
 
static void stopPyLog ()
 Stop recordind a log of Python commands from embedded console. More...
 
static void logUserEvent (const QString &)
 Log GUI event. More...
 
static void logAction (QAction *, const QString &=QString())
 Log given action. More...
 
static void setActionLoggingEnabled (bool)
 Enable/disable action logging. More...
 

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()
The class provides utility functions which can be used in the Python to operate with the SALOME GUI.
Definition: SalomePyQt.h:181
static QWidget * getDesktop()
Get the active application's desktop window.
Definition: SalomePyQt.cxx:504

Member Function Documentation

◆ action()

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

Get action by specified identifier.

Returns
action or 0 if action is not registered

References ProcessEvent().

◆ actionId()

int SalomePyQt::actionId ( const QAction a)
static

Get an action identifier.

Returns
action ID or -1 if action is not registered

References ProcessEvent().

◆ activateModule()

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.

References ProcessEvent().

◆ activateView()

bool SalomePyQt::activateView ( const int  id)
static

Activate view.

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

References ProcessEvent().

◆ activateViewManagerAndView()

bool SalomePyQt::activateViewManagerAndView ( const int  id)
static

References ProcessEvent().

◆ addBoolSetting()

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)

References ProcessVoidEvent(), SUIT_Session::resourceMgr(), SUIT_Session::session(), and QtxResourceMgr::setValue().

◆ addDoubleSetting()

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)

References ProcessVoidEvent(), SUIT_Session::resourceMgr(), SUIT_Session::session(), and QtxResourceMgr::setValue().

◆ addGlobalPreference()

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

Add global (not module-related) preferences group.

Parameters
labelglobal preferences group name
Returns
preferences group identifier

References ProcessEvent().

◆ addIntSetting()

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)

References ProcessVoidEvent(), SUIT_Session::resourceMgr(), SUIT_Session::session(), and QtxResourceMgr::setValue().

◆ addPreference() [1/2]

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

Add module-related preferences group.

Parameters
labelpreferences group name
Returns
preferences group identifier

References ProcessEvent().

◆ addPreference() [2/2]

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

References ProcessEvent().

◆ addPreferenceProperty()

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

References LightApp_Module::getApp(), SUIT_PreferenceMgr::itemProperty(), LightApp_Application::preferences(), ProcessVoidEvent(), and SUIT_PreferenceMgr::setItemProperty().

◆ addSetting() [1/7]

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

References ProcessVoidEvent(), SUIT_Session::resourceMgr(), SUIT_Session::session(), and QtxResourceMgr::setValue().

◆ addSetting() [2/7]

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

References ProcessVoidEvent(), SUIT_Session::resourceMgr(), SUIT_Session::session(), and QtxResourceMgr::setValue().

◆ addSetting() [3/7]

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

References ProcessVoidEvent(), SUIT_Session::resourceMgr(), SUIT_Session::session(), and QtxResourceMgr::setValue().

◆ addSetting() [4/7]

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

Add byte array setting to the application preferences.

Parameters
sectionresources file section name
namesetting name
valuenew setting value

References ProcessVoidEvent(), SUIT_Session::resourceMgr(), SUIT_Session::session(), and QtxResourceMgr::setValue().

◆ addSetting() [5/7]

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

References ProcessVoidEvent(), SUIT_Session::resourceMgr(), SUIT_Session::session(), and QtxResourceMgr::setValue().

◆ addSetting() [6/7]

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

Add font setting to the application preferences.

Parameters
sectionresources file section name
namesetting name
valuenew setting value

References ProcessVoidEvent(), SUIT_Session::resourceMgr(), SUIT_Session::session(), and QtxResourceMgr::setValue().

◆ addSetting() [7/7]

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

References ProcessVoidEvent(), SUIT_Session::resourceMgr(), SUIT_Session::session(), and QtxResourceMgr::setValue().

◆ addStringSetting()

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)

References ProcessVoidEvent(), SUIT_Session::resourceMgr(), SUIT_Session::session(), and QtxResourceMgr::setValue().

◆ boolSetting()

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

References ProcessEvent().

◆ byteArraySetting()

QByteArray SalomePyQt::byteArraySetting ( const QString &  section,
const QString &  name,
const QByteArray &  def = QByteArray() 
)
static

Get byte array 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

References ProcessEvent().

◆ clearMessages()

void SalomePyQt::clearMessages ( )
static

Remove all the messages from the Log messages output window.

References LogWindow::clear(), getApplication(), and ProcessVoidEvent().

◆ clearTool()

void SalomePyQt::clearTool ( const QString &  title)
static

Clear given toolbar.

Parameters
titletoolbar's title

References SUIT_Application::clearTool(), getApplication(), and ProcessVoidEvent().

◆ cloneView()

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

References ProcessEvent().

◆ closeView()

bool SalomePyQt::closeView ( const int  id)
static

Close view.

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

References ProcessEvent().

◆ colorSetting()

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

References ProcessEvent().

◆ constant()

QString SalomePyQt::constant ( const QString &  name)
static

Get constant's value from application's resource manager.

Parameters
namename of the constant
Returns
value of the constant
See also
setConstant()

References ProcessEvent().

◆ createAction()

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

References ProcessEvent().

◆ createActionGroup()

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

References ProcessEvent().

◆ createMenu() [1/6]

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

References ProcessEvent().

◆ createMenu() [2/6]

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

References ProcessEvent().

◆ createMenu() [3/6]

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

References ProcessEvent().

◆ createMenu() [4/6]

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

References ProcessEvent().

◆ createMenu() [5/6]

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

References ProcessEvent().

◆ createMenu() [6/6]

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

References ProcessEvent().

◆ createObject() [1/2]

QString SalomePyQt::createObject ( const QString &  name,
const QString &  icon,
const QString &  tooltip,
const QString &  parent = QString() 
)
static

Create new data object with specified name, icon and tooltip.

Parameters
namedata object name
icondata object icon
toolTipdata object tooltip
parententry of parent data object
Returns
entry of created data object

References ProcessEvent().

◆ createObject() [2/2]

QString SalomePyQt::createObject ( const QString &  parent = QString())
static

Create empty data object.

Parameters
parententry of parent data object
Returns
entry of created data object

References ProcessEvent().

◆ createRoot()

void SalomePyQt::createRoot ( )
static

Initialize root data object.

Does nothing if root is already initialized.

References CAM_Module::dataModel(), SALOME_PYQT_DataModelLight::getRoot(), and ProcessVoidEvent().

◆ createSeparator()

QAction * SalomePyQt::createSeparator ( )
static

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

Returns
new separator action

References ProcessEvent().

◆ createTool() [1/5]

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

References ProcessEvent().

◆ createTool() [2/5]

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

References ProcessEvent().

◆ createTool() [3/5]

int SalomePyQt::createTool ( const QString &  tBar,
const QString &  nBar = QString() 
)
static

Create toolbar with specified name.

Parameters
tBartoolbar title (language-dependent)
nBartoolbar name (language-independent) [optional]
Returns
toolbar ID or -1 if toolbar creation is failed

References ProcessEvent().

◆ createTool() [4/5]

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

References ProcessEvent().

◆ createTool() [5/5]

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

References ProcessEvent().

◆ createView() [1/2]

int SalomePyQt::createView ( const QString &  type,
bool  visible = true,
const int  width = 0,
const int  height = 0,
bool  detached = false 
)
static

References ProcessEvent().

◆ createView() [2/2]

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)

References ProcessEvent().

◆ defaultMenuGroup()

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

References ProcessEvent().

◆ disableSelector()

void SalomePyQt::disableSelector ( )
static

disable PyQt_Selector (on module activation, for instance)

References ProcessVoidEvent().

◆ displayCurve()

void SalomePyQt::displayCurve ( const int  id,
Plot2d_Curve theCurve 
)
static

Display theCurve in view.

Parameters
idwindow identifier
theCurvecurve to display

References ProcessVoidEvent().

◆ doubleSetting()

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

References ProcessEvent().

◆ dumpView()

bool SalomePyQt::dumpView ( const QString &  filename,
const int  id = 0 
)
static

Dump the contents of the id view window. If id is 0 then current active view is processed. 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)

References ProcessEvent().

◆ enableSelector()

void SalomePyQt::enableSelector ( )
static

enable PyQt_Selector (on module activation, for instance)

References ProcessVoidEvent().

◆ eraseCurve() [1/2]

void SalomePyQt::eraseCurve ( const int  id,
Plot2d_Curve theCurve 
)
static

Erase theCurve in view.

Parameters
idwindow identifier
theCurvecurve to erase

References ProcessVoidEvent().

◆ eraseCurve() [2/2]

void SalomePyQt::eraseCurve ( Plot2d_Curve theCurve)
static

References ProcessVoidEvent().

◆ findViews()

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

References ProcessEvent().

◆ fontSetting()

QFont SalomePyQt::fontSetting ( const QString &  section,
const QString &  name,
const QFont &  def = QFont() 
)
static

Get font 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

References ProcessEvent().

◆ getActiveComponent()

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

References ProcessEvent().

◆ getActivePythonModule()

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

References ProcessEvent().

◆ getActiveView()

int SalomePyQt::getActiveView ( )
static

Get integer identifier of the currently active view.

Returns
integer identifier of the currently active view

References ProcessEvent().

◆ getAppName()

QString SalomePyQt::getAppName ( )
static

Get application name.

Returns
application name

References getApplication().

◆ getChildren()

QStringList SalomePyQt::getChildren ( const QString &  entry = QString(),
const bool  recursive = false 
)
static

Get entries of all child data objects of specified data object.

Parameters
entrydata object entry
recursivetrue for recursive processing

References ProcessEvent().

◆ getColor()

QColor SalomePyQt::getColor ( const QString &  entry)
static

Get data object color.

Parameters
entrydata object entry
Returns
data object color

References ProcessEvent().

◆ getComponents()

QStringList SalomePyQt::getComponents ( )
static

Get all modules used in current GUI session.

Returns
List of modules

References ProcessEvent().

◆ getDesktop()

QWidget * SalomePyQt::getDesktop ( )
static

Get the active application's desktop window.

Returns
desktop window or 0 if there is no any

References ProcessEvent().

◆ getExistingDirectory()

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)

References ProcessEvent().

◆ getFileName()

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)

References ProcessEvent().

◆ getMainFrame()

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)

References ProcessEvent().

◆ getMainMenuBar()

QMenuBar * SalomePyQt::getMainMenuBar ( )
static

Get current application desktop's main menu.

Returns
main menu object (0 on any error)

References ProcessEvent().

◆ getName()

QString SalomePyQt::getName ( const QString &  entry)
static

Get data object name.

Parameters
entrydata object entry
Returns
data object name

References ProcessEvent().

◆ getObjectBrowser()

QTreeView * SalomePyQt::getObjectBrowser ( )
static

Get object browser.

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

References ProcessEvent().

◆ getObjectPosition()

int SalomePyQt::getObjectPosition ( const QString &  theEntry)
static

Get position of given object in the tree.

Parameters
theEntrystudy ID of the object
Returns
position

References ProcessEvent().

◆ getOpenFileNames()

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)

References ProcessEvent().

◆ getPlot2dFitRangeByCurves()

QList< double > SalomePyQt::getPlot2dFitRangeByCurves ( const int  id)
static

Get list of Plot2d view ranges.

Parameters
idwindow identifier
Returns
list of view ranges (XMin, XMax, YMin, YMax)

References ProcessEvent().

◆ getPlot2dFitRangeCurrent()

QList< double > SalomePyQt::getPlot2dFitRangeCurrent ( const int  id)
static

Get list of current Plot2d view ranges.

Parameters
idwindow identifier
Returns
list of view ranges (XMin, XMax, YMin, YMax)

References ProcessEvent().

◆ getPlot2dTitle()

QString SalomePyQt::getPlot2dTitle ( const int  id,
ObjectType  type = MainTitle 
)
static

Get title of corresponding type.

Parameters
idwindow identifier
typeis type of title
Returns
title of corresponding type

References ProcessEvent().

◆ getPopupMenu() [1/2]

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

References Edit, File, Help, Preferences, ProcessEvent(), Tools, View, and Window.

◆ getPopupMenu() [2/2]

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)

References ProcessEvent().

◆ getReference()

QString SalomePyQt::getReference ( const QString &  entry)
static

References ProcessEvent().

◆ getSelection()

SALOME_Selection * SalomePyQt::getSelection ( )
static

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)

References ProcessEvent().

◆ getSetting()

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)

References ProcessEvent().

◆ getToolTip()

QString SalomePyQt::getToolTip ( const QString &  entry)
static

Get data object tooltip.

Parameters
entrydata object entry
Returns
data object tooltip

References ProcessEvent().

◆ getViews()

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

References ProcessEvent().

◆ getViewTitle()

QString SalomePyQt::getViewTitle ( const int  id)
static

Get view caption

Parameters
idwindow identifier
Returns
view caption

References ProcessEvent().

◆ getViewType()

QString SalomePyQt::getViewType ( const int  id)
static

Get type of the specified view, e.g. "OCCViewer".

Parameters
idwindow identifier
Returns
view type

References ProcessEvent().

◆ getViewWidget()

QWidget * SalomePyQt::getViewWidget ( const int  id)
static

References ProcessEvent().

◆ getVisibilityState()

VisibilityState SalomePyQt::getVisibilityState ( const QString &  theEntry)
static

Get visibility state for given object.

Parameters
theEntrystudy ID of the object
Returns
visibility state

References ProcessEvent().

◆ groupAllViews()

bool SalomePyQt::groupAllViews ( )
static

Group all views to the single tab area.

Returns
true if operation is completed successfully and false otherwise

References ProcessEvent().

◆ hasSetting()

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

References ProcessEvent().

◆ helpContext()

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)

References getApplication(), and ProcessVoidEvent().

◆ hideNotification() [1/2]

void SalomePyQt::hideNotification ( const int  id)
static

Remove notification with given id from the application's desktop.

Parameters
idnotification id
See also
showNotification()

References ProcessVoidEvent().

◆ hideNotification() [2/2]

void SalomePyQt::hideNotification ( const QString &  msg)
static

Remove notification with given message text from the application's desktop.

Parameters
msgmessage text
See also
showNotification()

References ProcessVoidEvent().

◆ infoAddAction()

int SalomePyQt::infoAddAction ( QAction action,
const int  groupId = -1 
)
static

Insert action button into the Help panel.

Parameters
actionAction being added
groupIdParent group's identifier (defaults to -1 for top-level group)
Returns
Action's identifier

References action(), and ProcessEvent().

◆ infoAddGroup()

int SalomePyQt::infoAddGroup ( const QString &  text,
const int  groupId = -1 
)
static

Create a (sub-)group in the Help panel.

Parameters
textGroup title
groupIdParent group's identifier (defaults to -1 for top-level group)
Returns
Group's identifier

References ProcessEvent().

◆ infoAddLabel() [1/2]

int SalomePyQt::infoAddLabel ( const QString &  text,
const int  groupId = -1 
)
static

Insert left-aligned text label into the Help panel.

Parameters
textLabel text
groupIdParent group's identifier (defaults to -1 for top-level group)
Returns
Label's identifier

References ProcessEvent().

◆ infoAddLabel() [2/2]

int SalomePyQt::infoAddLabel ( const QString &  text,
Qt::Alignment  alignment,
const int  groupId = -1 
)
static

Insert text label into the Help panel.

Parameters
textLabel text
alignmentAlignment flag for text label
groupIdParent group's identifier (defaults to -1 for top-level group)
Returns
Label's identifier

References ProcessEvent().

◆ infoClear()

void SalomePyQt::infoClear ( const int  groupId = -1)
static

Clear Help panel's contents.

Parameters
groupIdGroup's identifier (default is -1, to clear whole panel)

References QtxInfoPanel::clear(), getApplication(), and ProcessVoidEvent().

◆ infoRemove()

void SalomePyQt::infoRemove ( const int  id)
static

Remove item from the Help panel.

Parameters
idItem's (label's, action's, group's, ...) identifier

References getApplication(), ProcessVoidEvent(), and QtxInfoPanel::remove().

◆ infoSetEnabled()

void SalomePyQt::infoSetEnabled ( const int  id,
bool  enabled 
)
static

Enable/disable item in the Help panel.

Parameters
idItem's (label's, action's, group's, ...) identifier
enabledEnabled state

References getApplication(), ProcessVoidEvent(), and QtxInfoPanel::setEnabled().

◆ infoSetTitle()

void SalomePyQt::infoSetTitle ( const QString &  title)
static

Set the title to the Help panel.

Parameters
titleTitle text (empty string removes title)

References getApplication(), ProcessVoidEvent(), and QtxInfoPanel::setTitle().

◆ infoSetVisible()

void SalomePyQt::infoSetVisible ( const int  id,
bool  visible 
)
static

Set item's visibility in the Help panel.

Parameters
idItem's (label's, action's, group's, ...) identifier
visibleVisibility flag

References getApplication(), ProcessVoidEvent(), and QtxInfoPanel::setVisible().

◆ integerSetting()

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

References ProcessEvent().

◆ isLightApp()

bool SalomePyQt::isLightApp ( )
static

Check if SALOME GUI is running in "light" mode.

Returns
true if this is a "light" application; false otherwise

References getAppName().

◆ isModified()

bool SalomePyQt::isModified ( )
static

References ProcessEvent().

◆ isViewClosable()

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

References ProcessEvent().

◆ isViewVisible()

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

References ProcessEvent().

◆ loadIcon()

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

References ProcessEvent().

◆ logAction()

void SalomePyQt::logAction ( QAction action,
const QString &  moduleName = QString() 
)
static

Log given action.

Parameters
actionGUI action being logged.
moduleNameoptional name of module, owning an action

References action(), CAM_Application::logAction(), and ProcessVoidEvent().

◆ logUserEvent()

void SalomePyQt::logUserEvent ( const QString &  eventDescription)
static

Log GUI event.

Parameters
eventDescriptionGUI event description.

References CAM_Application::logUserEvent(), and ProcessVoidEvent().

◆ message()

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

References getApplication(), ProcessVoidEvent(), and LogWindow::putMessage().

◆ moveView()

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

References ProcessEvent().

◆ neighbourViews()

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

References ProcessEvent().

◆ parameters() [1/2]

QStringList SalomePyQt::parameters ( const QString &  section)
static

Get names of preference items stored within the given section.

Parameters
sectionresources file section's name
Returns
list of preferences items

References ProcessEvent().

◆ parameters() [2/2]

QStringList SalomePyQt::parameters ( const QStringList &  section)
static

Get names of preference items stored within the given section.

Parameters
sectionresources file section's name
Returns
list of preferences items

References ProcessEvent().

◆ preferenceProperty()

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

References ProcessEvent().

◆ processEvents()

void SalomePyQt::processEvents ( )
static

Process Qt event loop.

◆ putInfo()

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

References ProcessVoidEvent().

◆ registerModule()

void SalomePyQt::registerModule ( const QString &  modName)
static

Registers module in the study tree.

References getApplication(), and ProcessVoidEvent().

◆ removeChild()

void SalomePyQt::removeChild ( const QString &  entry = QString())
static

References removeChildren().

◆ removeChildren()

void SalomePyQt::removeChildren ( const QString &  entry = QString())
static

Remove all child data objects from specified data object.

Parameters
entrydata object entry

References ProcessVoidEvent().

◆ removeObject()

void SalomePyQt::removeObject ( const QString &  entry)
static

Remove object by entry.

Parameters
entrydata object entry

References ProcessVoidEvent().

◆ removeSetting()

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

Remove setting from the application preferences.

Parameters
sectionresources file section name
namesetting name

References ProcessVoidEvent(), QtxResourceMgr::remove(), SUIT_Session::resourceMgr(), and SUIT_Session::session().

◆ removeSettings()

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)

References ProcessVoidEvent(), QtxResourceMgr::remove(), SUIT_Session::resourceMgr(), and SUIT_Session::session().

◆ setActionLoggingEnabled()

void SalomePyQt::setActionLoggingEnabled ( bool  enabled)
static

Enable/disable action logging.

References ProcessVoidEvent(), and CAM_Module::setActionLoggingEnabled().

◆ setColor()

void SalomePyQt::setColor ( const QString &  entry,
const QColor &  color 
)
static

Set data object color.

Parameters
entrydata object entry
colordata object color

References OCCViewer::color(), and ProcessVoidEvent().

◆ setConstant()

void SalomePyQt::setConstant ( const QString &  name,
const QString &  value 
)
static

Add constant to the application's resource manager.

This function is useful to specify programmatically specific variables that are referenced in the resource setting.

For example, some resource value can be set as "$(myroot)/data/files". Then, "mypath" constant can be set programmatically by the application depending on run-time requirements.

Parameters
sectionresources file section name
namename of the constant
valuevalue of the constant
See also
constant()

References ProcessVoidEvent(), SUIT_Session::resourceMgr(), SUIT_Session::session(), and QtxResourceMgr::setConstant().

◆ setIcon()

void SalomePyQt::setIcon ( const QString &  entry,
const QString &  icon 
)
static

Set data object icon.

Parameters
entrydata object entry
icondata object icon file name (icon is loaded from module resources)

References ProcessVoidEvent().

◆ setModified()

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.

Note
This function is supported for "light" Python-based SALOME modules only.
Parameters
Newmodification status of the data model
See also
isModified()

References CAM_Module::dataModel(), LightApp_Module::getApp(), ProcessVoidEvent(), SALOME_PYQT_DataModelLight::setModified(), and LightApp_Application::updateActions().

◆ setName()

void SalomePyQt::setName ( const QString &  entry,
const QString &  name 
)
static

Set data object name.

Parameters
entrydata object entry
namedata object name

References ProcessVoidEvent().

◆ setObjectPosition()

void SalomePyQt::setObjectPosition ( const QString &  theEntry,
int  thePos 
)
static

Set position of given object in the tree.

Parameters
theEntrystudy ID of the object
thePosposition

References ProcessVoidEvent(), and SALOME_PYQT_ModuleLight::setObjectPosition().

◆ setPlot2dFitRange()

void SalomePyQt::setPlot2dFitRange ( const int  id,
const double  XMin,
const double  XMax,
const double  YMin,
const double  YMax 
)
static

Set range of Plot2d view.

Parameters
idwindow identifier
XMin
XMax
YMin
YMax

References ProcessVoidEvent().

◆ setPlot2dTitle()

void SalomePyQt::setPlot2dTitle ( const int  id,
const QString &  title,
ObjectType  type = MainTitle,
bool  show = true 
)
static

Set title of corresponding type.

Parameters
idwindow identifier
title
typeis type of title
show

References ProcessVoidEvent().

◆ setPreferenceProperty()

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

References LightApp_Module::getApp(), LightApp_Application::preferences(), ProcessVoidEvent(), and SUIT_PreferenceMgr::setItemProperty().

◆ setPreferencePropertyWg()

void SalomePyQt::setPreferencePropertyWg ( const int  id,
const QString &  prop,
UserDefinedContent widget 
)
static

Set specific widget as a custom preferences item.

Parameters
idpreferences identifier
proppreferences property name
widgetcustom widget

References LightApp_Module::getApp(), LightApp_Application::preferences(), ProcessVoidEvent(), and SUIT_PreferenceMgr::setItemProperty().

◆ setReference()

void SalomePyQt::setReference ( const QString &  entry,
const QString &  refEntry 
)
static

Set reference to another data object.

Parameters
entrydata object entry
refEntryreferenced data object entry

References ProcessVoidEvent().

◆ setSelection()

void SalomePyQt::setSelection ( const QStringList &  entryList)
static

Send local selection for notification.

The list of locally selected objects (study entries) is sent for notification of other listening entities (modules, viewers...).

References ProcessVoidEvent().

◆ setToolTip()

void SalomePyQt::setToolTip ( const QString &  entry,
const QString &  toolTip 
)
static

Set data object tooltip.

Parameters
entrydata object entry
toolTipdata object tooltip

References ProcessVoidEvent().

◆ setViewClosable()

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

References ProcessVoidEvent(), and SUIT_ViewWindow::setClosable().

◆ setViewRotationPoint()

bool SalomePyQt::setViewRotationPoint ( const double  x,
const double  y,
const double  z,
const int  id = 0 
)
static

Set view rotation point.

Parameters
xcoordinate X view rotation point
ycoordinate Y view rotation point
zcoordinate Z view rotation point
idwindow identifier
Returns
true if operation is completed successfully and false otherwise

References ProcessEvent().

◆ setViewSize()

bool SalomePyQt::setViewSize ( const int  w,
const int  h,
const int  id = 0 
)
static

Set view size.

Parameters
wwindow width
hwindow height
idwindow identifier
Returns
true if operation is completed successfully and false otherwise

References ProcessEvent().

◆ setViewTitle()

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

References ProcessEvent().

◆ setViewVisible()

void SalomePyQt::setViewVisible ( const int  id,
bool  visible = true 
)
static

Set view visibility.

Parameters
idwindow identifier
visiblenew visiblity

References ProcessVoidEvent(), and SUIT_ViewWindow::setVisible().

◆ setVisibilityState()

void SalomePyQt::setVisibilityState ( const QString &  theEntry,
VisibilityState  theState 
)
static

Set visibility state for given object.

Parameters
theEntrystudy ID of the object
theStatevisibility state

References getActiveStudy(), ProcessVoidEvent(), and LightApp_Study::setVisibilityState().

◆ showNotification()

int SalomePyQt::showNotification ( const QString &  msg,
const QString &  title,
const int  sec = -1 
)
static

Show notification in the application's desktop window.

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

Notification can be forcibly hidden via hideNotification() method.

Parameters
msgmessage text
titletitle text
secnotification displaying time in seconds
Returns
unique ID of the notification (can be used to hide notification)
See also
hideNotification()

References ProcessEvent().

◆ splitView()

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

References action(), and ProcessEvent().

◆ startPyLog()

void SalomePyQt::startPyLog ( const QString &  theFileName)
static

Start recordind a log of Python commands from embedded console.

Parameters
theFileNameoutput lof file name

References getApplication(), ProcessVoidEvent(), and LightApp_Application::pythonConsole().

◆ stopPyLog()

void SalomePyQt::stopPyLog ( )
static

Stop recordind a log of Python commands from embedded console.

References getApplication(), ProcessVoidEvent(), and LightApp_Application::pythonConsole().

◆ stringSetting()

QString SalomePyQt::stringSetting ( const QString &  section,
const QString &  name,
const QString &  def = QString(""),
const bool  subst = true 
)
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
substtrue to make substitution, false to get "raw" value
Returns
setting value

References ProcessEvent().

◆ updateCurves()

void SalomePyQt::updateCurves ( const int  id)
static

updateCurves (repaint) curves in view window.

References Plot2d_ViewFrame::DisplayAll(), Plot2d_ViewWindow::getViewFrame(), and ProcessVoidEvent().

◆ updateObjBrowser()

void SalomePyQt::updateObjBrowser ( )
static

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