本文整理汇总了C++中Arguments::append方法的典型用法代码示例。如果您正苦于以下问题:C++ Arguments::append方法的具体用法?C++ Arguments::append怎么用?C++ Arguments::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Arguments
的用法示例。
在下文中一共展示了Arguments::append方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: locker
int QtRpc::ProxyBase::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
if (_id >= 1000)
{
QMutexLocker locker(&qxt_d().mutex);
// Make sure this isn't being run from the wrong thread....
Q_ASSERT(thread() == QThread::currentThread());
if (thread() != QThread::currentThread())
{
qCritical() << "You cannot call functions from other threads in QtRpc2";
}
//make sure the function exists
if (qxt_d().functions.keys().contains(_id))
{
Arguments args;
Signature sig = qxt_d().functions[_id];
//check to see if the function is an async function
if (qxt_d().asyncfunctions.contains(_id))
{
//create argument list
for (int i = 0; i < sig.numArgs(); i++)
{
args.append(convertQVariant(sig.arg(i), _a[i+3]));
}
// _a[0] = new ReturnValue(functionCalled(*(QObject **)_a[1], *(char **)_a[2], sig, args, qxt_d().functiontypes[_id]));
*static_cast<ReturnValue*>(_a[0]) = functionCalled(*(QObject **)_a[1], *(char **)_a[2], sig, args, qxt_d().functiontypes[_id]);
return(-1);
}
else
{
//create argument list
for (int i = 0; i < sig.numArgs(); i++)
{
args.append(convertQVariant(sig.arg(i), _a[i+1]));
}
*static_cast<ReturnValue*>(_a[0]) = this->functionCalled(sig, args, qxt_d().functiontypes[_id]);
// _a[0] = new ReturnValue(functionCalled(sig, args, qxt_d().functiontypes[_id]));
// memcpy(_a[0], ret, sizeof(ReturnValue));
return -1;
}
}
}
_id = QObject::qt_metacall(_c, _id, _a);
return _id;
}
示例2: KexiUserAction
KexiUserAction *
KexiUserAction::fromCurrentRecord(KActionCollection *parent, KexiDB::Cursor *c)
{
if (!c || c->bof() || c->eof())
return 0;
KexiUserAction *a = new KexiUserAction(parent,
c->value(1).toString(), c->value(2).toString(), c->value(3).toString());
QString args = c->value(5).toString();
bool quote = false;
Arguments arg;
QString tmp;
const int len = args.length();
for (int i = 0; i < len; i++) {
if (args[i] == '"') { // if current char is quoted unqote or other way round
quote = !quote;
} else if (args[i] == ',' && !quote) { //if item end add tmp to argumentstack and strip quotes if nessesery
if (tmp.left(1) == "\"" && tmp.right(1) == "\"")
tmp = tmp.mid(1, tmp.length() - 2);
arg.append(QVariant(tmp));
tmp = "";
} else { //else simply add char to tmp
tmp += args[i];
}
}
if (tmp.left(1) == "\"" && tmp.right(1) == "\"")
tmp = tmp.mid(1, tmp.length() - 2);
arg.append(QVariant(tmp));
a->setMethod(c->value(4).toInt(), arg);
return a;
}