Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
cppwriteincludes.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#ifndef CPPWRITEINCLUDES_H
5#define CPPWRITEINCLUDES_H
6
7#include <writeincludesbase.h>
8
9#include <QtCore/qmap.h>
10
11#include <set>
12
14
15class QTextStream;
16
17namespace CPP {
18
20{
21public:
23
24 void acceptUI(DomUI *node) override;
25 void acceptInclude(DomInclude *node) override;
26
27protected:
28 QTextStream &output() const { return m_output; }
29 void doAdd(const QString &className, const DomCustomWidget *dcw = nullptr) override;
30
31private:
32 using OrderedSet = std::set<QString>;
33 void addCppCustomWidget(const QString &className, const DomCustomWidget *dcw);
34 void insertIncludeForClass(const QString &className, QString header = QString(), bool global = false);
35 void insertInclude(const QString &header, bool global);
36 void writeHeaders(const OrderedSet &headers, bool global);
37 QString headerForClassName(const QString &className) const;
38
39 QTextStream &m_output;
40
41 OrderedSet m_localIncludes;
42 OrderedSet m_globalIncludes;
43 QSet<QString> m_includeBaseNames;
44 using StringMap = QMap<QString, QString>;
45 StringMap m_classToHeader;
46 StringMap m_oldHeaderToNewHeader;
47};
48
49} // namespace CPP
50
52
53#endif // CPPWRITEINCLUDES_H
QTextStream & output() const
void acceptUI(DomUI *node) override
void acceptInclude(DomInclude *node) override
void doAdd(const QString &className, const DomCustomWidget *dcw=nullptr) override
Definition ui4.h:116
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition uic.h:30
const Uic * uic() const
Combined button and popup list for selecting options.
static QString header(const QString &name)
const char className[16]
[1]
Definition qwizard.cpp:100
QJSValue global