本文整理汇总了C++中EventType::name方法的典型用法代码示例。如果您正苦于以下问题:C++ EventType::name方法的具体用法?C++ EventType::name怎么用?C++ EventType::name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EventType
的用法示例。
在下文中一共展示了EventType::name方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parsedFormula
QString EventType::parsedFormula()
{
QString res;
if (!parseFormula()) return res;
for (int i=0; i<ProfileCostArray::MaxRealIndex;i++) {
int c = _coefficient[i];
if (c == 0) continue;
if (!res.isEmpty()) {
res += ' ';
if (c>0) res += "+ ";
}
if (c<0) { res += "- "; c = -c; }
res += QString::number(c);
EventType* t = _set->type(i);
if (!t) continue;
if (!t->name().isEmpty())
res += QString(" * %1").arg(t->name());
}
return res;
}
示例2: saveOptions
void GlobalConfig::saveOptions()
{
// source options
ConfigGroup* sourceConfig = ConfigStorage::group("Source");
sourceConfig->setValue("Dirs", _generalSourceDirs);
QHashIterator<QString,QStringList> it( _objectSourceDirs );
int count = 1;
while( it.hasNext() ) {
it.next();
sourceConfig->setValue( QString("Object%1").arg(count),
it.key() );
sourceConfig->setValue( QString("Dirs%1").arg(count),
it.value() );
count++;
}
sourceConfig->setValue("Count", count-1);
delete sourceConfig;
// general options
ConfigGroup* generalConfig = ConfigStorage::group("GeneralSettings");
generalConfig->setValue("ShowPercentage", _showPercentage,
DEFAULT_SHOWPERCENTAGE);
generalConfig->setValue("ShowExpanded", _showExpanded,
DEFAULT_SHOWEXPANDED);
generalConfig->setValue("ShowCycles", _showCycles,
DEFAULT_SHOWCYCLES);
generalConfig->setValue("CycleCut", _cycleCut,
DEFAULT_CYCLECUT);
generalConfig->setValue("PercentPrecision", _percentPrecision,
DEFAULT_PERCENTPRECISION);
generalConfig->setValue("MaxSymbolLength", _maxSymbolLength,
DEFAULT_MAXSYMBOLLENGTH);
generalConfig->setValue("MaxSymbolCount", _maxSymbolCount,
DEFAULT_MAXSYMBOLCOUNT);
generalConfig->setValue("MaxListCount", _maxListCount,
DEFAULT_MAXLISTCOUNT);
generalConfig->setValue("Context", _context,
DEFAULT_CONTEXT);
generalConfig->setValue("NoCostInside", _noCostInside,
DEFAULT_NOCOSTINSIDE);
generalConfig->setValue("HideTemplates", _hideTemplates,
DEFAULT_HIDETEMPLATES);
delete generalConfig;
// event types
ConfigGroup* etConfig = ConfigStorage::group("EventTypes");
int etCount = EventType::knownTypeCount();
etConfig->setValue( "Count", etCount);
for (int i=0; i<etCount; i++) {
EventType* t = EventType::knownType(i);
etConfig->setValue( QString("Name%1").arg(i+1), t->name());
etConfig->setValue( QString("Longname%1").arg(i+1),
t->longName(),
knownLongName(t->name()) );
etConfig->setValue( QString("Formula%1").arg(i+1),
t->formula(), knownFormula(t->name()) );
}
delete etConfig;
}
示例3: addKnownDerivedTypes
int EventTypeSet::addKnownDerivedTypes()
{
int addCount = 0;
int addDiff, i;
int knownCount = EventType::knownTypeCount();
while (1) {
addDiff = 0;
for (i=0; i<knownCount; i++) {
EventType* t = EventType::knownType(i);
if (t->isReal()) continue;
if (index(t->name()) != ProfileCostArray::InvalidIndex) continue;
t->setEventTypeSet(this);
if (t->parseFormula()) {
addDiff++;
add(new EventType(t->name(), t->longName(), t->formula()));
}
t->setEventTypeSet(0);
}
if (addDiff == 0) break;
addCount += addDiff;
}
return addCount;
}