CValueMap generic representation of a value object as a map of QVariants

refs #81
This commit is contained in:
Klaus Basan
2013-12-22 20:47:01 +00:00
committed by Mathew Sutcliffe
parent a280d239e6
commit bf1837b414
6 changed files with 466 additions and 0 deletions

View File

@@ -8,6 +8,7 @@
#include "pqallquantities.h"
#include "mathallclasses.h"
#include "geoallclasses.h"
#include "valuemap.h"
/*
* Metadata for PQs
@@ -68,12 +69,24 @@ void BlackMisc::Geo::registerMetadata()
*/
void BlackMisc::registerMetadata()
{
// !! make sure the first id is correctly returned by
// !! firstBlackMetaType
CValueMap::registerMetadata();
PhysicalQuantities::registerMetadata();
Aviation::registerMetadata();
Math::registerMetadata();
Geo::registerMetadata();
}
/*
* First of our ids
*/
int BlackMisc::firstBlackMetaType()
{
// must be the first registered above
return qMetaTypeId<CValueMap>();
}
/*
* Init resources
*/
@@ -279,3 +292,15 @@ QVariant BlackMisc::complexQtTypeFromDbusArgument(const QDBusArgument &argument,
return QVariant(); // suppress compiler warning
}
/*
* Dump all user types
*/
void BlackMisc::displayAllUserMetatypesTypes()
{
for (int mt = QMetaType::User; mt < QMetaType::User + 1000; mt++)
{
if (!QMetaType::isRegistered(mt)) continue;
QMetaType metaType(mt);
qDebug() << "type:" << mt << "name:" << QMetaType::typeName(mt) << QMetaType::sizeOf(mt) << BlackMisc::heapSizeOf(metaType);
}
}