void JoyControlStickEditDialogHelper::setFromPendingSlots() { if (!pendingSlots.isEmpty()) { QHashIterator<JoyControlStick::JoyStickDirections, JoyButtonSlot*> iter(pendingSlots); while (iter.hasNext()) { iter.next(); JoyButtonSlot *slot = iter.value(); if (slot) { JoyControlStick::JoyStickDirections tempDir = iter.key(); JoyControlStickButton *button = stick->getDirectionButton(tempDir); if (button) { button->clearSlotsEventReset(false); button->setAssignedSlot(slot->getSlotCode(), slot->getSlotCodeAlias(), slot->getSlotMode()); } slot->deleteLater(); } } } }
void JoyControlStickEditDialogHelper::clearButtonsSlotsEventReset() { QHash<JoyControlStick::JoyStickDirections, JoyControlStickButton*> *buttons = stick->getButtons(); QHashIterator<JoyControlStick::JoyStickDirections, JoyControlStickButton*> iter(*buttons); while (iter.hasNext()) { JoyControlStickButton *button = iter.next().value(); if (button) { button->clearSlotsEventReset(); } } }