openmw-tes3coop/apps/opencs/view/world/dragrecordtable.cpp

29 lines
736 B
C++
Raw Normal View History

#include <QDrag>
#include "../../model/world/tablemimedata.hpp"
#include "dragrecordtable.hpp"
void CSVWorld::DragRecordTable::startDrag (const CSVWorld::DragRecordTable& table)
{
CSMWorld::TableMimeData* mime = new CSMWorld::TableMimeData (table.getDragedRecords(), mDocument);
if (mime)
{
QDrag* drag = new QDrag (this);
drag->setMimeData (mime);
drag->setPixmap (QString::fromUtf8 (mime->getIcon().c_str()));
drag->exec (Qt::CopyAction);
}
}
CSVWorld::DragRecordTable::DragRecordTable (CSMDoc::Document& document, QWidget* parent) :
mDocument(document),
2014-04-29 17:43:58 +00:00
QTableView(parent),
mEditLock(false)
{}
2014-04-29 17:43:58 +00:00
void CSVWorld::DragRecordTable::setEditLock (bool locked)
{
mEditLock = locked;
}