mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-23 12:39:43 +00:00
emit signal with types (will be connected to the tablesubview)
This commit is contained in:
parent
dd95ed8e4c
commit
d7a1abb30b
2 changed files with 17 additions and 0 deletions
|
@ -6,6 +6,8 @@
|
||||||
|
|
||||||
#include "recordfilterbox.hpp"
|
#include "recordfilterbox.hpp"
|
||||||
|
|
||||||
|
#include <apps/opencs/model/world/tablemimedata.hpp>
|
||||||
|
|
||||||
CSVFilter::FilterBox::FilterBox (CSMWorld::Data& data, QWidget *parent)
|
CSVFilter::FilterBox::FilterBox (CSMWorld::Data& data, QWidget *parent)
|
||||||
: QWidget (parent)
|
: QWidget (parent)
|
||||||
{
|
{
|
||||||
|
@ -28,7 +30,18 @@ CSVFilter::FilterBox::FilterBox (CSMWorld::Data& data, QWidget *parent)
|
||||||
|
|
||||||
void CSVFilter::FilterBox::dropEvent (QDropEvent* event)
|
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)
|
void CSVFilter::FilterBox::dragEnterEvent (QDragEnterEvent* event)
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
#ifndef CSV_FILTER_FILTERBOX_H
|
#ifndef CSV_FILTER_FILTERBOX_H
|
||||||
#define CSV_FILTER_FILTERBOX_H
|
#define CSV_FILTER_FILTERBOX_H
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
#include "../../model/filter/node.hpp"
|
#include "../../model/filter/node.hpp"
|
||||||
|
#include "../../model/world/universalid.hpp"
|
||||||
|
|
||||||
namespace CSMWorld
|
namespace CSMWorld
|
||||||
{
|
{
|
||||||
|
@ -29,6 +32,7 @@ namespace CSVFilter
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
void recordFilterChanged (boost::shared_ptr<CSMFilter::Node> filter);
|
void recordFilterChanged (boost::shared_ptr<CSMFilter::Node> filter);
|
||||||
|
void recordDropped (const std::vector<CSMWorld::UniversalId::Type>& types);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue