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

Static Public Member Functions

static QWidgetgetDesktop ()
 Get the active application's desktop window.
static QWidgetgetMainFrame ()
 Get current application's main frame widget [obsolete].
static QMenuBar * getMainMenuBar ()
 Get current application desktop's main menu.
static QMenugetPopupMenu (const MenuName)
 Get main menu's child popup submenu by its identifier.
static QMenugetPopupMenu (const QString &)
 Get main menu's child popup submenu by its name.
static QTreeViewgetObjectBrowser ()
 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 void updateObjBrowser (const int=0, bool=true)
 Update an Object Browser of the specified (by identifier) study.
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 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 QActioncreateSeparator ()
 Create separator action which can be used in the menu or toolbar.
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.
static QtxActionGroupcreateActionGroup (const int, const bool=true)
 Create an action group which can be then used in the menu or toolbar.
static QActionaction (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. "OCCViewer".
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. it is on the top of the views stack)
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).
static bool isViewClosable (const int)
 Check whether view is closable (i.e. can be closed by the user)
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

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

Member Function Documentation

QWidget * SalomePyQt::getDesktop ( ) [static]
Returns:
desktop window or 0 if there is no any

References ProcessEvent().

QWidget * SalomePyQt::getMainFrame ( ) [static]

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

Returns:
workspace widget (0 on any error)

References ProcessEvent().

QMenuBar * SalomePyQt::getMainMenuBar ( ) [static]
Returns:
main menu object (0 on any error)

References ProcessEvent().

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

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, getMenuName(), Help, Preferences, ProcessEvent(), Tools, View, and Window.

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

The function creates menu if it does not exist.

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

References ProcessEvent().

QTreeView * SalomePyQt::getObjectBrowser ( ) [static]
Returns:
object browser for the active study or 0 in case of error

References ProcessEvent().

SALOME_Selection * SalomePyQt::getSelection ( ) [static]

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

Returns:
selection object (0 on error)

References ProcessEvent().

int SalomePyQt::getStudyId ( ) [static]
Returns:
active study ID or 0 if there is no active study

References ProcessEvent().

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

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

const QString SalomePyQt::getActiveComponent ( ) [static]
Returns:
active module name or empty string if there is no active module

References ProcessEvent().

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

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

References SUIT_Application.activeStudy(), SUIT_Session.applications(), getActiveStudy(), SUIT_Study.id(), PyInterp.myStudyId, ProcessVoidEvent(), SUIT_Session.session(), and LightApp_Application.updateObjectBrowser().

QString SalomePyQt::getFileName ( QWidget parent,
const QString &  initial,
const QStringList &  filters,
const QString &  caption,
bool  open 
) [static]
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().

QStringList SalomePyQt::getOpenFileNames ( QWidget parent,
const QString &  initial,
const QStringList &  filters,
const QString &  caption 
) [static]
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().

QString SalomePyQt::getExistingDirectory ( QWidget parent,
const QString &  initial,
const QString &  caption 
) [static]
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().

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

References ProcessEvent().

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

References ProcessEvent().

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

References ProcessVoidEvent().

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

References ProcessVoidEvent().

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

References ProcessEvent().

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

References ProcessVoidEvent().

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

References ProcessVoidEvent().

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

References ProcessVoidEvent().

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

References ProcessEvent().

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

References ProcessEvent().

QIcon SalomePyQt::loadIcon ( const QString &  module,
const QString &  filename 
) [static]
Parameters:
filenameicon file name
Returns:
icon object

References ProcessEvent().

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

Current implementation does nothing.

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

References getApplication(), and ProcessVoidEvent().

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

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

int SalomePyQt::defaultMenuGroup ( ) [static]
Returns:
default menu group ID

References ProcessEvent().

int SalomePyQt::createTool ( const QString &  tBar) [static]
Parameters:
tBartoolbar name
Returns:
toolbar ID or -1 if toolbar creation is failed

References ProcessEvent().

int SalomePyQt::createTool ( const int  id,
const int  tBar,
const int  idx = -1 
) [static]
Parameters:
idaction ID
tBartoolbar ID
idxrequired index in the toolbar
Returns:
action ID or -1 if action could not be added

References ProcessEvent().

int SalomePyQt::createTool ( const int  id,
const QString &  tBar,
const int  idx = -1 
) [static]
Parameters:
idaction ID
tBartoolbar name
idxrequired index in the toolbar
Returns:
action ID or -1 if action could not be added

References ProcessEvent().

int SalomePyQt::createTool ( QAction a,
const int  tBar,
const int  id = -1,
const int  idx = -1 
) [static]
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().

int SalomePyQt::createTool ( QAction a,
const QString &  tBar,
const int  id = -1,
const int  idx = -1 
) [static]
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().

int SalomePyQt::createMenu ( const QString &  subMenu,
const int  menu = -1,
const int  id = -1,
const int  group = -1,
const int  idx = -1 
) [static]
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().

