I have some QSpinBoxes in which I always want to display 2 digits, even if the value is a single digit value. In other words, for values like 1 and 5 I would like to display 01 and 05. I have looked into valueFromText and textFromValue but don't think I need these since I am still just displaying integers and not characters besides 0-9. I also looked at validate, but I can't think of why I would need validate because the QSpinBox already limits the user to entering digits. I just want to prefix the single digit values with a 0. I thought about connecting the valueChanged signal to a slot to add a prefix to the number if it were less than 10, but would prefer to not handle this by connecting to the signal in case I need to capture this signal at a later time and do more complex things with it. Thanks for any ideas you may have!
Bookmarks