void SpeedDial::slotInfiniteChecked(bool state) { m_minus->setEnabled(!state); m_dial->setEnabled(!state); m_plus->setEnabled(!state); m_hrs->setEnabled(!state); m_min->setEnabled(!state); m_sec->setEnabled(!state); m_ms->setEnabled(!state); m_tap->setEnabled(!state); if (state == true) { m_value = Function::infiniteSpeed(); if (m_preventSignals == false) emit valueChanged(Function::infiniteSpeed()); } else { m_value = spinValues(); if (m_preventSignals == false) emit valueChanged(m_value); } // stop tap button blinking if it was stopTimers(); }
void SpeedDial::slotMSChanged() { if (m_preventSignals == false) { m_value = spinValues(); emit valueChanged(m_value); } // stop tap button blinking if it was stopTimers(); }
void SpeedDial::slotMSChanged() { if (m_preventSignals == false) { m_value = spinValues(); emit valueChanged(m_value); } // update tap button blinking updateTapTimer(); }
void SpeedDial::slotMSChanged() { m_ms->blockSignals(true); if (m_ms->value() < 10) m_ms->setPrefix(".0"); else m_ms->setPrefix("."); m_ms->blockSignals(false); if (m_preventSignals == false) { m_value = spinValues(); emit valueChanged(m_value); } // stop tap button blinking if it was stopTimers(); }
void SpeedDial::setSpinValues(int ms) { // block signals to prevent each single SpinBox to send // a valueChanged signal. For example going from 1m0s to 59s // would send two signals: 0 and then 59000. // We want to avoid that non-sense 0 // Just send one single signal when everything has changed m_hrs->blockSignals(true); m_min->blockSignals(true); m_sec->blockSignals(true); m_ms->blockSignals(true); if (ms == (int) Function::infiniteSpeed()) { m_hrs->setValue(m_hrs->minimum()); m_min->setValue(m_min->minimum()); m_sec->setValue(m_sec->minimum()); m_ms->setValue(m_ms->minimum()); } else { ms = CLAMP(ms, 0, INT_MAX); m_hrs->setValue(ms / MS_PER_HOUR); ms -= (m_hrs->value() * MS_PER_HOUR); m_min->setValue(ms / MS_PER_MINUTE); ms -= (m_min->value() * MS_PER_MINUTE); m_sec->setValue(ms / MS_PER_SECOND); ms -= (m_sec->value() * MS_PER_SECOND); m_ms->setValue(ms / MS_DIV); } m_hrs->blockSignals(false); m_min->blockSignals(false); m_sec->blockSignals(false); m_ms->blockSignals(false); if (m_preventSignals == false) { m_value = spinValues(); emit valueChanged(m_value); } }