本文整理汇总了C++中QVariantMap::cend方法的典型用法代码示例。如果您正苦于以下问题:C++ QVariantMap::cend方法的具体用法?C++ QVariantMap::cend怎么用?C++ QVariantMap::cend使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QVariantMap
的用法示例。
在下文中一共展示了QVariantMap::cend方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parse
static Task::List parse(const QVariant &data)
{
const QVariantMap results = data.toMap();
Task::List tasks;
tasks.reserve(results.size());
for (auto iter = results.cbegin(), end = results.cend(); iter != end; ++iter) {
const QVariantMap d = iter.value().toMap();
Task task;
task.d_ptr->phid = iter.key().toLatin1();
task.d_ptr->id = d[QStringLiteral("id")].toUInt();
task.d_ptr->authorPHID = d[QStringLiteral("authorPHID")].toByteArray();
task.d_ptr->ownerPHID = d[QStringLiteral("ownerPHID")].toByteArray();
const QVariantList ccPHIDs = d[QStringLiteral("ccPHIDs")].toList();
task.d_ptr->ccPHIDs.reserve(ccPHIDs.size());
Q_FOREACH (const QVariant &ccPHID, ccPHIDs) {
task.d_ptr->ccPHIDs.push_back(ccPHID.toByteArray());
}
task.d_ptr->status = d[QStringLiteral("status")].toString();
task.d_ptr->statusName = d[QStringLiteral("statusName")].toString();
task.d_ptr->isClosed = d[QStringLiteral("isClosed")].toBool();
task.d_ptr->priority = d[QStringLiteral("priority")].toString();
task.d_ptr->priorityColor = d[QStringLiteral("priorityColor")].toString();
task.d_ptr->title = d[QStringLiteral("title")].toString();
task.d_ptr->description = d[QStringLiteral("description")].toString();
const QVariantList projectPHIDs = d[QStringLiteral("projectPHIDs")].toList();
task.d_ptr->projectPHIDs.reserve(projectPHIDs.size());
Q_FOREACH (const QVariant &projectPHID, projectPHIDs) {
task.d_ptr->projectPHIDs.push_back(projectPHID.toByteArray());
}