PropertyStorage <-> QVariantMap
This commit is contained in:
@@ -2,6 +2,23 @@
|
||||
#include "qad_types.h"
|
||||
|
||||
|
||||
PropertyStorage::PropertyStorage(const QVariantMap & pl) {
|
||||
QMapIterator<QString, QVariant> it(pl);
|
||||
while (it.hasNext()) {
|
||||
it.next();
|
||||
props << Property(it.key(), "", it.value());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
QVariantMap PropertyStorage::toVariantMap() const {
|
||||
QVariantMap ret;
|
||||
foreach (const Property & p, props)
|
||||
ret[p.name] = p.value;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
bool PropertyStorage::isPropertyExists(const QString & _name) const {
|
||||
for (int i = 0; i < props.size(); ++i)
|
||||
if (props[i].name == _name)
|
||||
|
||||
Reference in New Issue
Block a user