本文整理汇总了C++中Attr::addListItem方法的典型用法代码示例。如果您正苦于以下问题:C++ Attr::addListItem方法的具体用法?C++ Attr::addListItem怎么用?C++ Attr::addListItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Attr
的用法示例。
在下文中一共展示了Attr::addListItem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initAttributes
void FVAnimation::initAttributes()
{
FVObject * fo;
double start = 1e10, end=-1e10, step=1e10;
Field * f;
QString sFields("");
std::list< BoxBox *> children = manager->childrenOfBoxObj( (BoxBox*) this );
std::list< BoxBox *>::iterator it;
for (it = children.begin(); it != children.end(); it++) {
fo = (FVObject*) (*it);
f = reqField.getField( fo );
if (f != 0) {
sFields = sFields + f->getAttr("name").c_str() + " ";
if ( f->isDynamic() ) {
if (start > f->getMinTime()) start = f->getMinTime();
if (end < f->getMaxTime()) end = f->getMaxTime();
if (step > f->getTimeStep()) step = f->getTimeStep();
} else {
start = end = step = 0;
break;
}
} else {
qWarning() << "Unable to read field parameters. Field * f = 0.";
}
}
setAttrValue( tr("Name"), sFields);
sName = sFields;
setAttrValue( tr("Start Time:"), QString("%1").arg( start ) );
setAttrValue( tr("End Time:"), QString("%1").arg( end ) );
setAttrValue( tr("Time Step:"), QString("%1").arg( step ) );
setAttrValue( tr("Current Time:"), QString("%1").arg( start ) );
Attr * a = getAttr( tr("Current Time:") );
if (a != 0) {
if (start <= end) {
a->addListItem( QString("%1").arg( start ) );
} else
for (double v = start; v <= end; v += step) {
a->addListItem( QString("%1").arg( v ) );
}
}
}
示例2: setupAttributes
void FVAnimation::setupAttributes( )
{
Attr * a;
a = am->addAttr( tr("Type"), tr("Animation"), QString("text") );
a->setEditable(false);
a = am->addAttr( tr("Name"), tr("Unknown"), QString("text") );
a->setEditable(false);
a = am->addAttr( tr("Start Time:"), QString("%1").arg( 0 ) , QString("text") );
a->setEditable(false);
a = am->addAttr( tr("End Time:"), QString("%1").arg( 0 ), QString("text") );
a->setEditable(false);
a = am->addAttr( tr("Time Step:"), QString("%1").arg( 0 ), QString("text") );
a->setEditable(false);
a = am->addAttr( tr("Current Time:"), QString("%1").arg( 0 ), QString("textlist") );
a = am->addAttr( tr("Play Speed:"), tr("Stop"), QString("textlist") );
a->addListItem( tr("Stop") );
a->addListItem( tr("Turtle") );
a->addListItem( tr("Slow") );
a->addListItem( tr("Normal") );
a->addListItem( tr("Fast") );
a->addListItem( tr("Cheetah") );
}