Commit 3c9d830c authored by grunau's avatar grunau
Browse files

Dock transfer function editor in the main window

When created for the first time, the transfer
function editor is added to the main window and
docked in its right docking area.

git-svn-id: https://camplinux.in.tum.de/svn/campvis/branches/gui-redux@505 bb408c1c-ae56-11e1-83d9-df6b3e0c105e
parent fb182f92
......@@ -251,4 +251,10 @@ namespace campvis {
CtxtMgr.releaseCurrentContext();
}
void CampVisApplication::registerDockWidget(Qt::DockWidgetArea area, QDockWidget* dock) {
tgtAssert(dock != 0, "Dock widget must not be 0.");
_mainWindow->addDockWidget(area, dock);
}
}
......@@ -34,6 +34,7 @@
#include "sigslot/sigslot.h"
#include <QApplication>
#include <QDockWidget>
#include <utility>
#include <vector>
......@@ -109,6 +110,15 @@ namespace campvis {
void addVisualizationPipeline(const std::string& name, VisualizationPipeline* vp);
/**
* Adds a dock widget to the main window.
* The dock widget will be automatically docked in the specified area.
*
* \param area Area of the main window to which the dock widget should be added.
* \param dock The dock widget to add to the main window.
*/
void registerDockWidget(Qt::DockWidgetArea area, QDockWidget* dock);
/**
* Runs the actual application.
* Make sure to call init() before.
* \return 0 on success.
......
......@@ -31,6 +31,7 @@
#include "application/gui/properties/abstracttransferfunctioneditor.h"
#include "application/gui/properties/transferfunctioneditorfactory.h"
#include "application/campvisapplication.h"
#include "core/datastructures/imagerepresentationlocal.h"
#include <QDockWidget>
......@@ -139,9 +140,11 @@ namespace campvis {
_dockWidget = new QDockWidget("Transfer Function Editor");
_dockWidget->setWidget(_editor);
}
_dockWidget->setVisible(true);
static_cast<CampVisApplication*>(qApp)->registerDockWidget(Qt::RightDockWidgetArea, _dockWidget);
} else {
_dockWidget->setVisible(true);
}
}
void TransferFunctionPropertyWidget::onFitClicked(bool checked) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment