本文整理汇总了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);
}
}
}