diff --git a/doc/qtcreator/src/howto/creator-only/creator-autotest.qdoc b/doc/qtcreator/src/howto/creator-only/creator-autotest.qdoc index 1f8990bf4e3..cae258a28bd 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-autotest.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-autotest.qdoc @@ -367,9 +367,9 @@ Cleanup Functions} or \uicontrol {Show Data Functions}. Double-click a function in the list to open its source code in the code editor. - The test cases are listed in alphabetic order. To list them in the order in - which they are defined in the source code, select \inlineimage leafsort.png - (\uicontrol {Sort Naturally}). + The test cases are listed in alphabetic, case insensitive order. To list + them in the order in which they are defined in the source code, + select \inlineimage leafsort.png (\uicontrol {Sort Naturally}). \section2 Running and Debugging Tests from Code Editor diff --git a/src/plugins/autotest/testtreeitem.cpp b/src/plugins/autotest/testtreeitem.cpp index 1b68a192c74..20c46076c6b 100644 --- a/src/plugins/autotest/testtreeitem.cpp +++ b/src/plugins/autotest/testtreeitem.cpp @@ -130,19 +130,23 @@ bool ITestTreeItem::lessThan(const ITestTreeItem *other, ITestTreeItem::SortMode case Alphabetically: if (lhs == rhs) return index().row() > other->index().row(); - return lhs > rhs; + return lhs.compare(rhs, Qt::CaseInsensitive) > 0; case Naturally: { - if (type() == GroupNode && other->type() == GroupNode) - return filePath() > other->filePath(); + if (type() == GroupNode && other->type() == GroupNode) { + return filePath().toString().compare(other->filePath().toString(), + Qt::CaseInsensitive) > 0; + } const Utils::Link &leftLink = data(0, LinkRole).value(); const Utils::Link &rightLink = other->data(0, LinkRole).value(); - if (leftLink.targetFilePath == rightLink.targetFilePath) { + const int comparison = leftLink.targetFilePath.toString().compare( + rightLink.targetFilePath.toString(), Qt::CaseInsensitive); + if (comparison == 0) { return leftLink.targetLine == rightLink.targetLine ? leftLink.targetColumn > rightLink.targetColumn : leftLink.targetLine > rightLink.targetLine; } - return leftLink.targetFilePath > rightLink.targetFilePath; + return comparison > 0; } } return true;