本文整理汇总了C++中LayerList::at方法的典型用法代码示例。如果您正苦于以下问题:C++ LayerList::at方法的具体用法?C++ LayerList::at怎么用?C++ LayerList::at使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayerList
的用法示例。
在下文中一共展示了LayerList::at方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: listIndexOfItem
/// <summary>
/// Returns what index the specified item would be if the entire scene was
/// represented in a linear list.
/// </summary>
int Scene::listIndexOfItem(SceneItem *item) const
{
int index = 0;
for(int i = 0; i < m_groups.count(); i++) {
const GroupInfo &group = m_groups.at(i);
if(item == group.sceneItem)
return index;
index++;
LayerList layers = group.group->getLayers();
for(int j = 0; j < layers.count(); j++) {
if(item == itemForLayer(layers.at(j)))
return index;
index++;
}
}
return -1; // Not found
}
示例2: itemForLayer
/// <summary>
/// Returns the item at the specified index if the entire scene was represented
/// in a linear list.
/// </summary>
SceneItem *Scene::itemAtListIndex(int index) const
{
int item = 0;
for(int i = 0; i < m_groups.count(); i++) {
const GroupInfo &group = m_groups.at(i);
if(item == index)
return group.sceneItem;
item++;
LayerList layers = group.group->getLayers();
for(int j = 0; j < layers.count(); j++) {
Layer *layer = layers.at(j);
if(item == index)
return itemForLayer(layer);
item++;
}
}
return NULL; // Not found
}