From: Paul RASCLE Date: Wed, 18 Jan 2017 15:24:48 +0000 (+0100) Subject: add method QWidget* getViewWidget( const int ) X-Git-Tag: SHAPER_2.7.0~11 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7da0c41173b75f113e94c6e6b3a1ea8f8772a347;p=modules%2Fgui.git add method QWidget* getViewWidget( const int ) --- diff --git a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx index 67c57f31d..81f274046 100644 --- a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx +++ b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx @@ -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 diff --git a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.h b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.h index 4194fa3b6..dac525e79 100644 --- a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.h +++ b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.h @@ -287,6 +287,7 @@ public: static bool setViewSize( const int, const int, const int = 0 ); static QList 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 ); diff --git a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip index c481c2444..cc09d9038 100644 --- a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip +++ b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip @@ -404,6 +404,7 @@ public: static bool setViewSize( const int, const int, const int = 0 ) /ReleaseGIL/ ; static QList 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/ ;