Introduced multitype icon.

actorid
Marek Kochanowicz 11 years ago
parent 6662560cbc
commit 2afe3f3e57

@ -3,7 +3,6 @@
#include "universalid.hpp" #include "universalid.hpp"
#include "columnbase.hpp" #include "columnbase.hpp"
#include <iostream>
CSMWorld::TableMimeData::TableMimeData (UniversalId id) CSMWorld::TableMimeData::TableMimeData (UniversalId id)
{ {
@ -79,7 +78,6 @@ bool CSMWorld::TableMimeData::holdsType (CSMWorld::UniversalId::Type type) const
bool CSMWorld::TableMimeData::holdsType (CSMWorld::ColumnBase::Display type) const bool CSMWorld::TableMimeData::holdsType (CSMWorld::ColumnBase::Display type) const
{ {
std::cout<<type<<std::endl;
for (std::vector<UniversalId>::const_iterator it = mUniversalId.begin(); it != mUniversalId.end(); ++it) for (std::vector<UniversalId>::const_iterator it = mUniversalId.begin(); it != mUniversalId.end(); ++it)
{ {
if (it->getType() == convertEnums (type)) if (it->getType() == convertEnums (type))

@ -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)

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

@ -56,6 +56,7 @@
<file>spell.png</file> <file>spell.png</file>
<file>static.png</file> <file>static.png</file>
<file>weapon.png</file> <file>weapon.png</file>
<file>multitype.png</file>
<file alias="startup/create-addon">raster/startup/big/create-addon.png</file> <file alias="startup/create-addon">raster/startup/big/create-addon.png</file>
<file alias="startup/create-game">raster/startup/big/new-game.png</file> <file alias="startup/create-game">raster/startup/big/new-game.png</file>
<file alias="startup/edit-content">raster/startup/big/edit-content.png</file> <file alias="startup/edit-content">raster/startup/big/edit-content.png</file>

Loading…
Cancel
Save