Ejemplo n.º 1
0
void
RuleConditionNFC::setUidsQml(const QVariantList &uids) {
    QSet<QByteArray> uidsSet;
    for (QVariantList::const_iterator i = uids.constBegin(); i != uids.constEnd(); ++i) {
        uidsSet << QByteArray::fromHex(i->toByteArray());
    }
    setUids(uidsSet);
}
Ejemplo n.º 2
0
void FSTReader::writeVariant(QBuffer& buffer, QVariantHash::const_iterator& it) {
    QByteArray key = it.key().toUtf8() + " = ";
    QVariantHash hashValue = it.value().toHash();
    if (hashValue.isEmpty()) {
        buffer.write(key + it.value().toByteArray() + "\n");
        return;
    }
    for (QVariantHash::const_iterator second = hashValue.constBegin(); second != hashValue.constEnd(); second++) {
        QByteArray extendedKey = key + second.key().toUtf8();
        QVariantList listValue = second.value().toList();
        if (listValue.isEmpty()) {
            buffer.write(extendedKey + " = " + second.value().toByteArray() + "\n");
            continue;
        }
        buffer.write(extendedKey);
        for (QVariantList::const_iterator third = listValue.constBegin(); third != listValue.constEnd(); third++) {
            buffer.write(" = " + third->toByteArray());
        }
        buffer.write("\n");
    }
}