diff --git a/qrenderdoc/Widgets/AnnotationDisplay.cpp b/qrenderdoc/Widgets/AnnotationDisplay.cpp index 4c95f9216..32124b83f 100644 --- a/qrenderdoc/Widgets/AnnotationDisplay.cpp +++ b/qrenderdoc/Widgets/AnnotationDisplay.cpp @@ -24,6 +24,7 @@ #include "AnnotationDisplay.h" #include +#include #include #include #include @@ -132,7 +133,21 @@ bool AnnotationDisplay::shouldBeDisplayed(const SDObject &obj) void AnnotationDisplay::addStructuredChildren(RDTreeWidgetItem *parent, const SDObject &parentObj) { + QCollator collator; + collator.setNumericMode(true); + collator.setCaseSensitivity(Qt::CaseInsensitive); + + rdcarray children; + children.reserve(parentObj.NumChildren()); for(const SDObject *obj : parentObj) + children.push_back(obj); + + if(parentObj.type.basetype != SDBasic::Array) + std::sort(children.begin(), children.end(), [&collator](const SDObject *a, const SDObject *b) { + return collator.compare(QString(a->name), QString(b->name)) < 0; + }); + + for(const SDObject *obj : children) { if(!shouldBeDisplayed(*obj)) continue;