forked from teamnwah/openmw-tes3coop
added new, later common, base for the regionmap and the table
parent
6929e541dd
commit
853abb65c3
@ -0,0 +1,21 @@
|
||||
#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) :
|
||||
mDocument(document)
|
||||
{}
|
@ -0,0 +1,36 @@
|
||||
#ifndef CSV_WORLD_REGIONMAP_H
|
||||
#define CSV_WORLD_REGIONMAP_H
|
||||
|
||||
#include <QTableView>
|
||||
|
||||
class QAction;
|
||||
|
||||
namespace CSMDoc
|
||||
{
|
||||
class Document;
|
||||
}
|
||||
|
||||
namespace CSMWorld
|
||||
{
|
||||
class UniversalId;
|
||||
}
|
||||
|
||||
namespace CSVWorld
|
||||
{
|
||||
class DragRecordTable : public QTableView
|
||||
{
|
||||
protected:
|
||||
CSMDoc::Document& mDocument;
|
||||
|
||||
public:
|
||||
DragRecordTable(CSMDoc::Document& document);
|
||||
|
||||
virtual std::vector<CSMWorld::UniversalId> getDragedRecords() const = 0;
|
||||
|
||||
protected:
|
||||
void startDrag(const DragRecordTable& table);
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue