#include "scriptedit.hpp" #include #include "../../model/world/universalid.hpp" #include "../../model/world/tablemimedata.hpp" CSVWorld::ScriptEdit::ScriptEdit (QWidget* parent) : QTextEdit (parent) { 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())); 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() + '"')); } } }