本文整理汇总了C++中TKey::isTempKey方法的典型用法代码示例。如果您正苦于以下问题:C++ TKey::isTempKey方法的具体用法?C++ TKey::isTempKey怎么用?C++ TKey::isTempKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TKey
的用法示例。
在下文中一共展示了TKey::isTempKey方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assembleReport
QString KeyUnit::assembleReport()
{
statsActiveKeys = 0;
statsKeyTotal = 0;
statsTempKeys = 0;
for (auto it = mKeyRootNodeList.begin(); it != mKeyRootNodeList.end(); it++) {
TKey* pChild = *it;
if (pChild->isActive())
statsActiveKeys++;
if (pChild->isTempKey())
statsTempKeys++;
statsKeyTotal++;
list<TKey*>* childrenList = pChild->mpMyChildrenList;
for (auto it2 = childrenList->begin(); it2 != childrenList->end(); it2++) {
TKey* pT = *it2;
_assembleReport(pT);
if (pT->isActive())
statsActiveKeys++;
if (pT->isTempKey())
statsTempKeys++;
statsKeyTotal++;
}
}
QStringList msg;
msg << "Keys current total: " << QString::number(statsKeyTotal) << "\n"
<< "tempKeys current total: " << QString::number(statsTempKeys) << "\n"
<< "active Keys: " << QString::number(statsActiveKeys) << "\n";
return msg.join("");
}
示例2: _assembleReport
void KeyUnit::_assembleReport(TKey* pChild)
{
list<TKey*>* childrenList = pChild->mpMyChildrenList;
for (auto it2 = childrenList->begin(); it2 != childrenList->end(); it2++) {
TKey* pT = *it2;
_assembleReport(pT);
if (pT->isActive())
statsActiveKeys++;
if (pT->isTempKey())
statsTempKeys++;
statsKeyTotal++;
}
}
示例3: killKey
bool KeyUnit::killKey(QString& name)
{
for (auto it = mKeyRootNodeList.begin(); it != mKeyRootNodeList.end(); it++) {
TKey* pChild = *it;
if (pChild->getName() == name) {
// only temporary Keys can be killed
if (!pChild->isTempKey()) {
return false;
} else {
pChild->setIsActive(false);
markCleanup(pChild);
return true;
}
}
}
return false;
}