1 from PyQt4.QtCore import *
2 from PyQt4.QtGui import *
7 SalomePyQt.WT_ObjectBrowser : "objectBrowserDock",
8 SalomePyQt.WT_PyConsole : "pythonConsoleDock",
9 SalomePyQt.WT_LogWindow : "logWindowDock",
10 SalomePyQt.WT_NoteBook : "noteBookDock",
13 def findDockWidgetByTitle( title ):
15 Find and return dock widget by its window title.
16 Returns None if dock widget does not exist or is not created yet.
18 WARNING: this function is language-dependant as the title of the
19 dock widget is normally internationalized according to the currently
24 findDockWidgetByTitle( "Object Browser" )
26 sg = SalomePyQt.SalomePyQt()
27 dwl = sg.getDesktop().findChildren( QDockWidget )
28 dw = filter(lambda a: a.windowTitle() == QString( title ), dwl)
32 def findDockWidgetByName( dwName ):
34 Find and return dock widget by its internal name
35 Returns None if dock widget does not exist or is not created yet
37 Note: this function is language-independant: internal name
38 of the dock widget does not depend on the currently used language.
42 findDockWidgetByName( "objectBrowserDock" )
44 sg = SalomePyQt.SalomePyQt()
45 return sg.getDesktop().findChild( QDockWidget, dwName )
47 def findDockWidgetById( dwId ):
49 Find and return dock widget by its id
50 Returns None if dock widget does not exist or is not created yet
52 WARNING: this function works only with dock widget ids
53 specified in SalomePyQt interface.
57 findDockWidgetById( SalomePyQt.WT_ObjectBrowser )
60 return findDockWidgetByName( _dockWidgetNames[ dwId ] )
65 def getAllDockWindows():
69 WARNING: this function searches all dock widgets starting from the
70 top-level main window; thus, resulting list contains also dock windows
71 that belong to the lower-level windows (e.g. view windows).
73 sg = SalomePyQt.SalomePyQt()
74 return sg.getDesktop().findChildren( QDockWidget )
76 def tabifyDockWidgets( dw1, dw2 ):
78 Tabify two dock widgets.
80 sg = SalomePyQt.SalomePyQt()
81 if dw1 and dw2: sg.getDesktop().tabifyDockWidget( dw1, dw2 )