]> Creatis software - cpPlugins.git/blobdiff - lib/cpBaseQtApplication/MainWindow.cxx
..
[cpPlugins.git] / lib / cpBaseQtApplication / MainWindow.cxx
index 37b18aa56168693a98df86b999010b239002e2db..9b16236acb94760f09af7f12bf3fb1f8d7e8c6ad 100644 (file)
@@ -133,6 +133,14 @@ void cpBaseQtApplication::MainWindow::
 setViewer( cpExtensions::QT::ActorsWidgetInterface* v )
 {
   this->m_Viewer = v;
+  if( this->m_Viewer != NULL )
+  {
+    auto interactors = this->m_Viewer->GetInteractors( );
+    for( auto wIt : this->m_Workspaces )
+      for( auto i : interactors )
+        wIt.second->AddInteractor( i );
+
+  } // fi
 }
 
 // -------------------------------------------------------------------------
@@ -227,6 +235,14 @@ _addWorkspace( const std::string& name )
     this->m_Workspaces[ name ] = TWorkspace::New( );
     if( this->m_Canvas != NULL )
       this->m_Canvas->setWorkspace( this->m_Workspaces[ name ] );
+    if( this->m_Viewer !=  NULL )
+    {
+      auto interactors = this->m_Viewer->GetInteractors( );
+      auto wIt = this->m_Workspaces.find( name );
+      for( auto i : interactors )
+        wIt->second->AddInteractor( i );
+
+    } // fi
     this->setWindowTitle( ( this->m_BaseWindowTitle + name ).c_str( ) );
 
   } // fi