void ConstraintModel::setDefaultDuration(const TimeValue& arg) { if(m_defaultDuration != arg) { m_defaultDuration = arg; emit defaultDurationChanged(arg); consistency.setValid(true); consistency.setWarning(m_defaultDuration < m_minDuration || m_defaultDuration > m_maxDuration); } if(m_defaultDuration.msec() < 0) { consistency.setValid(false); } }
View::View(): m_widg{new QWidget} { auto lay = new QFormLayout; m_widg->setLayout(lay); // SKIN m_skin = new QComboBox; m_skin->addItems({"Default", "IEEE"}); lay->addRow(tr("Skin"), m_skin); connect(m_skin, &QComboBox::currentTextChanged, this, &View::skinChanged); // ZOOM m_zoomSpinBox = new QSpinBox; m_zoomSpinBox->setMinimum(50); m_zoomSpinBox->setMaximum(300); connect(m_zoomSpinBox, SignalUtils::QSpinBox_valueChanged_int(), this, &View::zoomChanged); m_zoomSpinBox->setSuffix(tr("%")); lay->addRow(tr("Graphical Zoom \n (50% -- 300%)"), m_zoomSpinBox); //SLOT HEIGHT m_slotHeightBox = new QSpinBox; m_slotHeightBox->setMinimum(0); m_slotHeightBox->setMaximum(10000); connect(m_slotHeightBox, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &View::slotHeightChanged); lay->addRow(tr("Default Slot Height"), m_slotHeightBox); // Default duration m_defaultDur = new iscore::TimeSpinBox; connect(m_defaultDur, &iscore::TimeSpinBox::timeChanged, this, [=] (const QTime& t) { emit defaultDurationChanged(TimeValue{t}); }); lay->addRow(tr("New score duration"), m_defaultDur); }