
Originally Posted by
hakermania
I have a Spinbox. Its maximum value is 99, although this doesn't avoids the user to input e.g.
000000000000000000000000000000000000099
this is quite weird :/
I'd say 0000000000000000099 is exactly 99 which is in the bounds specified by the minimum and maximum value allowed.
How can i change the max input length of the spinbox? I found nothing from the properties menu

thx for any answer!
Reimplement validate() and/or fixup(). The former should be quite easy:
}
QValidator::State MySpinBox::validate( QString &text, int pos) const {
if(text.size()>2) return QValidator::Invalid;
return QSpinBox::validate(text, pos);
}
To copy to clipboard, switch view to plain text mode
Bookmarks