Replace the class folioReportProperties by the class linkSingleElementWidget.

The new class does the same thing but is more flexible, this class is used by report and slave element
to find element to be linked and/or unlink an already linked element.


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2921 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2014-03-12 09:32:56 +00:00
parent cbbd9354cf
commit b74c5804be
15 changed files with 585 additions and 332 deletions

View File

@@ -21,7 +21,7 @@
/**
* @brief ElementProvider::ElementProvider Constructor
* @param prj the project where we must find element
* @param diagram the digram to exclude from the search
* @param diagram the diagram to exclude from the search
*/
ElementProvider::ElementProvider(QETProject *prj, Diagram *diagram)
{
@@ -29,6 +29,14 @@ ElementProvider::ElementProvider(QETProject *prj, Diagram *diagram)
diag_list.removeOne(diagram);
}
/**
* @brief ElementProvider::ElementProvider Constructor
* @param diag Diagram to search
*/
ElementProvider::ElementProvider(Diagram *diag) {
diag_list << diag;
}
/**
* @brief ElementProvider::FreeElement
* Search and return the asked element corresponding with the given filter
@@ -72,3 +80,26 @@ 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)
*/
QList <Element *> ElementProvider::find(const int filter) const {
QList <Element *> elmt_;
//serch in all diagram
foreach (Diagram *d, diag_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_);
}