示例#1
0
void SetJoystick::propogateSetStickNameChange()
{
    JoyControlStick *stick = static_cast<JoyControlStick*>(sender());
    disconnect(stick, SIGNAL(stickNameChanged()), this, SLOT(propogateSetStickNameChange()));
    emit setStickNameChange(stick->getIndex());
    connect(stick, SIGNAL(stickNameChanged()), this, SLOT(propogateSetStickNameChange()));
}
示例#2
0
void JoyControlStick::setStickName(QString tempName)
{
    if (tempName.length() <= 20 && tempName != stickName)
    {
        stickName = tempName;
        emit stickNameChanged();
    }
}
JoyControlStickPushButton::JoyControlStickPushButton(JoyControlStick *stick, bool displayNames, QWidget *parent) :
    FlashButtonWidget(displayNames, parent)
{
    this->stick = stick;

    refreshLabel();

    connect(stick, SIGNAL(active(int, int)), this, SLOT(flash()));
    connect(stick, SIGNAL(released(int, int)), this, SLOT(unflash()));
    connect(stick, SIGNAL(stickNameChanged()), this, SLOT(refreshLabel()));
}
示例#4
0
void SetJoystick::addControlStick(int index, JoyControlStick *stick)
{
    sticks.insert(index, stick);
    connect(stick, SIGNAL(stickNameChanged()), this, SLOT(propogateSetStickNameChange()));

    QHashIterator<JoyStickDirectionsType::JoyStickDirections, JoyControlStickButton*> iter(*stick->getButtons());
    while (iter.hasNext())
    {
        JoyControlStickButton *button = iter.next().value();
        if (button)
        {
            connect(button, SIGNAL(clicked(int)), this, SLOT(propogateSetStickButtonClick(int)));
            connect(button, SIGNAL(released(int)), this, SLOT(propogateSetStickButtonRelease(int)));
            connect(button, SIGNAL(buttonNameChanged()), this, SLOT(propogateSetStickButtonNameChange()));
        }
    }
}
示例#5
0
void JoyControlStick::setDefaultStickName(QString tempname)
{
    defaultStickName = tempname;
    emit stickNameChanged();
}