Commit 7061f724 authored by grunau's avatar grunau
Browse files

Dock all floating windows in the main window

The application is now single-window by default. The floating windows it
was composed of previously have all been docked in the main window.

Certain widgets (e.g. DataContainerInspectorWidget) may have to be
redesigned to better fit this new layout. Also, displaying multiple
rendering canvases at once is not supported yet.

git-svn-id: https://camplinux.in.tum.de/svn/campvis/branches/gui-redux@501 bb408c1c-ae56-11e1-83d9-df6b3e0c105e
parent a8b7d40e
......@@ -20,6 +20,10 @@ FILE(GLOB CampvisApplicationHeaders
tools/*.h
)
FILE(GLOB CampvisApplicationForms
ui/*.ui
)
SET(CampvisApplicationToBeMocced
gui/mainwindow.h
gui/datacontainerinspectorcanvas.h
......@@ -52,6 +56,8 @@ LIST(APPEND CampvisApplicationDefinitions "-DCAMPVIS_SOURCE_DIR=\"${CampvisHome}
FIND_PACKAGE(Qt4 ${CampvisRequiredQtVersion} REQUIRED QtCore QtGui QtOpenGL)
QT4_WRAP_CPP(CampvisApplicationMoc ${CampvisApplicationToBeMocced})
LIST(APPEND CampvisApplicationSources ${CampvisApplicationMoc})
QT4_WRAP_UI(CampvisApplicationFormsHeaders ${CampvisApplicationForms})
LIST(APPEND CampvisApplicationSources ${CampvisApplicationFormsHeaders})
INCLUDE(${QT_USE_FILE})
LINK_DIRECTORIES(${CampvisGlobalLinkDirectories} ${CampvisModulesLinkDirectories})
......
......@@ -237,6 +237,7 @@ namespace campvis {
// create canvas and painter for the VisPipeline and connect all together
tgt::QtThreadedCanvas* canvas = CtxtMgr.createContext(name, "CAMPVis", tgt::ivec2(512, 512));
GLJobProc.registerContext(canvas);
_mainWindow->setCentralWidget(canvas);
canvas->init();
TumVisPainter* painter = new TumVisPainter(canvas, vp);
......
......@@ -52,6 +52,7 @@ namespace campvis {
, _selectedProcessor(0)
{
tgtAssert(_application != 0, "Application must not be 0.");
ui.setupUi(this);
setup();
}
......@@ -63,18 +64,17 @@ namespace campvis {
void MainWindow::setup() {
qRegisterMetaType<QtDataHandle>("QtDataHandle");
_dcInspectorWidget = new DataContainerInspectorWidget();
_dcInspectorWidget->show();
setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);
_centralWidget = new QWidget(this);
QHBoxLayout* mainLayout = new QHBoxLayout();
mainLayout->setSpacing(4);
_dcInspectorWidget = new DataContainerInspectorWidget();
ui.dataContainerInspectorDock->setWidget(_dcInspectorWidget);
_pipelineWidget = new PipelineTreeWidget(_centralWidget);
mainLayout->addWidget(_pipelineWidget);
_pipelineWidget = new PipelineTreeWidget();
ui.pipelineTreeDock->setWidget(_pipelineWidget);
QWidget* rightWidget = new QWidget(_centralWidget);
mainLayout->addWidget(rightWidget);
QWidget* rightWidget = new QWidget();
ui.pipelinePropertiesDock->setWidget(rightWidget);
QVBoxLayout* rightLayout = new QVBoxLayout();
rightLayout->setSpacing(4);
......@@ -89,8 +89,6 @@ namespace campvis {
_propCollectionWidget = new PropertyCollectionWidget(_centralWidget);
rightLayout->addWidget(_propCollectionWidget);
_centralWidget->setLayout(mainLayout);
setCentralWidget(_centralWidget);
connect(
this, SIGNAL(updatePipelineWidget(const std::vector<AbstractPipeline*>&)),
......
......@@ -34,6 +34,7 @@
#include "application/campvisapplication.h"
#include "application/gui/pipelinetreewidget.h"
#include "application/gui/properties/propertycollectionwidget.h"
#include "application/ui_mainwindow.h"
#include <QMainWindow>
#include <QVBoxLayout>
......@@ -115,6 +116,8 @@ namespace campvis {
*/
void setup();
Ui::MainWindow ui; ///< Interface definition of the MainWindow
CampVisApplication* _application; ///< Pointer to the application hosting the whole stuff
QWidget* _centralWidget; ///< Central widget of the MainWindow
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget"/>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>21</height>
</rect>
</property>
</widget>
<widget class="QStatusBar" name="statusbar"/>
<widget class="QDockWidget" name="dataContainerInspectorDock">
<property name="allowedAreas">
<set>Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea</set>
</property>
<attribute name="dockWidgetArea">
<number>1</number>
</attribute>
<widget class="QWidget" name="dataContainerInspectorDockContents"/>
</widget>
<widget class="QDockWidget" name="pipelineTreeDock">
<property name="allowedAreas">
<set>Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea</set>
</property>
<attribute name="dockWidgetArea">
<number>2</number>
</attribute>
<widget class="QWidget" name="pipelineTreeDockContents"/>
</widget>
<widget class="QDockWidget" name="pipelinePropertiesDock">
<property name="allowedAreas">
<set>Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea</set>
</property>
<attribute name="dockWidgetArea">
<number>2</number>
</attribute>
<widget class="QWidget" name="pipelinePropertiesDockContents"/>
</widget>
</widget>
<resources/>
<connections/>
</ui>
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