mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-19 22:53:53 +00:00
Propagate signal to the edit widget
This commit is contained in:
parent
fca7701359
commit
c7b3e139aa
7 changed files with 25 additions and 18 deletions
|
@ -56,3 +56,17 @@ void CSVFilter::EditWidget::filterRowsInserted (const QModelIndex& parent, int s
|
|||
{
|
||||
textChanged (text());
|
||||
}
|
||||
|
||||
void CSVFilter::EditWidget::createFilterRequest (std::vector< std::pair< std::string, std::vector< std::string > > >& filterSource)
|
||||
{
|
||||
for (unsigned i = 0; i < filterSource.size(); ++i) //test
|
||||
{
|
||||
std::cout<<filterSource[i].first<<std::endl;
|
||||
std::cout<<"Columns:\n";
|
||||
for (unsigned j = 0; j < filterSource[i].second.size(); ++j)
|
||||
{
|
||||
std::cout<<filterSource[i].second[j]<<std::endl;
|
||||
}
|
||||
std::cout<<"\n";
|
||||
}
|
||||
}
|
|
@ -42,6 +42,8 @@ namespace CSVFilter
|
|||
void filterRowsRemoved (const QModelIndex& parent, int start, int end);
|
||||
|
||||
void filterRowsInserted (const QModelIndex& parent, int start, int end);
|
||||
|
||||
void createFilterRequest(std::vector<std::pair<std::string, std::vector<std::string> > >& filterSource);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,9 @@ CSVFilter::FilterBox::FilterBox (CSMWorld::Data& data, QWidget *parent)
|
|||
SIGNAL (filterChanged (boost::shared_ptr<CSMFilter::Node>)),
|
||||
this, SIGNAL (recordFilterChanged (boost::shared_ptr<CSMFilter::Node>)));
|
||||
|
||||
connect(this, SIGNAL(createFilterRequest(std::vector<std::pair<std::string, std::vector<std::string> > >&)),
|
||||
recordFilterBox, SIGNAL(createFilterRequest(std::vector<std::pair<std::string, std::vector<std::string> > >&)));
|
||||
|
||||
setAcceptDrops(true);
|
||||
}
|
||||
|
||||
|
@ -44,17 +47,3 @@ void CSVFilter::FilterBox::dragMoveEvent (QDragMoveEvent* event)
|
|||
{
|
||||
event->accept();
|
||||
}
|
||||
|
||||
void CSVFilter::FilterBox::createFilter (std::vector< std::pair< std::string, std::vector< std::string > > >& filterSource)
|
||||
{
|
||||
for (unsigned i = 0; i < filterSource.size(); ++i) //test
|
||||
{
|
||||
std::cout<<filterSource[i].first<<std::endl;
|
||||
std::cout<<"Columns:\n";
|
||||
for (unsigned j = 0; j < filterSource[i].second.size(); ++j)
|
||||
{
|
||||
std::cout<<filterSource[i].second[j]<<std::endl;
|
||||
}
|
||||
std::cout<<"\n";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,13 +29,11 @@ namespace CSVFilter
|
|||
|
||||
FilterBox (CSMWorld::Data& data, QWidget *parent = 0);
|
||||
|
||||
public slots:
|
||||
void createFilter(std::vector<std::pair<std::string, std::vector<std::string> > >& filterSource);
|
||||
|
||||
signals:
|
||||
|
||||
void recordFilterChanged (boost::shared_ptr<CSMFilter::Node> filter);
|
||||
void recordDropped (std::vector<CSMWorld::UniversalId>& types);
|
||||
void createFilterRequest(std::vector<std::pair<std::string, std::vector<std::string> > >& filterSource);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -24,4 +24,7 @@ CSVFilter::RecordFilterBox::RecordFilterBox (CSMWorld::Data& data, QWidget *pare
|
|||
connect (
|
||||
editWidget, SIGNAL (filterChanged (boost::shared_ptr<CSMFilter::Node>)),
|
||||
this, SIGNAL (filterChanged (boost::shared_ptr<CSMFilter::Node>)));
|
||||
|
||||
connect(this, SIGNAL(createFilterRequest(std::vector<std::pair<std::string, std::vector<std::string> > >&)),
|
||||
editWidget, SLOT(createFilterRequest(std::vector<std::pair<std::string, std::vector<std::string> > >&)));
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ namespace CSVFilter
|
|||
signals:
|
||||
|
||||
void filterChanged (boost::shared_ptr<CSMFilter::Node> filter);
|
||||
void createFilterRequest(std::vector<std::pair<std::string, std::vector<std::string> > >& filterSource);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ CSVWorld::TableSubView::TableSubView (const CSMWorld::UniversalId& id, CSMDoc::D
|
|||
this, SLOT(createFilterRequest(std::vector<CSMWorld::UniversalId>&)));
|
||||
|
||||
connect(this, SIGNAL(createFilterRequest(std::vector<std::pair<std::string, std::vector<std::string> > >&)),
|
||||
filterBox, SLOT(createFilter(std::vector<std::pair<std::string, std::vector<std::string> > >&)));
|
||||
filterBox, SIGNAL(createFilterRequest(std::vector<std::pair<std::string, std::vector<std::string> > >&)));
|
||||
}
|
||||
|
||||
void CSVWorld::TableSubView::setEditLock (bool locked)
|
||||
|
|
Loading…
Reference in a new issue