diff --git a/src/QtHelpers/TreeViewMemoryFields.cpp b/src/QtHelpers/TreeViewMemoryFields.cpp index d118978..355cdb0 100644 --- a/src/QtHelpers/TreeViewMemoryFields.cpp +++ b/src/QtHelpers/TreeViewMemoryFields.cpp @@ -752,13 +752,18 @@ void S2Plugin::TreeViewMemoryFields::updateRow(int row, std::optional } case MemoryFieldType::Float: { - std::optional value; - value = updateField(itemField, valueMemoryOffset, itemValue, "%f", itemValueHex, isPointer, "0x%08X", true, !pointerUpdate, highlightColor); + std::optional value; + value = updateField(itemField, valueMemoryOffset, itemValue, nullptr, itemValueHex, isPointer, "0x%08X", true, !pointerUpdate, highlightColor); + if (value.has_value()) + itemValue->setData(QString::asprintf("%f", reinterpret_cast(value.value())), Qt::DisplayRole); if (comparisonActive) { - std::optional comparisonValue; - comparisonValue = updateField(itemField, valueComparisonMemoryOffset, itemComparisonValue, "%f", itemComparisonValueHex, isPointer, "0x%08X", false, false, highlightColor); + std::optional comparisonValue; + comparisonValue = + updateField(itemField, valueComparisonMemoryOffset, itemComparisonValue, nullptr, itemComparisonValueHex, isPointer, "0x%08X", false, false, highlightColor); + if (comparisonValue.has_value()) + itemComparisonValue->setData(QString::asprintf("%f", reinterpret_cast(comparisonValue.value())), Qt::DisplayRole); itemComparisonValue->setBackground(value != comparisonValue ? comparisonDifferenceColor : Qt::transparent); if (isPointer == false) @@ -768,13 +773,18 @@ void S2Plugin::TreeViewMemoryFields::updateRow(int row, std::optional } case MemoryFieldType::Double: { - std::optional value; - value = updateField(itemField, valueMemoryOffset, itemValue, "%lf", itemValueHex, isPointer, "0x%016llX", true, !pointerUpdate, highlightColor); + std::optional value; + value = updateField(itemField, valueMemoryOffset, itemValue, nullptr, itemValueHex, isPointer, "0x%016llX", true, !pointerUpdate, highlightColor); + if (value.has_value()) + itemValue->setData(QString::asprintf("%lf", reinterpret_cast(value.value())), Qt::DisplayRole); if (comparisonActive) { - std::optional comparisonValue; - comparisonValue = updateField(itemField, valueComparisonMemoryOffset, itemComparisonValue, "%lf", itemComparisonValueHex, isPointer, "0x%016llX", false, false, highlightColor); + std::optional comparisonValue; + comparisonValue = + updateField(itemField, valueComparisonMemoryOffset, itemComparisonValue, nullptr, itemComparisonValueHex, isPointer, "0x%016llX", false, false, highlightColor); + if (comparisonValue.has_value()) + itemComparisonValue->setData(QString::asprintf("%lf", reinterpret_cast(comparisonValue.value())), Qt::DisplayRole); itemComparisonValue->setBackground(value != comparisonValue ? comparisonDifferenceColor : Qt::transparent); if (isPointer == false)