10#include <QtCore/QStringList>
14using namespace Qt::StringLiterals;
17
18
21
22
26 m_names.insert(item.name());
30
31
32
33
36 if (
doc().omitEnumItemNames().contains(name))
37 return Access::Private;
38 return Access::Public;
42
43
46 for (
const auto &item : std::as_const(m_items)) {
47 if (item.name() == name)
54
55
56
59 auto it =
std::find_if(m_items.begin(), m_items.end(), [value](EnumItem ev) {
60 return ev.name() == value;
62 if (it != m_items.end())
67
68
69
70
71
83 m_flagsType = typedefNode;
84 typedefNode->setAssociatedEnum(
this);
88
89
90
91
92
93
94
95
96
97
106 if (nativeEnum && nativeEnum->enumNode()
107 && !enumValue.startsWith(
"%1."_L1.arg(nativeEnum->prefix())))
108 return "%1.%2"_L1.arg(nativeEnum->prefix(), enumValue);
111 if (isEnumType(Genus::QML)
112 && enumValue.section(
' ', 0, 0).contains(
'.'_L1))
116 const auto *self =
static_cast<
const Node *>(
this);
117 while (!node->isHeader() && node->parent()) {
118 parts.prepend(node->name());
119 if (node->parent() == self || node->parent()->name().isEmpty())
121 node = node->parent();
124 parts.append(name());
126 parts.append(enumValue);
127 const auto &delim = (genus() == Genus::QML) ?
"."_L1 :
"::"_L1;
128 return parts.join(delim);
void addChild(Node *child)
Adds the child to this node's child list and sets the child's parent pointer to this Aggregate.
Node * clone(Aggregate *parent) override
Clone this node on the heap and make the clone a child of parent.
void setFlagsType(TypedefNode *typedefNode)
void addItem(const EnumItem &item)
Add item to the enum type's item list.
QString itemValue(const QString &name) const
Returns the enum value associated with the enum name.
QString qualifiedValueName(const QString &enumValue) const
Returns the display name of the enumeration value enumValue for use in the constant column of a value...
void setSince(const QString &value, const QString &since)
Sets since information to a named enum value, if it exists in this enum.
Access itemAccess(const QString &name) const
Returns the access level of the enumeration item named name.
Interface implemented by Node subclasses that can refer to a C++ enum.
virtual const NativeEnum * nativeEnum() const =0
Encapsulates information about native (C++) enum values.
Combined button and popup list for selecting options.
The Node class is the base class for all the nodes in QDoc's parse tree.
const Doc & doc() const
Returns a reference to the node's Doc data member.
Aggregate * parent() const
Returns the node's parent pointer, that is, the aggregate under which the node is documented.
void setParent(Aggregate *n)
Sets the node's parent pointer to n.
Aggregate * declarationParent() const
Returns the aggregate in whose C++ scope the node was declared, or null if the node was not adopted b...