Introduced multitype icon.

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

@ -3,7 +3,6 @@
#include "universalid.hpp"
#include "columnbase.hpp"
#include <iostream>
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
{
std::cout<<type<<std::endl;
for (std::vector<UniversalId>::const_iterator it = mUniversalId.begin(); it != mUniversalId.end(); ++it)
{
if (it->getType() == convertEnums (type))

@ -133,9 +133,9 @@ void CSVWorld::GenericCreator::create()
std::string id = getId();
std::auto_ptr<CSMWorld::CloneCommand> command (new CSMWorld::CloneCommand (
dynamic_cast<CSMWorld::IdTable&> (*mData.getTableModel(mListId)), mClonedId, id, mClonedType));
mUndoStack.push(command.release());
emit done();
emit requestFocus(id);
} else {

@ -6,6 +6,7 @@
#include <QAction>
#include <QMenu>
#include <QContextMenuEvent>
#include <QString>
#include "../../model/world/data.hpp"
#include "../../model/world/commands.hpp"
@ -477,27 +478,28 @@ void CSVWorld::Table::mouseMoveEvent (QMouseEvent* 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();
// }
}
void CSVWorld::Table::dropEvent(QDropEvent *event)
{
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))
{
event->acceptProposedAction();
std::cout<<"Dropped/n";
} else {std::cout<<"Not Dropped\n";}
const CSMWorld::TableMimeData* mime = dynamic_cast<const CSMWorld::TableMimeData*>(event->mimeData());
CSMWorld::UniversalId record(mime->returnMatching(display));
mUndoStack.push (new CSMWorld::ModifyCommand ( *mModel,
index,
QVariant(record.getId().c_str())
));
}
}
void CSVWorld::Table::dragMoveEvent(QDragMoveEvent *event)
{
event->accept();
event->accept();
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

@ -56,6 +56,7 @@
<file>spell.png</file>
<file>static.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-game">raster/startup/big/new-game.png</file>
<file alias="startup/edit-content">raster/startup/big/edit-content.png</file>

Loading…
Cancel
Save