Inspector: Make properties editable :^)

This patch makes it possible to live-edit remote object properties by
simply double clicking on them in the property table view.

This is pretty neat! :^)
This commit is contained in:
Andreas Kling 2020-03-05 15:47:24 +01:00
parent 3edcaa9b99
commit b2be8466fb
Notes: sideshowbarker 2024-07-19 08:53:48 +09:00
5 changed files with 39 additions and 0 deletions

View file

@ -26,6 +26,7 @@
#include "RemoteObjectPropertyModel.h"
#include "RemoteObject.h"
#include "RemoteProcess.h"
RemoteObjectPropertyModel::RemoteObjectPropertyModel(RemoteObject& object)
: m_object(object)
@ -70,3 +71,12 @@ void RemoteObjectPropertyModel::update()
});
did_update();
}
void RemoteObjectPropertyModel::set_data(const GUI::ModelIndex& index, const GUI::Variant& new_value)
{
auto& property = m_properties[index.row()];
uintptr_t address = m_object.json.get("address").to_number<uintptr_t>();
RemoteProcess::the().set_property(address, property.name.to_string(), new_value.to_string());
property.value = new_value.to_string();
did_update();
}