[qet] qet/qet: [5662] Search and replace : improve the search for elements.

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 5662
Author:   blacksun
Date:     2018-12-26 21:32:11 +0100 (Wed, 26 Dec 2018)
Log Message:
-----------
Search and replace : improve the search for elements.

Modified Paths:
--------------
    trunk/sources/SearchAndReplace/ui/searchandreplacewidget.cpp
    trunk/sources/qetgraphicsitem/element.cpp

Modified: trunk/sources/SearchAndReplace/ui/searchandreplacewidget.cpp
===================================================================
--- trunk/sources/SearchAndReplace/ui/searchandreplacewidget.cpp	2018-12-23 19:00:00 UTC (rev 5661)
+++ trunk/sources/SearchAndReplace/ui/searchandreplacewidget.cpp	2018-12-26 20:32:11 UTC (rev 5662)
@@ -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 @@
 		}
 	}
 	
+	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;
 }
 

Modified: trunk/sources/qetgraphicsitem/element.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/element.cpp	2018-12-23 19:00:00 UTC (rev 5661)
+++ trunk/sources/qetgraphicsitem/element.cpp	2018-12-26 20:32:11 UTC (rev 5662)
@@ -1181,7 +1181,9 @@
 
 /**
  * @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;


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/