#include "scriptedit.hpp" #include #include "../../model/world/universalid.hpp" #include "../../model/world/tablemimedata.hpp" CSVWorld::ScriptEdit::ScriptEdit (QWidget* parent, const CSMDoc::Document& document) : QTextEdit (parent), mDocument (document) { mAllowedTypes <pos())); event->acceptProposedAction(); } void CSVWorld::ScriptEdit::dragMoveEvent (QDragMoveEvent* event) { setTextCursor (cursorForPosition (event->pos())); event->accept(); } void CSVWorld::ScriptEdit::dropEvent (QDropEvent* event) { const CSMWorld::TableMimeData* mime = dynamic_cast (event->mimeData()); setTextCursor (cursorForPosition (event->pos())); if (mime->fromDocument (mDocument)) { std::vector records (mime->getData()); for (std::vector::iterator it = records.begin(); it != records.end(); ++it) { if (mAllowedTypes.contains (it->getType())) { QString::fromStdString ('"' + it->getId() + '"'); } } } }