本文整理汇总了C++中KviKvsVariant::copyFrom方法的典型用法代码示例。如果您正苦于以下问题:C++ KviKvsVariant::copyFrom方法的具体用法?C++ KviKvsVariant::copyFrom怎么用?C++ KviKvsVariant::copyFrom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KviKvsVariant
的用法示例。
在下文中一共展示了KviKvsVariant::copyFrom方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: trigger
bool KviKvsProcessAsyncOperation::trigger(CallbackEvent e, const QString & szData)
{
if(m_bDeletePending)
return false;
if(!g_pApp->windowExists(m_pData->pWnd))
{
if(m_pData->iFlags & KVI_KVS_PROCESSDESCRIPTOR_KILLIFNOWINDOW)
{
return true;
}
m_pData->pWnd = g_pApp->activeConsole();
}
if(m_pData->pCallback)
{
KviKvsVariantList params;
params.setAutoDelete(true);
switch(e)
{
case EventStdout:
params.append(new KviKvsVariant(QString("stdout")));
break;
case EventStderr:
params.append(new KviKvsVariant(QString("stderr")));
break;
case EventTerminated:
params.append(new KviKvsVariant(QString("terminated")));
break;
case EventStarted:
params.append(new KviKvsVariant(QString("started")));
break;
case EventPing:
params.append(new KviKvsVariant(QString("ping")));
break;
default:
qDebug("Oops! Unknown trigger() CallbackEvent parameter in QProcessDescriptor::trigger()");
return false;
break;
}
params.append(new KviKvsVariant(szData));
if(m_pData->pMagic)
{
KviKvsVariant * pTmp = new KviKvsVariant();
pTmp->copyFrom(m_pData->pMagic);
params.append(pTmp);
}
KviKvsVariant retVal;
int iRet = m_pData->pCallback->run(m_pData->pWnd, ¶ms, &retVal, KviKvsScript::PreserveParams, m_pExtendedRunTimeData);
if(!iRet)
{
m_pData->pWnd->output(KVI_OUT_PARSERERROR,
__tr2qs_ctx("Error triggered from process callback handler: killing process", "kvs"));
return true;
}
if(!retVal.isNothing())
{
QString sz;
retVal.asString(sz);
m_pProcess->write(sz.toUtf8().data());
}
if(iRet & KviKvsScript::HaltEncountered)
{
// halt encountered: kill the process
return true;
}
}
return false;
}