本文整理汇总了C++中QMetaObjectBuilder::removeMethod方法的典型用法代码示例。如果您正苦于以下问题:C++ QMetaObjectBuilder::removeMethod方法的具体用法?C++ QMetaObjectBuilder::removeMethod怎么用?C++ QMetaObjectBuilder::removeMethod使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QMetaObjectBuilder
的用法示例。
在下文中一共展示了QMetaObjectBuilder::removeMethod方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeSlot
bool Test::removeSlot(const QString &slot)
{
if (d->slotId2Name.key(slot, -1) == -1)
return false;
QDataStream istream(d->metadata);
QMetaObjectBuilder builder;
QMap<QByteArray, const QMetaObject*> refs;
builder.deserialize(istream, refs);
int metaIndex = d->slotId2Name.key(slot);
builder.removeMethod(metaIndex - d->meta->methodOffset());
d->slotId2Name.remove(metaIndex);
if (d->meta)
free(d->meta);
d->meta = builder.toMetaObject();
QDataStream ostream(&d->metadata, QIODevice::WriteOnly);
builder.serialize(ostream);
return true;
}
示例2: removeSignal
bool Test::removeSignal(const QString &signal)
{
if (d->signalName2Id.value(signal, -1) == -1)
return false;
QDataStream istream(d->metadata);
QMetaObjectBuilder builder;
QMap<QByteArray, const QMetaObject*> refs;
builder.deserialize(istream, refs);
int metaIndex = d->signalName2Id.value(signal) - d->meta->methodOffset();
d->signalName2Id.remove(signal);
builder.removeMethod(metaIndex);
if (d->meta)
free(d->meta);
d->meta = builder.toMetaObject();
QDataStream ostream(&d->metadata, QIODevice::WriteOnly);
builder.serialize(ostream);
return true;
}