void KisAspectRatioLocker::connectSpinBoxes(QSpinBox *spinOne,
                                            QSpinBox *spinTwo,
                                            KoAspectButton *aspectButton)
{
    m_d->spinOne = spinOne;
    m_d->spinTwo = spinTwo;
    m_d->aspectButton = aspectButton;

    connect(m_d->spinOne, SIGNAL(valueChanged(int)), SLOT(slotSpinOneChanged()));
    connect(m_d->spinTwo, SIGNAL(valueChanged(int)), SLOT(slotSpinTwoChanged()));
    connect(m_d->aspectButton, SIGNAL(keepAspectRatioChanged(bool)), SLOT(slotAspectButtonChanged()));
    slotAspectButtonChanged();
}
Beispiel #2
0
void KisAspectRatioLocker::connectSpinBoxes(SpinBoxType *spinOne, SpinBoxType *spinTwo, KoAspectButton *aspectButton)
{
    m_d->spinOne.reset(new SliderWrapper(spinOne));
    m_d->spinTwo.reset(new SliderWrapper(spinTwo));
    m_d->aspectButton = aspectButton;

    if (QVariant::fromValue(spinOne->value()).type() == QVariant::Double) {
        connect(spinOne, SIGNAL(valueChanged(qreal)), SLOT(slotSpinOneChanged()));
        connect(spinTwo, SIGNAL(valueChanged(qreal)), SLOT(slotSpinTwoChanged()));
    } else {
        connect(spinOne, SIGNAL(valueChanged(int)), SLOT(slotSpinOneChanged()));
        connect(spinTwo, SIGNAL(valueChanged(int)), SLOT(slotSpinTwoChanged()));
    }

    connect(m_d->aspectButton, SIGNAL(keepAspectRatioChanged(bool)), SLOT(slotAspectButtonChanged()));
    slotAspectButtonChanged();
}