mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 01:45:38 +08:00
Issue #77 Break cyclic dependency between CVariant and CVariantList
This commit is contained in:
@@ -12,6 +12,9 @@
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
//! \private
|
||||
extern int qMetaTypeId_CVariantList; // defined in variant.cpp
|
||||
|
||||
CVariantList::CVariantList(const CSequence &other) : CSequence(other)
|
||||
{}
|
||||
|
||||
@@ -25,16 +28,12 @@ namespace BlackMisc
|
||||
std::move(other.begin(), other.end(), std::back_inserter(*this));
|
||||
}
|
||||
|
||||
CVariantList::CVariantList(const QSequentialIterable &other)
|
||||
{
|
||||
for (auto it = other.begin(); it != other.end(); ++it) { push_back(*it); }
|
||||
}
|
||||
|
||||
void CVariantList::registerMetadata()
|
||||
{
|
||||
Mixin::MetaType<CVariantList>::registerMetadata();
|
||||
QMetaType::registerConverter<CVariantList, QVector<CVariant>>([](const CVariantList &list) { return list.toVector(); });
|
||||
QMetaType::registerConverter<QVector<CVariant>, CVariantList>([](const QVector<CVariant> &list) { return CSequence(list); });
|
||||
qMetaTypeId_CVariantList = qMetaTypeId<CVariantList>();
|
||||
}
|
||||
|
||||
bool CVariantList::matches(const CVariant &event) const
|
||||
|
||||
Reference in New Issue
Block a user