6 SalomePyQt.WT_ObjectBrowser : "objectBrowserDock",
7 SalomePyQt.WT_PyConsole : "pythonConsoleDock",
8 SalomePyQt.WT_LogWindow : "logWindowDock",
9 SalomePyQt.WT_NoteBook : "noteBookDock",
12 def findDockWidgetByTitle( title ):
14 Find and return dock widget by its window title.
15 Returns None if dock widget does not exist or is not created yet.
17 WARNING: this function is language-dependant as the title of the
18 dock widget is normally internationalized according to the currently
23 findDockWidgetByTitle( "Object Browser" )
25 sg = SalomePyQt.SalomePyQt()
26 dwl = sg.getDesktop().findChildren( QDockWidget )
27 dw = filter(lambda a: a.windowTitle() == str( title ), dwl)
31 def findDockWidgetByName( dwName ):
33 Find and return dock widget by its internal name
34 Returns None if dock widget does not exist or is not created yet
36 Note: this function is language-independant: internal name
37 of the dock widget does not depend on the currently used language.
41 findDockWidgetByName( "objectBrowserDock" )
43 sg = SalomePyQt.SalomePyQt()
44 return sg.getDesktop().findChild( QDockWidget, dwName )
46 def findDockWidgetById( dwId ):
48 Find and return dock widget by its id
49 Returns None if dock widget does not exist or is not created yet
51 WARNING: this function works only with dock widget ids
52 specified in SalomePyQt interface.
56 findDockWidgetById( SalomePyQt.WT_ObjectBrowser )
59 return findDockWidgetByName( _dockWidgetNames[ dwId ] )
64 def getAllDockWindows():
68 WARNING: this function searches all dock widgets starting from the
69 top-level main window; thus, resulting list contains also dock windows
70 that belong to the lower-level windows (e.g. view windows).
72 sg = SalomePyQt.SalomePyQt()
73 return sg.getDesktop().findChildren( QDockWidget )
75 def tabifyDockWidgets( dw1, dw2 ):
77 Tabify two dock widgets.
79 sg = SalomePyQt.SalomePyQt()
80 if dw1 and dw2: sg.getDesktop().tabifyDockWidget( dw1, dw2 )