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


C++ JoyDPad::copyAssignments方法代码示例

本文整理汇总了C++中JoyDPad::copyAssignments方法的典型用法代码示例。如果您正苦于以下问题:C++ JoyDPad::copyAssignments方法的具体用法?C++ JoyDPad::copyAssignments怎么用?C++ JoyDPad::copyAssignments使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JoyDPad的用法示例。


在下文中一共展示了JoyDPad::copyAssignments方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: copyAssignments

void SetJoystick::copyAssignments(SetJoystick *destSet)
{
    for (int i=0; i < device->getNumberAxes(); i++)
    {
        JoyAxis *sourceAxis = axes.value(i);
        JoyAxis *destAxis = destSet->axes.value(i);
        if (sourceAxis && destAxis)
        {
            sourceAxis->copyAssignments(destAxis);
        }
    }

    QHashIterator<int, JoyControlStick*> stickIter(sticks);
    while (stickIter.hasNext())
    {
        stickIter.next();
        int index = stickIter.key();
        JoyControlStick *sourceStick = stickIter.value();
        JoyControlStick *destStick = destSet->sticks.value(index);
        if (sourceStick && destStick)
        {
            sourceStick->copyAssignments(destStick);
        }
    }

    for (int i=0; i < device->getNumberHats(); i++)
    {
        JoyDPad *sourceDPad = hats.value(i);
        JoyDPad *destDPad = destSet->hats.value(i);
        if (sourceDPad && destDPad)
        {
            sourceDPad->copyAssignments(destDPad);
        }
    }

    QHashIterator<int, VDPad*> vdpadIter(vdpads);
    while (vdpadIter.hasNext())
    {
        vdpadIter.next();
        int index = vdpadIter.key();
        VDPad *sourceVDpad = vdpadIter.value();
        VDPad *destVDPad = destSet->vdpads.value(index);
        if (sourceVDpad && destVDPad)
        {
            sourceVDpad->copyAssignments(destVDPad);
        }
    }

    for (int i=0; i < device->getNumberButtons(); i++)
    {
        JoyButton *sourceButton = buttons.value(i);
        JoyButton *destButton = destSet->buttons.value(i);
        if (sourceButton && destButton)
        {
            sourceButton->copyAssignments(destButton);
        }
    }
}
开发者ID:jamesblunt,项目名称:antimicro,代码行数:58,代码来源:setjoystick.cpp


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