From 9cd021f517e55abc31b3fd9e405ea94ce9eda44d Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 15 Jan 2019 13:31:21 +0100 Subject: uic: Refactor reverse name lookup Add a helper routine to look up the dom classes by attribute name and change Driver::widgetByName() and Driver::actionByName() to use that as does Driver::actionGroupByName() (all these functions are called with names from the XML files). Remove the name normalization in WriteInitialization::findDeclaration() and refactor WriteInitialization::acceptActionRef() to call findOrInsert() to correctly use the unique name. Task-number: PYSIDE-797 Change-Id: I34058361964719c442182faf798f055f11b40412 Reviewed-by: Cristian Maureira-Fredes --- src/tools/uic/driver.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/tools/uic/driver.h') diff --git a/src/tools/uic/driver.h b/src/tools/uic/driver.h index 69206e1608..1e50f78746 100644 --- a/src/tools/uic/driver.h +++ b/src/tools/uic/driver.h @@ -94,6 +94,9 @@ public: private: template using DomObjectHash = QHash; + template + const DomClass *findByAttributeName(const DomObjectHash &domHash, + const QString &name) const; template QString findOrInsert(DomObjectHash *domHash, const DomClass *dom, const QString &className); -- cgit v1.2.3