From adf28e4362327e3fc658cb8e39632805f2468047 Mon Sep 17 00:00:00 2001 From: rrockru <619735+rrockru@users.noreply.github.com> Date: Mon, 27 May 2019 10:55:09 +0300 Subject: [PATCH] Added natural registers sorting in RegistersWidget (#1591) --- src/widgets/RegistersWidget.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/widgets/RegistersWidget.cpp b/src/widgets/RegistersWidget.cpp index c4f603e5..27d4ea18 100644 --- a/src/widgets/RegistersWidget.cpp +++ b/src/widgets/RegistersWidget.cpp @@ -4,6 +4,7 @@ #include "core/MainWindow.h" +#include #include #include @@ -45,6 +46,11 @@ void RegistersWidget::setRegisterGrid() QJsonObject registerValues = Core()->getRegisterValues().object(); QJsonObject registerRefs = Core()->getRegisterJson(); QStringList registerNames = registerValues.keys(); + + QCollator collator; + collator.setNumericMode(true); + std::sort(registerNames.begin(), registerNames.end(), collator); + registerLen = registerValues.size(); for (const QString &key : registerNames) { regValue = RAddressString(registerValues[key].toVariant().toULongLong());