本文整理汇总了C++中ListIterator::get方法的典型用法代码示例。如果您正苦于以下问题:C++ ListIterator::get方法的具体用法?C++ ListIterator::get怎么用?C++ ListIterator::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ListIterator
的用法示例。
在下文中一共展示了ListIterator::get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: varInfo
UString Debugger::varInfo(const UString &ident)
{
if (!eng)
return UString();
const List *chain = Context::current()->pScopeChain();
ListIterator scope = chain->begin();
while (scope != chain->end()) {
if (scope->hasProperty(ident)) {
KJSO val = scope->get(ident);
return UString(val.imp()->typeInfo()->name) + ":" +
val.toString().value();
}
scope++;
}
return UString();
}
示例2: drawTreeAux
QPointF GraphWidget::drawTreeAux(QGraphicsScene* scene, GuiNode* node, float depth, unsigned int* leafNumber)
{
ListIterator<GuiNode, Domain::Node> it = node->getChildrenIterator<GuiNode>();
list<QPointF> points;
QPointF nodeCoord;
QPointF ret;
QPointF first;
QPointF last;
QGraphicsTextItem* text;
Edge* edge;
if (node->isLeaf())
{
nodeCoord.setX((*leafNumber) * 100);
nodeCoord.setY((depth + node->getBranchLength()) * 100);
++(*leafNumber);
}
else
{
while (!it.end())
{
GuiNode* auxNode = it.get();
ret = drawTreeAux(scene, auxNode, depth + node->getBranchLength(), leafNumber);
points.push_front(ret);
it.next();
}
last = points.front();
first = points.back();
nodeCoord.setX((first.x() + (last.x() - first.x()) / 2.0));
nodeCoord.setY((depth + node->getBranchLength()) * 100);
}
node->setPos(nodeCoord.x() + 200, nodeCoord.y() + 200);
if (node->isLeaf())
{
text = new QGraphicsTextItem(QString(node->getName().c_str()));
text->setPos(nodeCoord.x() + 200 + 10, nodeCoord.y() + 200 + 20);
text->rotate(90);
node->setGraphicsName(text);
scene->addItem(text);
}
it.restart();
for (; !it.end(); it.next())
{
GuiNode* auxNode = it.get();
edge = new Edge(node, auxNode);
if (!node->isExpanded() || !node->isVisible())
{
edge->setVisible(false);
}
scene->addItem(edge);
auxNode->addEdgeFrom(edge);
node->addEdgeTo(edge);
}
scene->addItem(node);
return nodeCoord;
}