return QVariant();
}
+/*!
+ \brief Get double spin box preference item precision value.
+ \return double spin box precision
+ \sa setPrecision()
+*/
+QVariant QtxPagePrefSpinItem::precision() const
+{
+ if ( QtxDoubleSpinBox* dsb = ::qobject_cast<QtxDoubleSpinBox*>( control() ) )
+ return dsb->decimals();
+ else
+ return QVariant();
+}
+
/*!
\brief Get spin box preference item minimum value.
\return spin box minimum value
}
}
+/*!
+ \brief Set double spin box preference item precision value.
+ \param step new double spin box precision value
+ \sa precision()
+*/
+void QtxPagePrefSpinItem::setPrecision( const QVariant& prec )
+{
+ if ( QtxDoubleSpinBox* dsb = ::qobject_cast<QtxDoubleSpinBox*>( control() ) )
+ {
+ if ( prec.canConvert( QVariant::Int ) ) {
+ dsb->setDecimals( prec.toInt() );
+ dsb->setPrecision( prec.toInt() );
+ }
+ }
+}
+
/*!
\brief Set spin box preference item minimum value.
\param min new spin box minimum value
return maximum();
else if ( name == "step" )
return step();
+ else if ( name == "precision" )
+ return precision();
else if ( name == "prefix" )
return prefix();
else if ( name == "suffix" )
setMaximum( val );
else if ( name == "step" )
setStep( val );
+ else if ( name == "precision" )
+ setPrecision( val );
else if ( name == "prefix" )
{
if ( val.canConvert( QVariant::String ) )
{
QVariant val;
QVariant stp = step();
+ QVariant prec = precision();
QVariant min = minimum();
QVariant max = maximum();
control()->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
setStep( stp );
+ setPrecision( prec );
setMinimum( min );
setMaximum( max );
virtual ~QtxPagePrefSpinItem();
QVariant step() const;
+ QVariant precision() const;
QVariant minimum() const;
QVariant maximum() const;
QString specialValueText() const;
void setStep( const QVariant& );
+ void setPrecision( const QVariant& );
void setMinimum( const QVariant& );
void setMaximum( const QVariant& );