本文整理汇总了C++中QVariantList::removeLast方法的典型用法代码示例。如果您正苦于以下问题:C++ QVariantList::removeLast方法的具体用法?C++ QVariantList::removeLast怎么用?C++ QVariantList::removeLast使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QVariantList
的用法示例。
在下文中一共展示了QVariantList::removeLast方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: deserializeInitDynamicPacket
void deserializeInitDynamicPacket(QDataStream &in, QMetaObjectBuilder &builder, QVariantList &values)
{
quint32 numSignals = 0;
quint32 numMethods = 0;
quint32 numProperties = 0;
in >> numSignals;
in >> numMethods;
int curIndex = 0;
for (quint32 i = 0; i < numSignals; ++i) {
QByteArray signature;
in >> signature;
++curIndex;
builder.addSignal(signature);
}
for (quint32 i = 0; i < numMethods; ++i) {
QByteArray signature, returnType;
in >> signature;
in >> returnType;
++curIndex;
const bool isVoid = returnType.isEmpty() || returnType == QByteArrayLiteral("void");
if (isVoid)
builder.addMethod(signature);
else
builder.addMethod(signature, QByteArrayLiteral("QRemoteObjectPendingCall"));
}
in >> numProperties;
const quint32 initialListSize = values.size();
if (static_cast<quint32>(values.size()) < numProperties)
values.reserve(numProperties);
else if (static_cast<quint32>(values.size()) > numProperties)
for (quint32 i = numProperties; i < initialListSize; ++i)
values.removeLast();
for (quint32 i = 0; i < numProperties; ++i) {
QByteArray name;
QByteArray typeName;
QByteArray signalName;
in >> name;
in >> typeName;
in >> signalName;
if (signalName.isEmpty())
builder.addProperty(name, typeName);
else
builder.addProperty(name, typeName, builder.indexOfSignal(signalName));
QVariant value;
in >> value;
if (i < initialListSize)
values[i] = value;
else
values.append(value);
}
}
示例2: walkCondition
bool Nuria::LazyConditionWalker::walkVariant (QVariant &variant, QVariantList &stack, bool walkArguments) {
bool changed = false;
int type = variant.userType ();
stack.append (variant);
if (type == qMetaTypeId< LazyCondition > ()) {
changed = walkCondition (variant, stack, walkArguments);
} else if (type == qMetaTypeId< Field > ()) {
changed = walkField (variant, stack, walkArguments);
} else {
changed = invokeHandler (variant, this->d->variant, variant.userType (), stack);
}
// Pop stack and return
stack.removeLast ();
return changed;
}