summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-08-13 02:12:27 +0200
committerTreeki <treeki@gmail.com>2012-08-13 02:12:27 +0200
commitf8ed84b9f9a13d8f227f4bff38d8af551116eb5c (patch)
treec5049037c79fd9d756741dde532854726487d79d
parent7606562f289ab0488892ca11c41137a8ba207ce5 (diff)
downloadLayoutStudio-f8ed84b9f9a13d8f227f4bff38d8af551116eb5c.tar.gz
LayoutStudio-f8ed84b9f9a13d8f227f4bff38d8af551116eb5c.zip
preview/renderer window now shown alongside LayoutWindow
-rw-r--r--lslayoutwindow.cpp17
-rw-r--r--lslayoutwindow.h3
2 files changed, 20 insertions, 0 deletions
diff --git a/lslayoutwindow.cpp b/lslayoutwindow.cpp
index 7360dcb..d137400 100644
--- a/lslayoutwindow.cpp
+++ b/lslayoutwindow.cpp
@@ -1,5 +1,6 @@
#include "lslayoutwindow.h"
#include "lsscenemodel.h"
+#include "layoutgl/widget.h"
#include <QGridLayout>
#include <QFormLayout>
#include <QGroupBox>
@@ -83,9 +84,25 @@ LSLayoutWindow::LSLayoutWindow(LYTPackageBase *pkg, const QString &layoutName, Q
m_sceneGraph->expandAll();
setWindowTitle(m_layoutName);
+
+
+ // finally make the widget
+ m_renderer = new LGLWidget();
+ m_renderer->setLayout(m_layout);
+ m_renderer->setWindowTitle(QString("Preview: %1").arg(m_layoutName));
+ m_renderer->setWindowFlags(
+ Qt::CustomizeWindowHint |
+ Qt::WindowTitleHint |
+ Qt::WindowMinimizeButtonHint);
+ m_renderer->show();
+
+ // clean up here
+ setAttribute(Qt::WA_DeleteOnClose);
}
LSLayoutWindow::~LSLayoutWindow() {
+ m_renderer->close();
+ delete m_renderer;
delete m_layout;
}
diff --git a/lslayoutwindow.h b/lslayoutwindow.h
index e83a034..7375a7f 100644
--- a/lslayoutwindow.h
+++ b/lslayoutwindow.h
@@ -11,6 +11,7 @@
#include <QListView>
#include "lyt/packagebase.h"
#include "lyt/layout.h"
+class LGLWidget;
class LSLayoutWindow : public QMainWindow {
Q_OBJECT
@@ -28,6 +29,8 @@ private:
LYTPackageBase *m_package;
LYTLayout *m_layout;
+ LGLWidget *m_renderer;
+
QTabWidget *m_tabWidget;
// settings