emit signal with types (will be connected to the tablesubview)

actorid
Marek Kochanowicz 11 years ago
parent dd95ed8e4c
commit d7a1abb30b

@ -6,6 +6,8 @@
#include "recordfilterbox.hpp"
#include <apps/opencs/model/world/tablemimedata.hpp>
CSVFilter::FilterBox::FilterBox (CSMWorld::Data& data, QWidget *parent)
: QWidget (parent)
{
@ -28,7 +30,18 @@ CSVFilter::FilterBox::FilterBox (CSMWorld::Data& data, QWidget *parent)
void CSVFilter::FilterBox::dropEvent (QDropEvent* event)
{
const CSMWorld::TableMimeData* mime = dynamic_cast<const CSMWorld::TableMimeData*> (event->mimeData());
std::vector<CSMWorld::UniversalId> records = mime->getData();
std::vector<CSMWorld::UniversalId::Type> types;
for (std::vector<CSMWorld::UniversalId>::iterator it = records.begin(); it != records.end(); ++it)
{
types.push_back(it->getType());
}
emit recordDropped(types);
}
void CSVFilter::FilterBox::dragEnterEvent (QDragEnterEvent* event)

@ -1,9 +1,12 @@
#ifndef CSV_FILTER_FILTERBOX_H
#define CSV_FILTER_FILTERBOX_H
#include <vector>
#include <QWidget>
#include "../../model/filter/node.hpp"
#include "../../model/world/universalid.hpp"
namespace CSMWorld
{
@ -29,6 +32,7 @@ namespace CSVFilter
signals:
void recordFilterChanged (boost::shared_ptr<CSMFilter::Node> filter);
void recordDropped (const std::vector<CSMWorld::UniversalId::Type>& types);
};
}

Loading…
Cancel
Save