mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
refs #614, allow CCached::NotifySlot to refer to a base class method
This commit is contained in:
committed by
Klaus Basan
parent
43f9515eaa
commit
bf2a84b67c
@@ -202,7 +202,7 @@ namespace BlackMisc
|
||||
BlackMisc::CData<BlackMisc::Simulation::Data::ModelCacheFs9> m_modelCacheFs9 {this, &CModelCaches::changedFs9 }; //!< FS9 cache
|
||||
BlackMisc::CData<BlackMisc::Simulation::Data::ModelCacheP3D> m_modelCacheP3D {this, &CModelCaches::changedP3D }; //!< P3D cache
|
||||
BlackMisc::CData<BlackMisc::Simulation::Data::ModelCacheXP> m_modelCacheXP {this, &CModelCaches::changedXP }; //!< XP cache
|
||||
BlackMisc::CData<BlackMisc::Simulation::Data::ModelCacheLastSelection> m_currentSimulator {this }; //!< surrent simulator
|
||||
BlackMisc::CData<BlackMisc::Simulation::Data::ModelCacheLastSelection> m_currentSimulator { this }; //!< current simulator
|
||||
};
|
||||
|
||||
//! Bundle of caches for model sets of all simulators
|
||||
|
||||
@@ -271,7 +271,7 @@ namespace BlackMisc
|
||||
//! Type of pointer to non-const member function of U taking no arguments and returning void,
|
||||
//! for slot parameter of CCached constructor.
|
||||
template <typename U>
|
||||
using NotifySlot = void (U::*)();
|
||||
using NotifySlot = Private::NonDeduced<void (U::*)()>;
|
||||
|
||||
//! Constructor.
|
||||
//! \param cache The CValueCache object which manages the value.
|
||||
|
||||
@@ -27,6 +27,21 @@ namespace BlackMisc
|
||||
namespace Private
|
||||
{
|
||||
|
||||
/*!
|
||||
* \private Identity type trait.
|
||||
*/
|
||||
template <typename T>
|
||||
struct Identity
|
||||
{
|
||||
using type = T;
|
||||
};
|
||||
|
||||
/*!
|
||||
* \private Trick to force a non-deduced context during template argument type deduction.
|
||||
*/
|
||||
template <typename T>
|
||||
using NonDeduced = typename Identity<T>::type;
|
||||
|
||||
/*!
|
||||
* \private QObject subclass used by CCached<T> class template for signal/slot communication with CValueCache.
|
||||
* An instance of this class is shared between all CCached<T> referring to the same CValueCache and owned by the same QObject,
|
||||
|
||||
Reference in New Issue
Block a user