rangeChange();
updateDisplay();
- //connect( editor(), SIGNAL( textChanged( const QString& ) ), this, SLOT( onTextChanged( const QString& ) ) );
+ connect( editor(), SIGNAL( textChanged( const QString& ) ), this, SLOT( onTextChanged( const QString& ) ) );
}
QtxDblSpinBox::QtxDblSpinBox( double min, double max, double step, QWidget* parent, const char* name )
rangeChange();
updateDisplay();
- //connect( editor(), SIGNAL( textChanged( const QString& ) ), this, SLOT( onTextChanged( const QString& ) ) );
+ connect( editor(), SIGNAL( textChanged( const QString& ) ), this, SLOT( onTextChanged( const QString& ) ) );
}
QtxDblSpinBox::~QtxDblSpinBox()
double QtxDblSpinBox::value() const
{
- QtxDblSpinBox* _this = ( QtxDblSpinBox* )this;
- _this->clearFocus();
+ QSpinBox::value();
+
return myValue;
}
{
if ( myBlocked )
return;
-
+
+ bool upd = editor()->isUpdatesEnabled();
+ editor()->setUpdatesEnabled( false );
+
bool isBlock = myBlocked;
myBlocked = true;
QSpinBox::setValue( QSpinBox::minValue() );
else
QSpinBox::setValue( ( QSpinBox::minValue() + QSpinBox::maxValue() ) / 2 );
-
+
QSpinBox::updateDisplay();
-
+
+ editor()->setUpdatesEnabled( upd );
+
editor()->setText( myCleared ? QString::null : txt );
-
+ if ( !myCleared )
+ {
+ if ( editor()->text() == specialValueText() )
+ editor()->selectAll();
+ else
+ editor()->setSelection( prefix().length(), editor()->text().length() - prefix().length() - suffix().length() );
+ }
+
myBlocked = isBlock;
}
void QtxDblSpinBox::valueChange()
{
updateDisplay();
- emit valueChanged( value() );
+ emit valueChanged( myValue );
emit valueChanged( currentValueText() );
}
void QtxDblSpinBox::onTextChanged( const QString& str )
{
- bool isBlock = myBlocked;
- myBlocked = true;
- interpretText();
- myBlocked = isBlock;
+ if ( !myBlocked )
+ myCleared = false;
}