From 717c1b15f548982349e19f018ce06fbc9d8981af Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Thu, 11 Sep 2014 13:07:28 +0200 Subject: [PATCH] fixed drop implementation for unpaged worldspace (wasn't updating cell object) --- apps/opencs/view/render/unpagedworldspacewidget.cpp | 4 ++-- apps/opencs/view/render/worldspacewidget.cpp | 5 +++++ apps/opencs/view/render/worldspacewidget.hpp | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/opencs/view/render/unpagedworldspacewidget.cpp b/apps/opencs/view/render/unpagedworldspacewidget.cpp index 7072c17a6..aab3791fc 100644 --- a/apps/opencs/view/render/unpagedworldspacewidget.cpp +++ b/apps/opencs/view/render/unpagedworldspacewidget.cpp @@ -98,11 +98,11 @@ bool CSVRender::UnpagedWorldspaceWidget::handleDrop (const std::vectorgetId(); + mCell.reset (new Cell (getDocument().getData(), getSceneManager(), mCellId)); + update(); emit cellChanged(*data.begin()); - /// \todo replace mCell - return true; } diff --git a/apps/opencs/view/render/worldspacewidget.cpp b/apps/opencs/view/render/worldspacewidget.cpp index c95d2f51d..7f1d06c91 100644 --- a/apps/opencs/view/render/worldspacewidget.cpp +++ b/apps/opencs/view/render/worldspacewidget.cpp @@ -213,6 +213,11 @@ void CSVRender::WorldspaceWidget::addVisibilitySelectorButtons ( tool->addButton (":armor.png", Element_Pathgrid, ":armor.png", "Pathgrid"); } +CSMDoc::Document& CSVRender::WorldspaceWidget::getDocument() +{ + return mDocument; +} + void CSVRender::WorldspaceWidget::dragEnterEvent (QDragEnterEvent* event) { event->accept(); diff --git a/apps/opencs/view/render/worldspacewidget.hpp b/apps/opencs/view/render/worldspacewidget.hpp index 41d4964d0..e684b180f 100644 --- a/apps/opencs/view/render/worldspacewidget.hpp +++ b/apps/opencs/view/render/worldspacewidget.hpp @@ -85,6 +85,8 @@ namespace CSVRender virtual void addVisibilitySelectorButtons (CSVWidget::SceneToolToggle *tool); + CSMDoc::Document& getDocument(); + private: void dragEnterEvent(QDragEnterEvent *event);