summaryrefslogtreecommitdiffstats
path: root/src/tools/uic/cpp/cppwriteincludes.h
diff options
context:
space:
mode:
authorFriedemann Kleint <[email protected]>2021-05-03 09:47:12 +0200
committerFriedemann Kleint <[email protected]>2021-05-25 22:01:53 +0200
commit4b82c1c7278baf154a6a53fc8ce21f3b62d3479c (patch)
tree9bf20525ddc7320a7b5101f35234df6a7a2e4a8b /src/tools/uic/cpp/cppwriteincludes.h
parent6ecde6265a08163d47a834cb5591fdb22461d129 (diff)
uic: Extract a base class for WriteIncludes
Extract base class WriteIncludesBase from WriteIncludes which basically adds the dependent classes. Move the classlibmap there as well. Task-number: PYSIDE-1404 Change-Id: I899c7818cb96dd3b1af5f328cd20d64fbaf7755b Reviewed-by: Jarek Kobus <[email protected]> Reviewed-by: Christian Tismer <[email protected]>
Diffstat (limited to 'src/tools/uic/cpp/cppwriteincludes.h')
-rw-r--r--src/tools/uic/cpp/cppwriteincludes.h45
1 files changed, 6 insertions, 39 deletions
diff --git a/src/tools/uic/cpp/cppwriteincludes.h b/src/tools/uic/cpp/cppwriteincludes.h
index 9b9ac283fe7..4ff2a514fbc 100644
--- a/src/tools/uic/cpp/cppwriteincludes.h
+++ b/src/tools/uic/cpp/cppwriteincludes.h
@@ -29,79 +29,46 @@
#ifndef CPPWRITEINCLUDES_H
#define CPPWRITEINCLUDES_H
-#include "treewalker.h"
+#include <writeincludesbase.h>
-#include <qmap.h>
-#include <qset.h>
-#include <qstring.h>
+#include <QtCore/qmap.h>
#include <set>
QT_BEGIN_NAMESPACE
class QTextStream;
-class CustomWidgetsInfo;
-class Driver;
-class Uic;
namespace CPP {
-struct WriteIncludes : public TreeWalker
+class WriteIncludes : public WriteIncludesBase
{
+public:
WriteIncludes(Uic *uic);
void acceptUI(DomUI *node) override;
- void acceptWidget(DomWidget *node) override;
- void acceptLayout(DomLayout *node) override;
- void acceptSpacer(DomSpacer *node) override;
- void acceptProperty(DomProperty *node) override;
-
-//
-// actions
-//
- void acceptActionGroup(DomActionGroup *node) override;
- void acceptAction(DomAction *node) override;
- void acceptActionRef(DomActionRef *node) override;
-
-//
-// custom widgets
-//
- void acceptCustomWidgets(DomCustomWidgets *node) override;
- void acceptCustomWidget(DomCustomWidget *node) override;
-
-//
-// include hints
-//
- void acceptIncludes(DomIncludes *node) override;
void acceptInclude(DomInclude *node) override;
protected:
QTextStream &output() const { return m_output; }
-
-private:
- void add(const QString &className, bool determineHeader = true, const QString &header = QString(), bool global = false);
+ void doAdd(const QString &className, const DomCustomWidget *dcw = nullptr) override;
private:
using OrderedSet = std::set<QString>;
+ void addCppCustomWidget(const QString &className, const DomCustomWidget *dcw);
void insertIncludeForClass(const QString &className, QString header = QString(), bool global = false);
void insertInclude(const QString &header, bool global);
void writeHeaders(const OrderedSet &headers, bool global);
QString headerForClassName(const QString &className) const;
- const Uic *m_uic;
QTextStream &m_output;
OrderedSet m_localIncludes;
OrderedSet m_globalIncludes;
QSet<QString> m_includeBaseNames;
-
- QSet<QString> m_knownClasses;
-
using StringMap = QMap<QString, QString>;
StringMap m_classToHeader;
StringMap m_oldHeaderToNewHeader;
-
- bool m_laidOut = false;
};
} // namespace CPP