Continue revamp of elementprovider

This commit is contained in:
joshua
2022-06-13 20:46:22 +02:00
parent c83d4e5aea
commit 3e6e38e566
5 changed files with 19 additions and 45 deletions

View File

@@ -53,9 +53,9 @@ ElementProvider::ElementProvider(Diagram *diag) {
the filter for search element
@return
*/
QList <Element *> ElementProvider::freeElement(ElementData::Types filter) const
QVector <QPointer<Element>> ElementProvider::freeElement(ElementData::Types filter) const
{
QList<Element *> free_elmt;
QVector<QPointer<Element>> free_elmt;
QList<Element *> elmt_list;
//serch in all diagram
@@ -97,31 +97,6 @@ QList <Element *> ElementProvider::fromUuids(QList<QUuid> uuid_list) const
return found_element;
}
/**
@brief ElementProvider::find
Search and return the asked element corresponding with the given filter
@param filter
the filter for search element
(You can find all filter with the define in Element.h)
@obsolete use instead QVector<_Tp1> ElementProvider::find(ElementData::Type elmt_type) const
*/
QList <Element *> ElementProvider::find(const int filter) const
{
QList <Element *> elmt_;
//serch in all diagram
foreach (Diagram *d, m_diagram_list) {
//get all element in diagram d
QList <Element *> elmt_list;
elmt_list = d->elements();
foreach (Element *elmt, elmt_list) {
if (filter & elmt->linkType())
elmt_ << elmt;
}
}
return (elmt_);
}
/**
* @brief ElementProvider::find
* Search and return the element with the type given in parameter