|
|
@ -6,6 +6,7 @@
|
|
|
|
#include <QAction>
|
|
|
|
#include <QAction>
|
|
|
|
#include <QMenu>
|
|
|
|
#include <QMenu>
|
|
|
|
#include <QContextMenuEvent>
|
|
|
|
#include <QContextMenuEvent>
|
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
|
|
|
|
|
|
|
|
#include "../../model/world/data.hpp"
|
|
|
|
#include "../../model/world/data.hpp"
|
|
|
|
#include "../../model/world/commands.hpp"
|
|
|
|
#include "../../model/world/commands.hpp"
|
|
|
@ -477,24 +478,25 @@ void CSVWorld::Table::mouseMoveEvent (QMouseEvent* event)
|
|
|
|
|
|
|
|
|
|
|
|
void CSVWorld::Table::dragEnterEvent(QDragEnterEvent *event)
|
|
|
|
void CSVWorld::Table::dragEnterEvent(QDragEnterEvent *event)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// QModelIndex index = indexAt (event->pos());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (dynamic_cast<const CSMWorld::TableMimeData*> (event->mimeData())->holdsType (mModel->getColumnDisplay (index.column())))
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
event->acceptProposedAction();
|
|
|
|
event->acceptProposedAction();
|
|
|
|
// }
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CSVWorld::Table::dropEvent(QDropEvent *event)
|
|
|
|
void CSVWorld::Table::dropEvent(QDropEvent *event)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QModelIndex index = indexAt (event->pos());
|
|
|
|
QModelIndex index = indexAt (event->pos());
|
|
|
|
|
|
|
|
|
|
|
|
CSMWorld::ColumnBase::Display display = static_cast<CSMWorld::ColumnBase::Display>(mModel->headerData(index.column(), Qt::Horizontal, CSMWorld::ColumnBase::Role_Display).toInt());
|
|
|
|
CSMWorld::ColumnBase::Display display = static_cast<CSMWorld::ColumnBase::Display>
|
|
|
|
|
|
|
|
(mModel->headerData(index.column(), Qt::Horizontal, CSMWorld::ColumnBase::Role_Display).toInt());
|
|
|
|
|
|
|
|
|
|
|
|
if (dynamic_cast<const CSMWorld::TableMimeData*>(event->mimeData())->holdsType(display))
|
|
|
|
if (dynamic_cast<const CSMWorld::TableMimeData*>(event->mimeData())->holdsType(display))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
event->acceptProposedAction();
|
|
|
|
const CSMWorld::TableMimeData* mime = dynamic_cast<const CSMWorld::TableMimeData*>(event->mimeData());
|
|
|
|
std::cout<<"Dropped/n";
|
|
|
|
CSMWorld::UniversalId record(mime->returnMatching(display));
|
|
|
|
} else {std::cout<<"Not Dropped\n";}
|
|
|
|
mUndoStack.push (new CSMWorld::ModifyCommand ( *mModel,
|
|
|
|
|
|
|
|
index,
|
|
|
|
|
|
|
|
QVariant(record.getId().c_str())
|
|
|
|
|
|
|
|
));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CSVWorld::Table::dragMoveEvent(QDragMoveEvent *event)
|
|
|
|
void CSVWorld::Table::dragMoveEvent(QDragMoveEvent *event)
|
|
|
|