mchara
lineEdit() function is protected.
Do you mean it's not possible to set validator for spin box without inheriting it?
I'm already using QSpinBox class objects everywhere, how should I set validator for those objects?
mchara
lineEdit() function is protected.
Do you mean it's not possible to set validator for spin box without inheriting it?
I'm already using QSpinBox class objects everywhere, how should I set validator for those objects?
If you're using Designer, you can use the "Promote to" tool available from context menu of items dropped on forms. If you're not using Designer then simply replace instances of QSpinBox with proper subclasses. However I would go for reimplementing validate() rather than trying tricks with spinbox's lineEdit.
Bookmarks