Salome HOME
Python console has been added for HYDRO module (Bug #22).
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Tool.cxx
index e224ff808bf4275a0bea639c0d9d41e417369ac7..29d053f046bb210563677941224d417d9c8f979d 100644 (file)
@@ -44,6 +44,7 @@
 #include <SUIT_ViewWindow.h>
 
 #include <QTextCodec>
+#include <QDockWidget>
 
 // Definition of this id allows to use 'latin1' (Qt alias for 'ISO-8859-1')
 // encoding instead of default 'System'
@@ -392,3 +393,19 @@ void HYDROGUI_Tool::GetObjectBackReferences( HYDROGUI_Module* theModule,
     }
   }
 }
+
+
+QDockWidget* HYDROGUI_Tool::WindowDock( QWidget* wid )
+{
+  if ( !wid )
+    return 0;
+
+  QDockWidget* dock = 0;
+  QWidget* w = wid->parentWidget();
+  while ( w && !dock )
+  {
+    dock = ::qobject_cast<QDockWidget*>( w );
+    w = w->parentWidget();
+  }
+  return dock;
+}