本文整理汇总了C++中SimpleKeyGrabberButton::getValue方法的典型用法代码示例。如果您正苦于以下问题:C++ SimpleKeyGrabberButton::getValue方法的具体用法?C++ SimpleKeyGrabberButton::getValue怎么用?C++ SimpleKeyGrabberButton::getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleKeyGrabberButton
的用法示例。
在下文中一共展示了SimpleKeyGrabberButton::getValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: performStatsWidgetRefresh
void AdvanceButtonDialog::performStatsWidgetRefresh(QListWidgetItem *item)
{
SimpleKeyGrabberButton *tempbutton = item->data(Qt::UserRole).value<SimpleKeyGrabberButton*>();
JoyButtonSlot *slot = tempbutton->getValue();
if (slot->getSlotMode() == JoyButtonSlot::JoyPause)
{
refreshTimeComboBoxes(slot);
}
else if (slot->getSlotMode() == JoyButtonSlot::JoyRelease)
{
refreshTimeComboBoxes(slot);
}
else if (slot->getSlotMode() == JoyButtonSlot::JoyHold)
{
refreshTimeComboBoxes(slot);
}
else if (slot->getSlotMode() == JoyButtonSlot::JoyKeyPress)
{
refreshTimeComboBoxes(slot);
}
else if (slot->getSlotMode() == JoyButtonSlot::JoyDelay)
{
refreshTimeComboBoxes(slot);
}
else if (slot->getSlotMode() == JoyButtonSlot::JoyDistance)
{
disconnect(ui->distanceSpinBox, SIGNAL(valueChanged(int)), this, SLOT(checkSlotDistanceUpdate()));
ui->distanceSpinBox->setValue(slot->getSlotCode());
connect(ui->distanceSpinBox, SIGNAL(valueChanged(int)), this, SLOT(checkSlotDistanceUpdate()));
}
示例2: insertDistanceSlot
void AdvanceButtonDialog::insertDistanceSlot()
{
int index = ui->slotListWidget->currentRow();
SimpleKeyGrabberButton *tempbutton = ui->slotListWidget->currentItem()->data(Qt::UserRole).value<SimpleKeyGrabberButton*>();
int tempDistance = 0;
for (int i = 0; i < ui->slotListWidget->count(); i++)
{
SimpleKeyGrabberButton *button = ui->slotListWidget->item(i)->data(Qt::UserRole).value<SimpleKeyGrabberButton*>();
JoyButtonSlot *tempbuttonslot = button->getValue();
if (tempbuttonslot->getSlotMode() == JoyButtonSlot::JoyDistance)
{
tempDistance += tempbuttonslot->getSlotCode();
}
else if (tempbuttonslot->getSlotMode() == JoyButtonSlot::JoyCycle)
{
tempDistance = 0;
}
}
int testDistance = ui->distanceSpinBox->value();
if (testDistance + tempDistance <= 100)
{
tempbutton->setValue(testDistance, JoyButtonSlot::JoyDistance);
// Stop all events on JoyButton
this->button->eventReset();
this->button->setAssignedSlot(testDistance, 0, index, JoyButtonSlot::JoyDistance);
updateSlotsScrollArea(testDistance);
}
}
示例3: updateSlotsScrollArea
void AdvanceButtonDialog::updateSlotsScrollArea(int value)
{
int index = ui->slotListWidget->currentRow();
int itemcount = ui->slotListWidget->count();
if (index == (itemcount - 1) && value > 0)
{
appendBlankKeyGrabber();
}
else if (index < (itemcount - 1) && value == 0)
{
QListWidgetItem *item = ui->slotListWidget->takeItem(index);
delete item;
item = 0;
}
this->button->clearSlotsEventReset();
for (int i = 0; i < ui->slotListWidget->count(); i++)
{
SimpleKeyGrabberButton *button = ui->slotListWidget->item(i)->data(Qt::UserRole).value<SimpleKeyGrabberButton*>();
JoyButtonSlot *tempbuttonslot = button->getValue();
if (tempbuttonslot->getSlotCode() > 0)
{
JoyButtonSlot *buttonslot = new JoyButtonSlot(tempbuttonslot->getSlotCode(), tempbuttonslot->getSlotMode());
this->button->setAssignedSlot(buttonslot->getSlotCode(), buttonslot->getSlotMode());
}
}
changeTurboForSequences();
emit slotsChanged();
}
示例4: updateSelectedSlot
void AdvanceButtonDialog::updateSelectedSlot(int value)
{
SimpleKeyGrabberButton *grabbutton = static_cast<SimpleKeyGrabberButton*>(sender());
JoyButtonSlot *tempbuttonslot = grabbutton->getValue();
int index = ui->slotListWidget->currentRow();
// Stop all events on JoyButton
this->button->eventReset();
this->button->setAssignedSlot(tempbuttonslot->getSlotCode(),
tempbuttonslot->getSlotCodeAlias(),
index,
tempbuttonslot->getSlotMode());
updateSlotsScrollArea(value);
}
示例5: changeTurboForSequences
void AdvanceButtonDialog::changeTurboForSequences()
{
bool containsSequences = false;
for (int i = 0; i < ui->slotListWidget->count() && !containsSequences; i++)
{
SimpleKeyGrabberButton *button = ui->slotListWidget->item(i)->data(Qt::UserRole).value<SimpleKeyGrabberButton*>();
JoyButtonSlot *tempbuttonslot = button->getValue();
if (tempbuttonslot->getSlotCode() > 0 &&
(tempbuttonslot->getSlotMode() == JoyButtonSlot::JoyPause ||
tempbuttonslot->getSlotMode() == JoyButtonSlot::JoyHold ||
tempbuttonslot->getSlotMode() == JoyButtonSlot::JoyDistance
)
)
{
containsSequences = true;
}
}
if (containsSequences)
{
if (ui->turboCheckbox->isChecked())
{
ui->turboCheckbox->setChecked(false);
this->button->setUseTurbo(false);
emit turboChanged(false);
}
if (ui->turboCheckbox->isEnabled())
{
ui->turboCheckbox->setEnabled(false);
emit turboButtonEnabledChange(false);
}
}
else
{
if (!ui->turboCheckbox->isEnabled())
{
ui->turboCheckbox->setEnabled(true);
emit turboButtonEnabledChange(true);
}
}
}