diff --git a/apps/opencs/view/render/pagedworldspacewidget.cpp b/apps/opencs/view/render/pagedworldspacewidget.cpp index 0f23dfe7b..3f40712d2 100644 --- a/apps/opencs/view/render/pagedworldspacewidget.cpp +++ b/apps/opencs/view/render/pagedworldspacewidget.cpp @@ -3,9 +3,17 @@ #include +#include + +#include + +#include + CSVRender::PagedWorldspaceWidget::PagedWorldspaceWidget (QWidget *parent) : WorldspaceWidget (parent) -{} +{ + setAcceptDrops(true); +} void CSVRender::PagedWorldspaceWidget::useViewHint (const std::string& hint) { @@ -44,4 +52,38 @@ void CSVRender::PagedWorldspaceWidget::setCellSelection (const CSMWorld::CellSel { mSelection = selection; emit cellSelectionChanged (mSelection); -} \ No newline at end of file +} + +void CSVRender::PagedWorldspaceWidget::dragEnterEvent (QDragEnterEvent* event) +{ + event->accept(); +} + +void CSVRender::PagedWorldspaceWidget::dragMoveEvent (QDragMoveEvent* event) +{ + event->accept(); +} + +void CSVRender::PagedWorldspaceWidget::dropEvent (QDropEvent* event) +{ + /* + const CSMWorld::TableMimeData* mime = dynamic_cast (event->mimeData()); + if (true) + { + if (mime->holdsType(CSMWorld::UniversalId::Type_Cell)) + { + CSMWorld::UniversalId record(mime->returnMatching (CSMWorld::UniversalId::Type_Cell)); + QString id(QString::fromUtf8(record.getId().c_str())); + if (*id.begin() == '#') + { + id.remove(0,1); + QStringList splited(id.split(' ')); + int x = splited.begin()->toInt(); + int y = (splited.begin()+1)->toInt(); + mSelection.add(CSMWorld::CellCoordinates(x, y)); + } + } + } + */ + //TODO! +} diff --git a/apps/opencs/view/render/pagedworldspacewidget.hpp b/apps/opencs/view/render/pagedworldspacewidget.hpp index f6ff32dc1..c6fdbf3be 100644 --- a/apps/opencs/view/render/pagedworldspacewidget.hpp +++ b/apps/opencs/view/render/pagedworldspacewidget.hpp @@ -13,6 +13,14 @@ namespace CSVRender CSMWorld::CellSelection mSelection; + private: + + void dropEvent(QDropEvent* event); + + void dragEnterEvent(QDragEnterEvent *event); + + void dragMoveEvent(QDragMoveEvent *event); + public: PagedWorldspaceWidget (QWidget *parent); diff --git a/apps/opencs/view/world/regionmap.cpp b/apps/opencs/view/world/regionmap.cpp index ccd121204..de46f175f 100644 --- a/apps/opencs/view/world/regionmap.cpp +++ b/apps/opencs/view/world/regionmap.cpp @@ -4,7 +4,6 @@ #include #include #include -#include #include #include