45 if (klass.
contains(namespaceDelimiter)) {
49 m_classToHeader.
insert(klass, newHeader);
57 m_localIncludes.clear();
58 m_globalIncludes.clear();
59 m_includeBaseNames.
clear();
64 if (!includeFile.isEmpty())
65 m_globalIncludes.insert(includeFile);
67 writeHeaders(m_globalIncludes,
true);
68 writeHeaders(m_localIncludes,
false);
93 static const auto namespaceSeparator =
"::"_L1;
94 const int namespaceIndex = lowerClassName.
lastIndexOf(namespaceSeparator);
95 if (namespaceIndex != -1)
96 lowerClassName.
remove(0, namespaceIndex + namespaceSeparator.size());
97 if (m_includeBaseNames.
contains(lowerClassName)) {
108 qWarning(
"%s: Warning: generated header '%s' for class '%s'.",
126 insertIncludeForClass(
className, {},
false);
132 if (domHeader !=
nullptr && !domHeader->
text().
isEmpty()) {
158 OrderedSet &includes =
global ? m_globalIncludes : m_localIncludes;
160 const bool isNewHeader = includes.insert(
header).second;
165 m_includeBaseNames.
insert(lowerBaseName);
168void WriteIncludes::writeHeaders(
const OrderedSet &headers,
bool global)
178 m_output <<
"#include " << openingQuote << trimmed << closingQuote <<
'\n';
void acceptUI(DomUI *node) override
void acceptInclude(DomInclude *node) override
void doAdd(const QString &className, const DomCustomWidget *dcw=nullptr) override
QString attributeLocation() const
bool hasAttributeLocation() const
constexpr bool isEmpty() const noexcept
\inmodule QtCore \reentrant
QString completeBaseName() const
Returns the complete base name of the file without the path.
iterator insert(const Key &key, const T &value)
T value(const Key &key, const T &defaultValue=T()) const
bool contains(const Key &key) const
const_iterator constFind(const Key &key) const
const_iterator constEnd() const
bool contains(const T &value) const
iterator insert(const T &value)
QStringView trimmed() const noexcept
Strips leading and trailing whitespace and returns the result.
\macro QT_RESTRICTED_CAST_FROM_ASCII
qsizetype lastIndexOf(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
void clear()
Clears the contents of the string and makes it null.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QString toLower() const &
bool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
QString & remove(qsizetype i, qsizetype len)
Removes n characters from the string, starting at the given position index, and returns a reference t...
const Option & option() const
void acceptUI(DomUI *node) override
static QString moduleHeader(const QString &module, const QString &header)
QSet< QString >::iterator it
Combined button and popup list for selecting options.
static QString header(const QString &name)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define qPrintable(string)
QT_BEGIN_NAMESPACE typedef uchar * output
const char className[16]
[1]
ClassInfoEntries classInfoEntries()