diff options
author | Treeki <treeki@gmail.com> | 2012-08-05 17:35:52 +0200 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2012-08-05 17:35:52 +0200 |
commit | 3b2fb505d58f28f0ce9b4de121f12fc924c1ec0c (patch) | |
tree | 2f6a0303927dbb2b16205e74034255cb70a7d1d4 /lslayoutwindow.cpp | |
parent | cee09c07899dfec32672e7e2d175972530a7dfd4 (diff) | |
download | LayoutStudio-3b2fb505d58f28f0ce9b4de121f12fc924c1ec0c.tar.gz LayoutStudio-3b2fb505d58f28f0ce9b4de121f12fc924c1ec0c.zip |
getting further... basic read-only Scene Graph model/widget
Diffstat (limited to 'lslayoutwindow.cpp')
-rw-r--r-- | lslayoutwindow.cpp | 52 |
1 files changed, 51 insertions, 1 deletions
diff --git a/lslayoutwindow.cpp b/lslayoutwindow.cpp index 25baf41..518d022 100644 --- a/lslayoutwindow.cpp +++ b/lslayoutwindow.cpp @@ -1,4 +1,5 @@ #include "lslayoutwindow.h" +#include "lsscenemodel.h" #include <QGridLayout> #include <QFormLayout> #include <QGroupBox> @@ -32,6 +33,9 @@ LSLayoutWindow::LSLayoutWindow(LYTPackageBase *pkg, const QString &layoutName, Q sizeForm->addRow("Width", m_widthBox); sizeForm->addRow("Height", m_heightBox); + connect(m_widthBox, SIGNAL(valueChanged(double)), SLOT(handleWidthChanged(double))); + connect(m_heightBox, SIGNAL(valueChanged(double)), SLOT(handleHeightChanged(double))); + QGroupBox *matGroup = new QGroupBox("Materials", this); QGroupBox *grpGroup = new QGroupBox("Groups", this); @@ -40,7 +44,53 @@ LSLayoutWindow::LSLayoutWindow(LYTPackageBase *pkg, const QString &layoutName, Q sgrid->addWidget(grpGroup, 1, 1, 1, 1); sgrid->setRowStretch(1, 1); - m_tabWidget->addTab(w, "Settings"); + m_tabWidget->addTab(w, "Layout"); + + // prepare the Scene Graph tab + w = new QWidget(this); + QGridLayout *ggrid = new QGridLayout(w); + + m_searchBox = new QLineEdit(this); + m_searchBox->setPlaceholderText("Search panes..."); + + m_clearSearchButton = new QPushButton("Clear", this); + + m_sceneGraph = new QTreeView(this); + m_sceneGraph->setHeaderHidden(true); + m_sceneSearchList = new QListView(this); + m_sceneListSwitcher = new QStackedLayout; + m_sceneListSwitcher->addWidget(m_sceneGraph); + m_sceneListSwitcher->addWidget(m_sceneSearchList); + + ggrid->addWidget(m_searchBox, 0, 0, 1, 1); + ggrid->addWidget(m_clearSearchButton, 0, 1, 1, 1); + ggrid->addLayout(m_sceneListSwitcher, 1, 0, 1, 2); + + m_tabWidget->addTab(w, "Scene Graph"); + + + // get the resource + m_layout = new LYTLayout(*m_package, m_layoutName); + + m_widthBox->setValue(m_layout->width); + m_heightBox->setValue(m_layout->height); + + m_sceneGraph->setModel(new LSSceneModel(m_layout, this)); + m_sceneGraph->expandAll(); + + setWindowTitle(m_layoutName); +} + +LSLayoutWindow::~LSLayoutWindow() { + delete m_layout; } +void LSLayoutWindow::handleWidthChanged(double v) { + m_layout->width = v; +} + +void LSLayoutWindow::handleHeightChanged(double v) { + m_layout->height = v; +} + |