Skip to content
Snippets Groups Projects
Commit 80087681 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

OSGWidget are created as dock widget.

* There is no central widget anymore. This makes the GUI more flexible.
parent 67143834
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <QLabel> #include <QLabel>
#include <gepetto/viewer/group-node.h> #include <gepetto/viewer/group-node.h>
#include <gepetto/viewer/corba/deprecated.hh>
#include <gepetto/gui/fwd.hh> #include <gepetto/gui/fwd.hh>
...@@ -70,7 +71,8 @@ namespace gepetto { ...@@ -70,7 +71,8 @@ namespace gepetto {
} }
/// Get the central widget. /// Get the central widget.
OSGWidget* centralWidget() const; /// \deprecated Use \ref osgWindows instead
OSGWidget* centralWidget() const GEPETTO_VIEWER_CORBA_DEPRECATED;
/// Get the list of windows. /// Get the list of windows.
QList <OSGWidget*> osgWindows () const; QList <OSGWidget*> osgWindows () const;
......
...@@ -242,15 +242,14 @@ namespace gepetto { ...@@ -242,15 +242,14 @@ namespace gepetto {
void MainWindow::addOSGWidget(OSGWidget* osgWidget) void MainWindow::addOSGWidget(OSGWidget* osgWidget)
{ {
if (!osgWindows_.empty()) { QDockWidget* dockOSG = new QDockWidget (
QDockWidget* dockOSG = new QDockWidget ( tr("Window ") + osgWidget->objectName(), this);
tr("OSG Viewer") + " " + QString::number (osgWindows_.size()), this); dockOSG->setWidget(osgWidget);
dockOSG->setWidget(osgWidget); addDockWidget(Qt::RightDockWidgetArea, dockOSG);
addDockWidget(Qt::RightDockWidgetArea, dockOSG); if (osgWindows_.empty()) {
} else {
// This OSGWidget should be the central view // This OSGWidget should be the central view
centralWidget_ = osgWidget; centralWidget_ = osgWidget;
setCentralWidget(centralWidget_); setCentralWidget(0);
#if GEPETTO_GUI_HAS_PYTHONQT #if GEPETTO_GUI_HAS_PYTHONQT
pythonWidget_->addToContext("osg", centralWidget_); pythonWidget_->addToContext("osg", centralWidget_);
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment