Пример #1
0
void KWApplicationConfig::setUnit(const KoUnit &unit)
{
    KSharedConfigPtr config = KGlobal::config();
    KConfigGroup misc = config->group("Misc");
    misc.writeEntry("Units", unit.symbol());
    misc.sync();
}
Пример #2
0
QDebug operator<<(QDebug debug, const KoUnit &unit)
{
#ifndef NDEBUG
    debug.nospace() << unit.symbol();
#else
    Q_UNUSED(unit);
#endif
    return debug.space();

}
void KoUnitDoubleSpinBox::setUnit( KoUnit unit )
{
    double oldvalue = d->unit.fromUserValue( QDoubleSpinBox::value() );
    QDoubleSpinBox::setMinimum( unit.toUserValue( d->lowerInPoints ) );
    QDoubleSpinBox::setMaximum( unit.toUserValue( d->upperInPoints ) );
    QDoubleSpinBox::setSingleStep( unit.toUserValue( d->stepInPoints ) );
    d->unit = unit;
    QDoubleSpinBox::setValue( KoUnit::ptToUnit( oldvalue, unit ) );
    setSuffix(unit.symbol().prepend(QLatin1Char(' ')));
}