예제 #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
파일: KoUnit.cpp 프로젝트: IGLOU-EU/krita
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(' ')));
}