int SalomePyQt::createMenu ( const QString &  subMenu,
const QString &  menu = QString(),
const int  id = -1,
const int  group = -1,
const int  idx = -1 
) [static]
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().

int SalomePyQt::createMenu ( const int  id,
const int  menu = -1,
const int  group = -1,
const int  idx = -1 
) [static]
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().

int SalomePyQt::createMenu ( const int  id,
const QString &  menu = QString(),
const int  group = -1,
const int  idx = -1 
) [static]
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().

int SalomePyQt::createMenu ( QAction a,
const int  menu,
const int  id = -1,
const int  group = -1,
const int  idx = -1 
) [static]
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().

int SalomePyQt::createMenu ( QAction a,
const QString &  menu,
const int  id = -1,
const int  group = -1,
const int  idx = -1 
) [static]
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().

QAction * SalomePyQt::createSeparator ( ) [static]
Returns:
new separator action

References ProcessEvent().

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

QtxActionGroup * SalomePyQt::createActionGroup ( const int  id,
const bool  exclusive = true 
) [static]
Parameters:
id: the unique id action group to be registered to
exclusive: if true the action group does exclusive toggling

References ProcessEvent().

QAction * SalomePyQt::action ( const int  id) [static]
Returns:
action or 0 if action is not registered

References ProcessEvent().

int SalomePyQt::actionId ( const QAction a) [static]
Returns:
action ID or -1 if action is not registered

References ProcessEvent().

void SalomePyQt::addSetting ( const QString &  section,
const QString &  name,
const double  value 
) [static]
Parameters:
sectionresources file section name
namesetting name
valuenew setting value

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

void SalomePyQt::addSetting ( const QString &  section,
const QString &  name,
const int  value 
) [static]
Parameters:
sectionresources file section name
namesetting name
valuenew setting value

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

void SalomePyQt::addSetting ( const QString &  section,
const QString &  name,
const bool  value,
const int   
) [static]
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().

void SalomePyQt::addSetting ( const QString &  section,
const QString &  name,
const QString &  value 
) [static]
Parameters:
sectionresources file section name
namesetting name
valuenew setting value

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

void SalomePyQt::addSetting ( const QString &  section,
const QString &  name,
const QColor &  value 
) [static]
Parameters:
sectionresources file section name
namesetting name
valuenew setting value

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

int SalomePyQt::integerSetting ( const QString &  section,
const QString &  name,
const int  def = 0 
) [static]
Parameters:
sectionresources file section name
namesetting name
defdefault value which is returned if the setting is not found
Returns:
setting value

References ProcessEvent().

double SalomePyQt::doubleSetting ( const QString &  section,
const QString &  name,
const double  def = 0 
) [static]
Parameters:
sectionresources file section name
namesetting name
defdefault value which is returned if the setting is not found
Returns:
setting value

References ProcessEvent().

bool SalomePyQt::boolSetting ( const QString &  section,
const QString &  name,
const bool  def = 0 
) [static]
Parameters:
sectionresources file section name
namesetting name
defdefault value which is returned if the setting is not found
Returns:
setting value

References ProcessEvent().

QString SalomePyQt::stringSetting ( const QString &  section,
const QString &  name,
const QString &  def = QString("") 
) [static]
Parameters:
sectionresources file section name
namesetting name
defdefault value which is returned if the setting is not found
Returns:
setting value

References ProcessEvent().

QColor SalomePyQt::colorSetting ( const QString &  section,
const QString &  name,
const QColor &  def = QColor() 
) [static]
Parameters:
sectionresources file section name
namesetting name
defdefault value which is returned if the setting is not found
Returns:
setting value

References ProcessEvent().

void SalomePyQt::removeSetting ( const QString &  section,
const QString &  name 
) [static]
Parameters:
sectionresources file section name
namesetting name

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

bool SalomePyQt::hasSetting ( const QString &  section,
const QString &  name 
) [static]
Parameters:
sectionresources file section name
namesetting name
Returns:
true if setting exists

References ProcessEvent().

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

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 DEFAULT_SECTION, ProcessVoidEvent(), SUIT_Session.resourceMgr(), SUIT_Session.session(), and QtxResourceMgr.setValue().

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

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 DEFAULT_SECTION, ProcessVoidEvent(), SUIT_Session.resourceMgr(), SUIT_Session.session(), and QtxResourceMgr.setValue().

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

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 DEFAULT_SECTION, ProcessVoidEvent(), SUIT_Session.resourceMgr(), SUIT_Session.session(), and QtxResourceMgr.setValue().

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

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 DEFAULT_SECTION, ProcessVoidEvent(), SUIT_Session.resourceMgr(), SUIT_Session.session(), and QtxResourceMgr.setValue().

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

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 DEFAULT_SECTION, ProcessVoidEvent(), QtxResourceMgr.remove(), SUIT_Session.resourceMgr(), and SUIT_Session.session().

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

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

