Salome HOME
add method QWidget* getViewWidget( const int )
authorPaul RASCLE <paul.rascle@edf.fr>
Wed, 18 Jan 2017 15:24:48 +0000 (16:24 +0100)
committerPaul RASCLE <paul.rascle@edf.fr>
Wed, 18 Jan 2017 15:24:48 +0000 (16:24 +0100)
src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx
src/SALOME_PYQT/SalomePyQt/SalomePyQt.h
src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip

index 67c57f31d7a844f315f5ae778d81cc46e1633762..81f2740464786e9a8a766344b2510a7b07bacb27 100644 (file)
@@ -2850,6 +2850,33 @@ bool SalomePyQt::activateView( const int id )
   return ProcessEvent( new TActivateView( id ) );
 }
 
+/*!
+ *
+ */
+
+class TGetViewWidget: public SALOME_Event
+{
+public:
+  typedef QWidget* TResult;
+  TResult myResult;
+  int myWndId;
+  TGetViewWidget( const int id )
+    : myResult( 0 ),
+      myWndId( id ) {}
+  virtual void Execute()
+  {
+    SUIT_ViewWindow* wnd = getWnd( myWndId );
+    if ( wnd ) {
+        myResult = (QWidget*)wnd;
+    }
+  }
+};
+QWidget* SalomePyQt::getViewWidget( const int id)
+{
+  return ProcessEvent( new TGetViewWidget( id ) );
+}
+
+
 /*!
   \fn int SalomePyQt::createView( const QString& type, bool visible = true, const int width = 0, const int height = 0 );
   \brief Create new view and activate it
index 4194fa3b664df1ecc4d4ea2af42fd33714085c1f..dac525e79b28b948864505f1722ec692256dfc18 100644 (file)
@@ -287,6 +287,7 @@ public:
   static bool              setViewSize( const int, const int, const int = 0 );
   static QList<int>        findViews( const QString& );
   static bool              activateView( const int );
+  static QWidget*          getViewWidget( const int );
   static int               createView( const QString&, bool visible = true, const int width = 0, const int height = 0 );
   static int               createView( const QString&, QWidget* );
   static bool              closeView( const int );
index c481c24449ac6e70327aeb184ebd44065c7c279f..cc09d9038541504151d2f6d863000172003fb55d 100644 (file)
@@ -404,6 +404,7 @@ public:
   static bool              setViewSize( const int, const int, const int = 0 ) /ReleaseGIL/ ;
   static QList<int>        findViews( const QString& ) /ReleaseGIL/ ;
   static bool              activateView( const int ) /ReleaseGIL/ ;
+  static QWidget*          getViewWidget( const int ) /ReleaseGIL/ ;
   static int               createView( const QString&, bool visible = true, const int width = 0, const int height = 0 ) /ReleaseGIL/ ;
   static int               createView( const QString&, QWidget* ) /ReleaseGIL/ ;
   static bool              closeView( const int ) /ReleaseGIL/ ;