bool K3b::IntMapComboBox::insertItem( int value, const QString& text, const QString& description, int index ) { if( d->valueIndexMap.contains( value ) ) return false; if ( index < 0 || index > QComboBox::count() ) { index = QComboBox::count(); } d->values.insert( index, qMakePair<int, QString>( value, description ) ); d->buildValueIndexMap(); QComboBox::insertItem( index, text ); d->updateWhatsThis(); // select a default value. This is always wanted in K3b if ( QComboBox::currentIndex() < 0 ) { setSelectedValue( d->values[0].first ); } return true; }
void CSVSettings::RangeView::slotUpdateView (int value) { QString textValue = ""; QStringList list; switch (mRangeType) { case CSMSettings::Type_SpinBox: list = static_cast <SpinBox *> (mRangeWidget)->valueList(); if (!list.isEmpty()) textValue = list.at(value); break; default: break; } if (textValue.isEmpty()) textValue = QVariant (value).toString(); setSelectedValue (textValue, false); View::updateView(); }
void CSVSettings::RangeView::slotUpdateView (double value) { setSelectedValue (QVariant(value).toString(), false); View::updateView(); }