int SalomePyQt::addGlobalPreference ( const QString &  label) [static]
Parameters:
labelglobal preferences group name
Returns:
preferences group identifier

References ProcessEvent().

int SalomePyQt::addPreference ( const QString &  label) [static]
Parameters:
labelpreferences group name
Returns:
preferences group identifier

References ProcessEvent().

int SalomePyQt::addPreference ( const QString &  label,
const int  pId,
const int  type = PT_Auto,
const QString &  section = QString(),
const QString &  param = QString() 
) [static]
Parameters:
labelpreferences group name
pIdparent preferences group id
typepreferences type
sectionresources file section name
paramresources file setting name
Returns:
preferences identifier

References ProcessEvent().

QVariant SalomePyQt::preferenceProperty ( const int  id,
const QString &  prop 
) [static]
Parameters:
idpreferences identifier
proppreferences property name
Returns:
preferences property value or null QVariant if property is not set

References ProcessEvent().

void SalomePyQt::setPreferenceProperty ( const int  id,
const QString &  prop,
const QVariant &  var 
) [static]
Parameters:
idpreferences identifier
proppreferences property name
varpreferences property value

References getActiveModule(), ProcessVoidEvent(), and SALOME_PYQT_ModuleLight.setPreferenceProperty().

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

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 getActiveModule(), SALOME_PYQT_ModuleLight.preferenceProperty(), ProcessVoidEvent(), and SALOME_PYQT_ModuleLight.setPreferenceProperty().

void SalomePyQt::message ( const QString &  msg,
bool  addSeparator = true 
) [static]
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().

void SalomePyQt::clearMessages ( ) [static]
QList< int > SalomePyQt::getViews ( ) [static]
Returns:
list of integer identifiers of all the currently opened views

References ProcessEvent().

int SalomePyQt::getActiveView ( ) [static]
Returns:
integer identifier of the currently active view

References ProcessEvent().

QString SalomePyQt::getViewType ( const int  id) [static]
Parameters:
idwindow identifier
Returns:
view type

References ProcessEvent().

bool SalomePyQt::setViewTitle ( const int  id,
const QString &  title 
) [static]
Parameters:
idwindow identifier
titlenew window title
Returns:
true if operation is completed successfully and false otherwise

References ProcessEvent().

QString SalomePyQt::getViewTitle ( const int  id) [static]
Parameters:
idwindow identifier
Returns:
view caption

References ProcessEvent().

QList< int > SalomePyQt::findViews ( const QString &  type) [static]
Parameters:
typeviewer type
Returns:
list of integer identifiers

References ProcessEvent().

bool SalomePyQt::activateView ( const int  id) [static]
Parameters:
idwindow identifier
Returns:
true if operation is completed successfully and false otherwise

References ProcessEvent().

int SalomePyQt::createView ( const QString &  type) [static]
Parameters:
typeviewer type
Returns:
integer identifier of created view (or -1 if view could not be created)

References ProcessEvent().

int SalomePyQt::createView ( const QString &  type,
QWidget w 
) [static]
Parameters:
typeviewer type
wcustom widget
Returns:
integer identifier of created view (or -1 if view could not be created)

References ProcessEvent().

bool SalomePyQt::closeView ( const int  id) [static]
Parameters:
idwindow identifier
Returns:
true if operation is completed successfully and false otherwise

References ProcessEvent().

int SalomePyQt::cloneView ( const int  id) [static]
Parameters:
idwindow identifier
Returns:
integer identifier of the cloned view or -1 or operation could not be performed

References ProcessEvent().

bool SalomePyQt::isViewVisible ( const int  id) [static]
Parameters:
idwindow identifier
Returns:
true if view is visible and false otherwise

References ProcessEvent().

void SalomePyQt::setViewClosable ( const int  id,
const bool  on 
) [static]
Parameters:
idwindow identifier
onnew "closable" option's value

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

bool SalomePyQt::isViewClosable ( const int  id) [static]
Parameters:
idwindow identifier
Returns:
true if view is closable or false otherwise

References ProcessEvent().

bool SalomePyQt::groupAllViews ( ) [static]
Returns:
true if operation is completed successfully and false otherwise

References ProcessEvent().

bool SalomePyQt::splitView ( const int  id,
const Orientation  ori,
const Action  action 
) [static]
Parameters:
idwindow identifier
oriorientation of split operation
actionaction to be performed
Returns:
true if operation is completed successfully false otherwise

References ProcessEvent().

bool SalomePyQt::moveView ( const int  id,
const int  id_to,
const bool  before 
) [static]
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().

QList< int > SalomePyQt::neighbourViews ( const int  id) [static]
Parameters:
idwindow identifier
Returns:
list of views identifiers

References ProcessEvent().

Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS