diff options
author | Treeki <treeki@gmail.com> | 2012-09-05 01:36:57 +0200 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2012-09-05 01:36:57 +0200 |
commit | f928869357765e3a73501064408bb7bc0ee363ef (patch) | |
tree | 1c75962f64e4a7bfc38315c21ccadd83092aa0d4 /lslayoutwindow.cpp | |
parent | 824b2fa6b700ec7b50f0388b649480a689cf22f3 (diff) | |
download | LayoutStudio-f928869357765e3a73501064408bb7bc0ee363ef.tar.gz LayoutStudio-f928869357765e3a73501064408bb7bc0ee363ef.zip |
improving the material editor
Diffstat (limited to '')
-rw-r--r-- | lslayoutwindow.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lslayoutwindow.cpp b/lslayoutwindow.cpp index 38e0417..3323803 100644 --- a/lslayoutwindow.cpp +++ b/lslayoutwindow.cpp @@ -1,5 +1,6 @@ #include "lslayoutwindow.h" #include "lsscenemodel.h" +#include "lsmaterialmodel.h" #include "lspaneeditor.h" #include "lsmaterialeditor.h" #include "layoutgl/widget.h" @@ -123,6 +124,12 @@ LSLayoutWindow::LSLayoutWindow(LYTPackageBase *pkg, const QString &layoutName, Q m_sceneGraph->expandAll(); connect(m_sceneGraph->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), SLOT(selectedPaneChanged(QModelIndex,QModelIndex))); + LSMaterialModel *matModel = new LSMaterialModel(&m_layout->materials, this); + + m_materialList->setSelectionMode(QAbstractItemView::SingleSelection); + m_materialList->setModel(matModel); + connect(m_materialList->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), SLOT(selectedMaterialChanged(QModelIndex,QModelIndex))); + setWindowTitle(m_layoutName); @@ -161,7 +168,10 @@ void LSLayoutWindow::selectedPaneChanged(const QModelIndex ¤t, const QMode } void LSLayoutWindow::selectedMaterialChanged(const QModelIndex ¤t, const QModelIndex &previous) { + (void)previous; + LYTMaterial *mat = m_layout->materials.getMaterialByIndex(current.row()); + m_materialEditor->setMaterial(mat); } |