Creates view manager of some type
\param vmType - type of view manager
*/
-SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType )
+SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType, bool detached )
{
SUIT_ResourceMgr* resMgr = resourceMgr();
if ( !viewMgr )
return 0;
+ viewMgr->setDetached(detached);
addViewManager( viewMgr );
SUIT_ViewWindow* viewWin = viewMgr->createViewWindow();
SUIT_ViewManager* getViewManager( const QString&, const bool );
virtual void addViewManager( SUIT_ViewManager* );
virtual void removeViewManager( SUIT_ViewManager* );
- virtual SUIT_ViewManager* createViewManager( const QString& vmType );
+ virtual SUIT_ViewManager* createViewManager( const QString& vmType, bool detached = false );
virtual SUIT_ViewManager* createViewManager( const QString& vmType, QWidget* w );
virtual SUIT_ViewManager* createViewManager( SUIT_ViewModel* );
bool myVisible;
int myWidth;
int myHeight;
- TCreateView( const QString& theType, bool visible, const int width, const int height )
+ bool myDetached;
+ TCreateView( const QString& theType, bool visible, const int width, const int height, bool detached )
: myResult( -1 ),
myType( theType ),
myVisible(visible),
myWidth(width),
- myHeight(height) {}
+ myHeight(height),
+ myDetached(detached) {}
virtual void Execute()
{
LightApp_Application* app = getApplication();
if ( app ) {
- SUIT_ViewManager* viewMgr = app->createViewManager( myType );
+ SUIT_ViewManager* viewMgr = app->createViewManager( myType, myDetached );
if ( viewMgr ) {
QWidget* wnd = viewMgr->getActiveView();
myResult = viewMgr->getActiveView()->getId();
}
}
};
-int SalomePyQt::createView( const QString& type, bool visible, const int width, const int height )
+int SalomePyQt::createView( const QString& type, bool visible, const int width, const int height, bool detached )
{
- int ret = ProcessEvent( new TCreateView( type, visible, width, height ) );
+ int ret = ProcessEvent( new TCreateView( type, visible, width, height, detached ) );
QCoreApplication::processEvents();
return ret;
}
static bool activateView( const int );
static bool activateViewManagerAndView( 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&, bool visible = true, const int width = 0, const int height = 0, bool detached = false );
static int createView( const QString&, QWidget* );
static bool closeView( const int );
static int cloneView( const int );
static bool activateView( const int ) /ReleaseGIL/ ;
static bool activateViewManagerAndView( 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&, bool visible = true, const int width = 0, const int height = 0, bool detached = false ) /ReleaseGIL/ ;
static int createView( const QString&, QWidget* ) /ReleaseGIL/ ;
static bool closeView( const int ) /ReleaseGIL/ ;
static int cloneView( const int ) /ReleaseGIL/ ;
#include "STD_TabDesktop.h"
#include <SUIT_Session.h>
+#include <SUIT_ViewManager.h>
#include <SUIT_ViewWindow.h>
#include <SUIT_ResourceMgr.h>
{
if ( !w || !workstack() )
return;
+ if ( w && w->inherits( "SUIT_ViewWindow" ) )
+ {
+ SUIT_ViewWindow* wid = (SUIT_ViewWindow*)w;
+ if ( wid->getViewManager()->getDetached() )
+ return;
+ }
workstack()->addWindow( w );
}
: QObject( 0 ),
myDesktop( theDesktop ),
myTitle( "Default: %M - viewer %V" ),
- myStudy( NULL )
+ myStudy( NULL ),
+ myIsDetached( false )
{
myViewModel = 0;
myActiveView = 0;
if ( vm )
vm->contextMenuPopup( popup );
}
+
+/*! option detached (false by default) to set before the viewWindow is added to Desktop TabBar */
+void SUIT_ViewManager::setDetached(bool detached)
+{
+ myIsDetached = detached;
+}
+
+/*! get option detached (false by default) to decide if the viewWindow is to be added to Desktop TabBar */
+bool SUIT_ViewManager::getDetached() const
+{
+ return myIsDetached;
+}
int getId() const;
int getGlobalId() const;
+ void setDetached(bool detached);
+ bool getDetached() const;
public slots:
void createView();
QPixmap myIcon;
QString myTitle;
SUIT_Study* myStudy;
+ bool myIsDetached;
static QMap<QString, int> _ViewMgrId;
};