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


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

本文整理汇总了C++中SimpleKeyGrabberButton::setText方法的典型用法代码示例。如果您正苦于以下问题:C++ SimpleKeyGrabberButton::setText方法的具体用法?C++ SimpleKeyGrabberButton::setText怎么用?C++ SimpleKeyGrabberButton::setText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SimpleKeyGrabberButton的用法示例。


在下文中一共展示了SimpleKeyGrabberButton::setText方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: QDialog

AdvanceButtonDialog::AdvanceButtonDialog(JoyButton *button, QWidget *parent) :
    QDialog(parent, Qt::Dialog),
    ui(new Ui::AdvanceButtonDialog)
{
    ui->setupUi(this);
    setAttribute(Qt::WA_DeleteOnClose);

    this->button = button;
    oldRow = 0;

    if (this->button->getToggleState())
    {
        ui->toggleCheckbox->setChecked(true);
    }

    if (this->button->isUsingTurbo())
    {
        ui->turboCheckbox->setChecked(true);
        ui->turboSlider->setEnabled(true);
    }

    int interval = this->button->getTurboInterval() / 10;
    if (interval < MINIMUMTURBO)
    {
        interval = JoyButton::ENABLEDTURBODEFAULT / 10;
    }
    ui->turboSlider->setValue(interval);
    this->changeTurboText(interval);

    QListIterator<JoyButtonSlot*> iter(*(this->button->getAssignedSlots()));
    while (iter.hasNext())
    {
        JoyButtonSlot *buttonslot = iter.next();
        SimpleKeyGrabberButton *existingCode = new SimpleKeyGrabberButton(this);
        existingCode->setText(buttonslot->getSlotString());
        existingCode->setValue(buttonslot->getSlotCode(), buttonslot->getSlotCodeAlias(), buttonslot->getSlotMode());

        QListWidgetItem *item = new QListWidgetItem();
        item->setData(Qt::UserRole, QVariant::fromValue<SimpleKeyGrabberButton*>(existingCode));
        QHBoxLayout *layout= new QHBoxLayout();
        layout->setContentsMargins(10, 0, 10, 0);
        layout->addWidget(existingCode);
        QWidget *widget = new QWidget();
        widget->setLayout(layout);
        item->setSizeHint(widget->sizeHint());

        ui->slotListWidget->addItem(item);
        ui->slotListWidget->setItemWidget(item, widget);
        connectButtonEvents(existingCode);
    }

    appendBlankKeyGrabber();
    populateSetSelectionComboBox();

    if (this->button->getSetSelection() > -1 && this->button->getChangeSetCondition() != JoyButton::SetChangeDisabled)
    {
        int selectIndex = (int)this->button->getChangeSetCondition();
        selectIndex += this->button->getSetSelection() * 3;
        if (this->button->getOriginSet() < this->button->getSetSelection())
        {
            selectIndex -= 3;
        }

        ui->setSelectionComboBox->setCurrentIndex(selectIndex);
    }

    fillTimeComboBoxes();
    ui->actionTenthsComboBox->setCurrentIndex(1);

    updateActionTimeLabel();
    changeTurboForSequences();

    if (button->isCycleResetActive())
    {
        ui->autoResetCycleCheckBox->setEnabled(true);
        ui->autoResetCycleCheckBox->setChecked(true);
        checkCycleResetWidgetStatus(true);
    }

    if (button->getCycleResetTime() != 0)
    {
        populateAutoResetInterval();
    }

    updateWindowTitleButtonName();

    connect(ui->turboCheckbox, SIGNAL(clicked(bool)), ui->turboSlider, SLOT(setEnabled(bool)));
    connect(ui->turboSlider, SIGNAL(valueChanged(int)), this, SLOT(checkTurboIntervalValue(int)));

    connect(ui->insertSlotButton, SIGNAL(clicked()), this, SLOT(insertSlot()));
    connect(ui->deleteSlotButton, SIGNAL(clicked()), this, SLOT(deleteSlot()));
    connect(ui->clearAllPushButton, SIGNAL(clicked()), this, SLOT(clearAllSlots()));
    connect(ui->pausePushButton, SIGNAL(clicked()), this, SLOT(insertPauseSlot()));
    connect(ui->holdPushButton, SIGNAL(clicked()), this, SLOT(insertHoldSlot()));
    connect(ui->cyclePushButton, SIGNAL(clicked()), this, SLOT(insertCycleSlot()));
    connect(ui->distancePushButton, SIGNAL(clicked()), this, SLOT(insertDistanceSlot()));
    connect(ui->releasePushButton, SIGNAL(clicked()), this, SLOT(insertReleaseSlot()));

    connect(ui->actionHundredthsComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(updateActionTimeLabel()));
    connect(ui->actionSecondsComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(updateActionTimeLabel()));
//.........这里部分代码省略.........
开发者ID:Virusmater,项目名称:antimicro,代码行数:101,代码来源:advancebuttondialog.cpp

示例2: if

AdvanceButtonDialog::AdvanceButtonDialog(JoyButton *button, QWidget *parent) :
    QDialog(parent, Qt::Window),
    ui(new Ui::AdvanceButtonDialog)
{
    ui->setupUi(this);
    setAttribute(Qt::WA_DeleteOnClose);

    this->button = button;
    oldRow = 0;

    if (this->button->getToggleState())
    {
        ui->toggleCheckbox->setChecked(true);
    }

    if (this->button->isUsingTurbo())
    {
        ui->turboCheckbox->setChecked(true);
        ui->turboSlider->setEnabled(true);
    }

    int interval = this->button->getTurboInterval() / 10;
    if (interval < MINIMUMTURBO)
    {
        interval = JoyButton::ENABLEDTURBODEFAULT / 10;
    }
    ui->turboSlider->setValue(interval);
    this->changeTurboText(interval);

    QListIterator<JoyButtonSlot*> iter(*(this->button->getAssignedSlots()));
    while (iter.hasNext())
    {
        JoyButtonSlot *buttonslot = iter.next();
        SimpleKeyGrabberButton *existingCode = new SimpleKeyGrabberButton(this);
        existingCode->setText(buttonslot->getSlotString());
        existingCode->setValue(buttonslot->getSlotCode(), buttonslot->getSlotMode());

        //existingCode->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);

        connectButtonEvents(existingCode);
        QListWidgetItem *item = new QListWidgetItem();
        ui->slotListWidget->addItem(item);

        item->setData(Qt::UserRole, QVariant::fromValue<SimpleKeyGrabberButton*>(existingCode));
        QHBoxLayout *layout= new QHBoxLayout();
        layout->addWidget(existingCode);
        QWidget *widget = new QWidget();
        widget->setLayout(layout);
        item->setSizeHint(widget->sizeHint());
        ui->slotListWidget->setItemWidget(item, widget);
    }

    appendBlankKeyGrabber();

    if (this->button->getSetSelection() > -1 && this->button->getChangeSetCondition() != JoyButton::SetChangeDisabled)
    {
        int offset = (int)this->button->getChangeSetCondition();
        ui->setSelectionComboBox->setCurrentIndex((this->button->getSetSelection() * 3) + offset);
    }

    if (this->button->getOriginSet() == 0)
    {
        ui->setSelectionComboBox->model()->removeRows(1, 3);
    }
    else if (this->button->getOriginSet() == 1)
    {
        ui->setSelectionComboBox->model()->removeRows(4, 3);
    }
    else if (this->button->getOriginSet() == 2)
    {
        ui->setSelectionComboBox->model()->removeRows(7, 3);
    }
    else if (this->button->getOriginSet() == 3)
    {
        ui->setSelectionComboBox->model()->removeRows(10, 3);
    }
    else if (this->button->getOriginSet() == 4)
    {
        ui->setSelectionComboBox->model()->removeRows(13, 3);
    }
    else if (this->button->getOriginSet() == 5)
    {
        ui->setSelectionComboBox->model()->removeRows(16, 3);
    }
    else if (this->button->getOriginSet() == 6)
    {
        ui->setSelectionComboBox->model()->removeRows(19, 3);
    }
    else if (this->button->getOriginSet() == 7)
    {
        ui->setSelectionComboBox->model()->removeRows(22, 3);
    }

    updateActionTimeLabel();
    changeTurboForSequences();

    setWindowTitle(tr("Advanced").append(": ").append(button->getPartialName()));

    connect(ui->turboCheckbox, SIGNAL(clicked(bool)), ui->turboSlider, SLOT(setEnabled(bool)));
    connect(ui->turboSlider, SIGNAL(valueChanged(int)), this, SLOT(checkTurboIntervalValue(int)));
//.........这里部分代码省略.........
开发者ID:jaanek,项目名称:antimicro,代码行数:101,代码来源:advancebuttondialog.cpp


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