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


C++ SimpleKeyGrabberButton::getValue方法代码示例

本文整理汇总了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()));
    }
开发者ID:Virusmater,项目名称:antimicro,代码行数:31,代码来源:advancebuttondialog.cpp

示例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);
    }
}
开发者ID:Virusmater,项目名称:antimicro,代码行数:32,代码来源:advancebuttondialog.cpp

示例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();
}
开发者ID:jaanek,项目名称:antimicro,代码行数:32,代码来源:advancebuttondialog.cpp

示例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);
}
开发者ID:Virusmater,项目名称:antimicro,代码行数:15,代码来源:advancebuttondialog.cpp

示例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);
        }
    }
}
开发者ID:Virusmater,项目名称:antimicro,代码行数:42,代码来源:advancebuttondialog.cpp


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