/*! \fn void QSignal::activate() Emits the signal. If the platform supports QVariant and a parameter has been set with setValue(), this value is passed in the signal. */ void QSignal::activate() { #ifndef QT_NO_VARIANT /* Create this QGuardedPtr on this, if we get destroyed after the intSignal (but before the variant signal) we cannot just emit the signal (because val has been destroyed already) */ QGuardedPtr<QSignal> me = this; if( me ) emit intSignal( val.toInt() ); if( me ) emit signal( val ); #else emit intSignal(0); #endif }
void ConfigWidget::loadCheckBox(QAbstractButton *c, bool v) { if (v != c->isChecked()) { c->setChecked(v); } else { connect(this, SIGNAL(intSignal(int)), c, SIGNAL(stateChanged(int))); emit intSignal(v ? 1 : 0); disconnect(SIGNAL(intSignal(int))); } }
void ConfigWidget::loadComboBox(QComboBox *c, int v) { if (c->currentIndex() != v) { c->setCurrentIndex(v); } else { connect(this, SIGNAL(intSignal(int)), c, SIGNAL(currentIndexChanged(int))); emit intSignal(v); disconnect(SIGNAL(intSignal(int))); } }
void ConfigWidget::loadSlider(QSlider *slider, int v) { if (v != slider->value()) { slider->setValue(v); } else { connect(this, SIGNAL(intSignal(int)), slider, SIGNAL(valueChanged(int))); emit intSignal(v); disconnect(SIGNAL(intSignal(int))); } }