: QObject( 0 ),
myDesktop( theDesktop ),
myTitle( "Default: %M - viewer %V" ),
-myStudy( NULL )
+myStudy( NULL ),
+myFlags( None )
{
myViewModel = 0;
myActiveView = 0;
/*! Creates View, adds it into list of views and returns just created view window*/
SUIT_ViewWindow* SUIT_ViewManager::createViewWindow()
{
- SUIT_ViewWindow* aView = myViewModel->createView(myDesktop);
+ SUIT_ViewWindow* aView = myViewModel->createView( myDesktop );
if ( !insertView( aView ) ){
delete aView;
aView->setWindowIcon( QIcon( myIcon ) );
aView->setViewManager( this );
- myDesktop->addWindow( aView );
+ bool extView = myFlags & ExternalViews;
+
+ if ( myDesktop && !extView )
+ myDesktop->addWindow( aView );
//it is done automatically during creation of view
emit viewCreated( aView );
+ if ( myDesktop && !extView )
+ aView->show();
+
// Special treatment for the case when <aView> is the first one in this view manager
// -> call onWindowActivated() directly, because somebody may always want
// to use getActiveView()
- aView->show();
if ( !myActiveView )
onWindowActivated( aView );
return aView;
}
+int SUIT_ViewManager::flags() const
+{
+ return myFlags;
+}
+
+void SUIT_ViewManager::setFlags( int f )
+{
+ myFlags = f;
+}
+
/*! Get identifier */
int SUIT_ViewManager::getId() const
{
class SUIT_EXPORT SUIT_ViewManager : public QObject, public SUIT_PopupClient
{
Q_OBJECT
+
+public:
+ enum { None = 0x000000,
+ ExternalViews = 0x000001 };
+
public:
SUIT_ViewManager( SUIT_Study*,
SUIT_Desktop*,
virtual void setShown( const bool );
virtual void setDestructiveClose( const bool );
+ int flags() const;
+ void setFlags( int );
+
int getId() const;
public slots:
QString myTitle;
SUIT_Study* myStudy;
+ int myFlags;
+
static QMap<QString, int> _ViewMgrId;
};