Haven't tried composite view but i use multiple OSGWidgets with QDockWidgets to 
make an MDI app 

The 
nice thing about dockwidgets is that you can move them outside the app and so 
use multiple monitors effectively.

Martin
--------------------------------------------------------
 
This is how I use it, with dockwindows in a Qt app
_views is a vector of ViewerQt so I can manipulate the settings in each window 
easily
_scene is the root of my OSG model
 
ViewerQT is just a wrapper around the QOSGWidget example
It also uses a customized version of spherical manipulator that is more 
suitable for GIS type apps (allows you to switch views to N,E,S,W plan)
but you can just strip out the setHomeMode() parts if you want to use the 
standard one.
 
This is how I use it, with dockwindows in a Qt app
_views is a vector of ViewerQt so I can have different settings in each window
_scene is the root of my OSG model
 

Code:
void MainWindow::createView()
{
        QString name=QString("View%1").arg(_views.size()+1);
                
        QDockWidget *dock = new QDockWidget(name, this);
        _view = new Viewer(dock);
        _view->setGeometry(dock->geometry());
        dock->setObjectName(name);
        dock->setWidget(_view);
 
        if ( _views.empty() ) {
                // first one can't be closed
                dock->setFeatures(0);
        } else{
                dock->setFeatures(QDockWidget::AllDockWidgetFeatures);
        }
 
        _views.push_back(_view);
                
       addDockWidget(Qt::RightDockWidgetArea, dock);
 
        if ( _scene ) {
                _view->setSceneData(_scene->getRoot());
                _view->show();
                _view->ViewCentre();                            
        }
 
        if ( _views.size() > 1 ) {
                tabifyDockWidget(_docks.back(),dock);
        }
        _docks.push_back(dock); 
        _view->getCamera()->setCullMask(0xffffff);
        
}



------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=26604#26604




Attachments: 
http://forum.openscenegraph.org//files/viewerqt_974.zip


_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to