mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 13:36:48 +08:00
CValueMap generic representation of a value object as a map of QVariants
refs #81
This commit is contained in:
committed by
Mathew Sutcliffe
parent
a280d239e6
commit
bf1837b414
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user