Search and replace : improve the search for elements.

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5662 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2018-12-26 20:32:11 +00:00
parent 0e60c95513
commit d45c070e16
2 changed files with 22 additions and 1 deletions

View File

@@ -29,6 +29,8 @@
#include "qetapp.h"
#include "replaceconductordialog.h"
#include "replaceadvanceddialog.h"
#include "dynamicelementtextitem.h"
#include "elementtextitemgroup.h"
#include <QSettings>
@@ -761,6 +763,23 @@ QStringList SearchAndReplaceWidget::searchTerms(Element *element)
}
}
for (DynamicElementTextItem *deti : element->dynamicTextItems())
{
if (deti->textFrom() == DynamicElementTextItem::UserText || deti->textFrom() == DynamicElementTextItem::CompositeText) {
list.append(deti->toPlainText());
}
}
for (ElementTextItemGroup *group : element->textGroups())
{
list.append(group->name());
for (DynamicElementTextItem *deti : group->texts()) {
if (deti->textFrom() == DynamicElementTextItem::UserText || deti->textFrom() == DynamicElementTextItem::CompositeText) {
list.append(deti->toPlainText());
}
}
}
return list;
}

View File

@@ -1181,7 +1181,9 @@ void Element::removeDynamicTextItem(DynamicElementTextItem *deti)
/**
* @brief Element::dynamicTextItems
* @return all dynamic text items of this element
* @return all dynamic text items of this element directly child of this element.
* Texts in text-groups belonging to this element are not returned by this function.
* @see ElementTextItemGroup::texts
*/
QList<DynamicElementTextItem *> Element::dynamicTextItems() const {
return m_dynamic_text_list;