Added natural registers sorting in RegistersWidget (#1591)

This commit is contained in:
rrockru 2019-05-27 10:55:09 +03:00 committed by Itay Cohen
parent 6c76c85c97
commit adf28e4362

View File

@ -4,6 +4,7 @@
#include "core/MainWindow.h"
#include <QCollator>
#include <QLabel>
#include <QLineEdit>
@ -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());