void ComponentWidget::insertComponent() { QStringList options; QVariantMap::iterator iterator; for (iterator = m_options.begin(); iterator != m_options.end(); ++iterator) { options.append(QString("'%1': %2").arg(iterator.key()).arg(iterator.value().toString())); } emit insertComponent(Clock::getComponentString(m_component), (options.isEmpty() ? QString() : options.join(QString(", ")))); }
void SLICKEnergy::registerComponents_() { float coeff_CHPI = options_.setDefaultReal(SLICKEnergy::Option::CHPI, SLICKEnergy::Default::CHPI); float coeff_HB = options_.setDefaultReal(SLICKEnergy::Option::HB, SLICKEnergy::Default::HB); float coeff_VDW = options_.setDefaultReal(SLICKEnergy::Option::VDW, SLICKEnergy::Default::VDW); float coeff_NPS = options_.setDefaultReal(SLICKEnergy::Option::NONPOLAR, SLICKEnergy::Default::NONPOLAR); float coeff_PS = options_.setDefaultReal(SLICKEnergy::Option::POLAR, SLICKEnergy::Default::POLAR); CHPISlick* chpi = new CHPISlick(*this); chpi->setCoefficient(coeff_CHPI); chpi->setup(); chpi->setNormalizationParameters(0.0, 0.0); insertComponent(chpi); HydrogenBondSlick* hb = new HydrogenBondSlick(*this); hb->setCoefficient(coeff_HB); hb->setup(); hb->setNormalizationParameters(0.0, 0.0); insertComponent(hb); VanDerWaalsSlick* vdws = new VanDerWaalsSlick(*this); vdws->setCoefficient(coeff_VDW); vdws->setup(); vdws->setNormalizationParameters(0.0, 0.0); insertComponent(vdws); PolarSolvation* ps = new PolarSolvation(*this); ps->setCoefficient(coeff_PS); ps->setup(); ps->setNormalizationParameters(0.0, 0.0); insertComponent(ps); NonpolarSolvation* nps = new NonpolarSolvation(*this); nps->setCoefficient(coeff_NPS); nps->setup(); nps->setNormalizationParameters(0.0, 0.0); insertComponent(nps); }
void ExpressionLineEdit::extendContextMenu(QMenu *menu) { if (m_clock) { menu->addSeparator(); menu->addAction(KIcon("chronometer"), i18n("Insert Clock Component..."), this, SLOT(insertComponent())); } }