refs #759 Allow cache value notification slot to be changed after construction.

Also allow slot to be any type of callable, including member function or lambda.
This commit is contained in:
Mathew Sutcliffe
2016-09-09 00:49:08 +01:00
committed by Roland Winklmeier
parent d24c17eba2
commit e01ae2be11
6 changed files with 71 additions and 52 deletions

View File

@@ -270,9 +270,12 @@ namespace BlackMiscTest
}
CValueCacheUser::CValueCacheUser(CValueCache *cache) :
m_value1(cache, "value1", "", validator, 0, this, &CValueCacheUser::ps_valueChanged),
m_value2(cache, "value2", "", validator, 0, this, &CValueCacheUser::ps_valueChanged)
{}
m_value1(cache, "value1", "", validator, 0, this),
m_value2(cache, "value2", "", validator, 0, this)
{
m_value1.setNotifySlot(&CValueCacheUser::ps_valueChanged);
m_value2.setNotifySlot(&CValueCacheUser::ps_valueChanged);
}
void CValueCacheUser::ps_valueChanged()
{