当前位置: 首页>>代码示例>>C++>>正文


C++ CItemList::size方法代码示例

本文整理汇总了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;
}
开发者ID:ViktorNova,项目名称:los,代码行数:30,代码来源:EventCanvas.cpp

示例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);
开发者ID:ViktorNova,项目名称:los,代码行数:67,代码来源:EventCanvas.cpp


注:本文中的CItemList::size方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。