forked from teamnwah/openmw-tes3coop
Merge branch 'DnD' of https://github.com/gugus/openmw into DragDrop
Conflicts: apps/opencs/view/world/table.cpp
This commit is contained in:
commit
8dfdd87a07
3 changed files with 40 additions and 8 deletions
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <qt4/QtCore/QMimeData>
|
#include <QtCore/QMimeData>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
#include "universalid.hpp"
|
#include "universalid.hpp"
|
||||||
|
|
|
@ -228,6 +228,8 @@ CSVWorld::Table::Table (const CSMWorld::UniversalId& id, CSMWorld::Data& data, Q
|
||||||
|
|
||||||
connect (selectionModel(), SIGNAL (selectionChanged (const QItemSelection&, const QItemSelection&)),
|
connect (selectionModel(), SIGNAL (selectionChanged (const QItemSelection&, const QItemSelection&)),
|
||||||
this, SLOT (selectionSizeUpdate ()));
|
this, SLOT (selectionSizeUpdate ()));
|
||||||
|
|
||||||
|
setAcceptDrops(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSVWorld::Table::setEditLock (bool locked)
|
void CSVWorld::Table::setEditLock (bool locked)
|
||||||
|
@ -446,5 +448,28 @@ void CSVWorld::Table::mouseMoveEvent (QMouseEvent* event)
|
||||||
drag->setMimeData (mime);
|
drag->setMimeData (mime);
|
||||||
drag->setPixmap (QString::fromStdString (mime->getIcon()));
|
drag->setPixmap (QString::fromStdString (mime->getIcon()));
|
||||||
drag->exec();
|
drag->exec();
|
||||||
|
std::cout << "startdrag";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSVWorld::Table::dragEnterEvent(QDragEnterEvent *event)
|
||||||
|
{
|
||||||
|
//if (event->mimeData()->hasFormat("text/plain"))
|
||||||
|
std::cout << "accept drag event";
|
||||||
|
event->acceptProposedAction();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSVWorld::Table::dropEvent(QDropEvent *event)
|
||||||
|
{
|
||||||
|
std::cout << "drop";
|
||||||
|
event->acceptProposedAction();
|
||||||
|
QModelIndex index = indexAt(event->pos());
|
||||||
|
std::cout << index.row();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSVWorld::Table::dragMoveEvent(QDragMoveEvent *event)
|
||||||
|
{
|
||||||
|
event->accept();
|
||||||
}
|
}
|
|
@ -5,7 +5,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include <QTableView>
|
#include <QTableView>
|
||||||
#include <qt4/QtGui/qevent.h>
|
#include <QtGui/qevent.h>
|
||||||
|
|
||||||
#include "../../model/filter/node.hpp"
|
#include "../../model/filter/node.hpp"
|
||||||
|
|
||||||
|
@ -52,6 +52,13 @@ namespace CSVWorld
|
||||||
|
|
||||||
void mouseMoveEvent(QMouseEvent *event);
|
void mouseMoveEvent(QMouseEvent *event);
|
||||||
|
|
||||||
|
void dragEnterEvent(QDragEnterEvent *event);
|
||||||
|
|
||||||
|
void dropEvent(QDropEvent *event);
|
||||||
|
|
||||||
|
void dragMoveEvent(QDragMoveEvent *event);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Table (const CSMWorld::UniversalId& id, CSMWorld::Data& data, QUndoStack& undoStack, bool createAndDelete, bool sorting);
|
Table (const CSMWorld::UniversalId& id, CSMWorld::Data& data, QUndoStack& undoStack, bool createAndDelete, bool sorting);
|
||||||
|
|
Loading…
Reference in a new issue