
Originally Posted by
rexi
Is it only the stepDown slot? The stepUp/Down slots are public in QDoubleSpinBox, and you are redeclaring them as private. Maybe that's causing your problem.
makeing the slots public changes nothing. The functions are still not called at button up or down.
EDIT:
If I use the correct virtual function it works:
// overwritten virtual function of QAbstractSpinBox
void QScienceSpinBox::stepBy(int steps)
{
if (steps < 0)
stepDown();
else
stepUp();
}
void QScienceSpinBox::stepDown()
{
QSBDEBUG() << "stepDown()";
setValue(value()/10.0);
}
void QScienceSpinBox::stepUp()
{
QSBDEBUG() << "stepUp()";
setValue(value()*10.0);
}
// overwritten virtual function of QAbstractSpinBox
void QScienceSpinBox::stepBy(int steps)
{
if (steps < 0)
stepDown();
else
stepUp();
}
void QScienceSpinBox::stepDown()
{
QSBDEBUG() << "stepDown()";
setValue(value()/10.0);
}
void QScienceSpinBox::stepUp()
{
QSBDEBUG() << "stepUp()";
setValue(value()*10.0);
}
To copy to clipboard, switch view to plain text mode
Bookmarks