diff --git a/src/qdoc/generator.cpp b/src/qdoc/generator.cpp
index 9f7e65205eb9e3330150da836b8d5dc650c49fd3..e7088c61063908c976540392745e4385a95ef0c4 100644
--- a/src/qdoc/generator.cpp
+++ b/src/qdoc/generator.cpp
@@ -205,10 +205,8 @@ int Generator::appendSortedNames(Text &text, const ClassNode *cn, const QList<Re
         ++r;
     }
 
-    QStringList classNames = classMap.keys();
-    classNames.sort();
-
-    for (const auto &className : qAsConst(classNames)) {
+    const QStringList classNames = classMap.keys();
+    for (const auto &className : classNames) {
         text << classMap[className];
         text << comma(index++, classNames.count());
     }
@@ -229,10 +227,8 @@ int Generator::appendSortedQmlNames(Text &text, const Node *base, const NodeList
         }
     }
 
-    QStringList names = classMap.keys();
-    names.sort();
-
-    for (const auto &name : qAsConst(names)) {
+    const QStringList names = classMap.keys();
+    for (const auto &name : names) {
         text << classMap[name];
         text << comma(index++, names.count());
     }
diff --git a/src/qdoc/node.cpp b/src/qdoc/node.cpp
index f4bfcbc18fd841b655f249fdfaa0374ac143e5ae..06f2d6bd66a5ba223f2888a1d1d20273fed87c20 100644
--- a/src/qdoc/node.cpp
+++ b/src/qdoc/node.cpp
@@ -2291,7 +2291,7 @@ const NodeList &Aggregate::nonfunctionList()
  */
 const EnumNode *Aggregate::findEnumNodeForValue(const QString &enumValue) const
 {
-    for (const auto *node : qAsConst(enumChildren_)) {
+    for (const auto *node : enumChildren_) {
         const EnumNode *en = static_cast<const EnumNode *>(node);
         if (en->hasItem(enumValue))
             return en;
@@ -2699,9 +2699,9 @@ void Aggregate::findAllNamespaces(NodeMultiMap &namespaces)
   Returns true if this aggregate contains at least one child
   that is marked obsolete. Otherwise returns false.
  */
-bool Aggregate::hasObsoleteMembers()
+bool Aggregate::hasObsoleteMembers() const
 {
-    for (const auto *node : qAsConst(children_)) {
+    for (const auto *node : children_) {
         if (!node->isPrivate() && node->isObsolete()) {
             if (node->isFunction() || node->isProperty() || node->isEnumType() ||
                 node->isTypedef() || node->isTypeAlias() || node->isVariable() ||
diff --git a/src/qdoc/node.h b/src/qdoc/node.h
index 5530e1088b837c8678bc848aeee81e4fb63bf5bf..71a603146dc42ac6e20e62e6dfedef2c9f1d3e2f 100644
--- a/src/qdoc/node.h
+++ b/src/qdoc/node.h
@@ -485,7 +485,7 @@ public:
     void findAllFunctions(NodeMapMap &functionIndex);
     void findAllNamespaces(NodeMultiMap &namespaces);
     void findAllAttributions(NodeMultiMap &attributions);
-    bool hasObsoleteMembers();
+    bool hasObsoleteMembers() const;
     void findAllObsoleteThings();
     void findAllClasses();
     void findAllSince();