Improved events API

This commit is contained in:
WerWolv
2021-01-21 10:53:12 +01:00
parent f0ab13ebc3
commit a641f27b7e
18 changed files with 73 additions and 64 deletions

View File

@@ -11,12 +11,12 @@
namespace hex {
ViewHashes::ViewHashes() : View("Hashes") {
View::subscribeEvent(Events::DataChanged, [this](const void*){
View::subscribeEvent(Events::DataChanged, [this](auto) {
this->m_shouldInvalidate = true;
});
View::subscribeEvent(Events::RegionSelected, [this](const void *userData) {
Region region = *static_cast<const Region*>(userData);
View::subscribeEvent(Events::RegionSelected, [this](auto userData) {
auto region = std::any_cast<const Region>(userData);
if (this->m_shouldMatchSelection) {
this->m_hashRegion[0] = region.address;