forked from mirror/openmw-tes3mp
drag and drop works
This commit is contained in:
parent
fd4829141d
commit
cc1ceb35ce
2 changed files with 20 additions and 2 deletions
|
@ -24,6 +24,7 @@
|
|||
#include "../../model/world/idtable.hpp"
|
||||
#include "../../model/world/columns.hpp"
|
||||
#include "../../model/world/record.hpp"
|
||||
#include "../../model/world/tablemimedata.hpp"
|
||||
|
||||
#include "recordstatusdelegate.hpp"
|
||||
#include "util.hpp"
|
||||
|
@ -115,7 +116,19 @@ QWidget* CSVWorld::DialogueDelegateDispatcherProxy::getEditor() const
|
|||
|
||||
void CSVWorld::DialogueDelegateDispatcherProxy::tableMimeDataDropped(const std::vector<CSMWorld::UniversalId>& data)
|
||||
{
|
||||
std::cout<<"Test!"<<std::endl;
|
||||
for (unsigned i = 0; i < data.size(); ++i)
|
||||
{
|
||||
if (mDisplay == CSMWorld::TableMimeData::convertEnums(data[i].getType()))
|
||||
{
|
||||
QLineEdit* lineEdit = qobject_cast<QLineEdit*>(mEditor);
|
||||
if (lineEdit && mIndexWrapper.get())
|
||||
{
|
||||
lineEdit->setText(data[i].getId().c_str());
|
||||
emit editorDataCommited(mEditor, mIndexWrapper->mIndex, mDisplay);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
==============================DialogueDelegateDispatcher==========================================
|
||||
|
@ -242,6 +255,11 @@ QWidget* CSVWorld::DialogueDelegateDispatcher::makeEditor(CSMWorld::ColumnBase::
|
|||
connect(editor, SIGNAL(currentIndexChanged (int)), proxy, SLOT(editorDataCommited()));
|
||||
skip = true;
|
||||
}
|
||||
if(!skip && qobject_cast<QAbstractSpinBox*>(editor))
|
||||
{
|
||||
connect(editor, SIGNAL(editingFinished()), proxy, SLOT(editorDataCommited()));
|
||||
skip = true;
|
||||
}
|
||||
|
||||
connect(proxy, SIGNAL(editorDataCommited(QWidget*, const QModelIndex&, CSMWorld::ColumnBase::Display)), this, SLOT(editorDataCommited(QWidget*, const QModelIndex&, CSMWorld::ColumnBase::Display)));
|
||||
mProxys.push_back(proxy); //deleted in the destructor
|
||||
|
|
|
@ -90,7 +90,7 @@ namespace CSVWorld
|
|||
|
||||
QObject* mParent;
|
||||
|
||||
CSMWorld::IdTable* mTable; //nor sure if it is needed TODO
|
||||
CSMWorld::IdTable* mTable;
|
||||
|
||||
QUndoStack& mUndoStack;
|
||||
|
||||
|
|
Loading…
Reference in a new issue