本文整理汇总了C++中CItemList::size方法的典型用法代码示例。如果您正苦于以下问题:C++ CItemList::size方法的具体用法?C++ CItemList::size怎么用?C++ CItemList::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CItemList
的用法示例。
在下文中一共展示了CItemList::size方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getLeftMostSelected
CItem* EventCanvas::getLeftMostSelected()
{
iCItem i, iLeftmost;
CItem* leftmost = NULL;
// get a list of items that belong to the current part
// since multiple parts have populated the _items list
// we need to filter on the actual current Part!
//CItemList list = getItemlistForCurrentPart();
CItemList list = _items;
if(multiPartSelectionAction && !multiPartSelectionAction->isChecked())
list = getItemlistForCurrentPart();
if (list.size() > 0)
{
i = list.end();
while (i != list.begin())
{
--i;
if (i->second->isSelected())
{
iLeftmost = i;
leftmost = i->second;
}
}
}
return leftmost;
}
示例2: actionCommand
//.........这里部分代码省略.........
m_tempPlayItems.append(iRightmost->second);
QTimer::singleShot(NOTE_PLAY_TIME, this, SLOT(playReleaseForItem()));
if(editor->isGlobalEdit())
populateMultiSelect(iRightmost->second);
updateSelection();
}
}
else // there was no item selected at all? Then select nearest to tick if there is any
{
selectAtTick(song->cpos());
updateSelection();
}
}
break;
case SEL_LEFT ... SEL_LEFT_ADD:
{
if (action == SEL_LEFT && allItemsAreSelected())
{
deselectAll();
selectAtTick(song->cpos());
return;
}
iCItem i, iLeftmost;
CItem* leftmost = NULL;
// get a list of items that belong to the current part
// since multiple parts have populated the _items list
// we need to filter on the actual current Part!
CItemList list = _items;
if(multiPartSelectionAction && !multiPartSelectionAction->isChecked())
list = getItemlistForCurrentPart();
if (list.size() > 0)
{
i = list.end();
while (i != list.begin())
{
--i;
if (i->second->isSelected())
{
iLeftmost = i;
leftmost = i->second;
}
}
if (leftmost)
{
if (iLeftmost != list.begin())
{
//Add item
if (action != SEL_LEFT_ADD)
deselectAll();
iLeftmost--;
iLeftmost->second->setSelected(true);
itemPressed(iLeftmost->second);
m_tempPlayItems.append(iLeftmost->second);
QTimer::singleShot(NOTE_PLAY_TIME, this, SLOT(playReleaseForItem()));
if(editor->isGlobalEdit())
populateMultiSelect(iLeftmost->second);
updateSelection();
} else {
leftmost->setSelected(true);
itemPressed(leftmost);
m_tempPlayItems.append(leftmost);