summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@qt.io>2020-07-01 14:50:12 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2020-07-01 13:41:27 +0000
commitc9e9fd967b38f975e7c5743b7f5c4316df99121e (patch)
tree4cfa397b9db5a095c60c04faaf0bed314d5b05de
parent4a856f24d930e2a64039e65079c6edc32d2832e2 (diff)
downloadqttools-c9e9fd967b38f975e7c5743b7f5c4316df99121e.tar.gz
qdoc: Prefer sorting nodes based on the name
\generatelist and \annotatedlist commands sort the elements using Node::nodeNameLessThan(). For node types that are not page nodes (they do not generate a page of their own) or functions, the sorting function considered the location (i.e, file path of the declaration) over the actual name of the node/element. This is almost always incorrect as the preferred sort order is alphabetical, and the location is typically not visible in the user-visible docs. Fixes: QTBUG-85370 Change-Id: I37ae63e34fef966e3863749b3f0cafd9bc230ca0 Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit a08f730d49b14ac5e96ba7c10689a7d470f48f87) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/qdoc/node.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qdoc/node.cpp b/src/qdoc/node.cpp
index bf2fcd4f7..82306eeed 100644
--- a/src/qdoc/node.cpp
+++ b/src/qdoc/node.cpp
@@ -177,10 +177,10 @@ bool Node::nodeNameLessThan(const Node *n1, const Node *n2)
LT_RETURN_IF_NOT_EQUAL(f1->signature(false, false), f2->signature(false, false));
}
- LT_RETURN_IF_NOT_EQUAL(n1->location().filePath(), n2->location().filePath());
LT_RETURN_IF_NOT_EQUAL(n1->nodeType(), n2->nodeType());
LT_RETURN_IF_NOT_EQUAL(n1->name(), n2->name());
LT_RETURN_IF_NOT_EQUAL(n1->access(), n2->access());
+ LT_RETURN_IF_NOT_EQUAL(n1->location().filePath(), n2->location().filePath());
return false;
}