refs #247 CVariant can inherit from CValueObjectStdTuple.

But if valueobject.h includes variant.h then it would create a circular dependency.
This commit is contained in:
Mathew Sutcliffe
2014-11-14 00:12:47 +00:00
parent f68fc32f3d
commit 155b957cee
11 changed files with 88 additions and 132 deletions

View File

@@ -38,12 +38,20 @@ namespace BlackMisc
namespace MetaType
{
//! CValueObjectStdTuple registerMetadata policy which only registers with QMetaType and QtDBus
struct QMetaTypeAndDBusOnly
{
//! Register with QMetaType
template <class T, class...>
static void registerImpl() { qRegisterMetaType<T>(); qDBusRegisterMetaType<T>(); }
};
//! CValueObjectStdTuple default registerMetadata policy
struct Default
{
//! Register with QMetaType
template <class T, class...>
static void registerImpl() { qRegisterMetaType<T>(); qDBusRegisterMetaType<T>(); maybeRegisterMetaValueType<T>(); }
static void registerImpl() { QMetaTypeAndDBusOnly::registerImpl<T>(); maybeRegisterMetaValueType<T>(); }
private:
template <class T>