2014-02-15 16:55:18 +00:00
|
|
|
#include "scriptedit.hpp"
|
|
|
|
|
2014-02-15 18:52:40 +00:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include <QDragEnterEvent>
|
|
|
|
|
|
|
|
#include "../../model/world/universalid.hpp"
|
|
|
|
#include "../../model/world/tablemimedata.hpp"
|
|
|
|
|
|
|
|
CSVWorld::ScriptEdit::ScriptEdit (QWidget* parent) :
|
|
|
|
QTextEdit(parent)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-02-15 16:55:18 +00:00
|
|
|
void CSVWorld::ScriptEdit::dragEnterEvent (QDragEnterEvent* event)
|
|
|
|
{
|
|
|
|
event->acceptProposedAction();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CSVWorld::ScriptEdit::dragMoveEvent (QDragMoveEvent* event)
|
|
|
|
{
|
|
|
|
event->accept();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CSVWorld::ScriptEdit::dropEvent (QDropEvent* event)
|
|
|
|
{
|
2014-02-15 18:52:40 +00:00
|
|
|
const CSMWorld::TableMimeData* mime = dynamic_cast<const CSMWorld::TableMimeData*> (event->mimeData());
|
|
|
|
|
|
|
|
std::vector<CSMWorld::UniversalId> records (mime->getData());
|
2014-02-15 16:55:18 +00:00
|
|
|
|
2014-02-15 18:52:40 +00:00
|
|
|
for (std::vector<CSMWorld::UniversalId>::iterator it = records.begin(); it != records.end(); ++it)
|
|
|
|
{
|
|
|
|
insertPlainText (QString::fromStdString (it->getId()));
|
|
|
|
}
|
2014-02-15 16:55:18 +00:00
|
|
|
}
|
|
|
|
// kate: indent-mode cstyle; indent-width 4; replace-tabs on;
|