mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
Nomenclature now use properly the element type 'thumbnail'
Use function provided by ElementData to check element type and master type instead of use plain text (code is more strong)
This commit is contained in:
@@ -96,6 +96,7 @@ QList <Element *> ElementProvider::fromUuids(QList<QUuid> uuid_list) const
|
||||
@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
|
||||
{
|
||||
@@ -114,6 +115,29 @@ QList <Element *> ElementProvider::find(const int filter) const
|
||||
return (elmt_);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ElementProvider::find
|
||||
* Search and return the element with the type given in parameter
|
||||
* @param elmt_type
|
||||
* @return
|
||||
*/
|
||||
QVector<QPointer<Element>> ElementProvider::find(ElementData::Types elmt_type) const
|
||||
{
|
||||
QVector<QPointer<Element>> returned_vector;
|
||||
for (const auto &diagram_ : qAsConst(m_diagram_list))
|
||||
{
|
||||
const auto elmt_list = diagram_->elements();
|
||||
for (const auto &elmt_ : elmt_list)
|
||||
{
|
||||
if (elmt_type & elmt_->elementData().m_type) {
|
||||
returned_vector << QPointer<Element>(elmt_);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return returned_vector;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief ElementProvider::table
|
||||
@param table
|
||||
|
||||
Reference in New Issue
Block a user