本文整理汇总了C++中JoyDPad::getDpadName方法的典型用法代码示例。如果您正苦于以下问题:C++ JoyDPad::getDpadName方法的具体用法?C++ JoyDPad::getDpadName怎么用?C++ JoyDPad::getDpadName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JoyDPad
的用法示例。
在下文中一共展示了JoyDPad::getDpadName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateSetDPadNames
void InputDevice::updateSetDPadNames(int dpadIndex)
{
JoyDPad *dpad = getActiveSetJoystick()->getJoyDPad(dpadIndex);
if (dpad)
{
setDPadName(dpadIndex, dpad->getDpadName());
}
}
示例2: writeConfig
//.........这里部分代码省略.........
JoyControlStick *stick = tempSet->getJoyStick(i);
if (stick)
{
if (!stick->getStickName().isEmpty())
{
xml->writeStartElement("controlstickname");
xml->writeAttribute("index", QString::number(stick->getRealJoyIndex()));
xml->writeCharacters(stick->getStickName());
xml->writeEndElement();
}
QHash<JoyControlStick::JoyStickDirections, JoyControlStickButton*> *buttons = stick->getButtons();
QHashIterator<JoyControlStick::JoyStickDirections, JoyControlStickButton*> iter(*buttons);
while (iter.hasNext())
{
JoyControlStickButton *button = iter.next().value();
if (button && !button->getButtonName().isEmpty())
{
xml->writeStartElement("controlstickbuttonname");
xml->writeAttribute("index", QString::number(stick->getRealJoyIndex()));
xml->writeAttribute("button", QString::number(button->getRealJoyNumber()));
xml->writeCharacters(button->getButtonName());
xml->writeEndElement();
}
}
}
}
for (int i=0; i < getNumberHats(); i++)
{
JoyDPad *dpad = tempSet->getJoyDPad(i);
if (dpad)
{
if (!dpad->getDpadName().isEmpty())
{
xml->writeStartElement("dpadname");
xml->writeAttribute("index", QString::number(dpad->getRealJoyNumber()));
xml->writeCharacters(dpad->getDpadName());
xml->writeEndElement();
}
QHash<int, JoyDPadButton*> *temp = dpad->getButtons();
QHashIterator<int, JoyDPadButton*> iter(*temp);
while (iter.hasNext())
{
JoyDPadButton *button = iter.next().value();
if (button && !button->getButtonName().isEmpty())
{
xml->writeStartElement("dpadbuttonname");
xml->writeAttribute("index", QString::number(dpad->getRealJoyNumber()));
xml->writeAttribute("button", QString::number(button->getRealJoyNumber()));
xml->writeCharacters(button->getButtonName());
xml->writeEndElement();
}
}
}
}
for (int i=0; i < getNumberVDPads(); i++)
{
VDPad *vdpad = getActiveSetJoystick()->getVDPad(i);
if (vdpad)
{
if (!vdpad->getDpadName().isEmpty())
{
xml->writeStartElement("vdpadname");