Is it possible to create a custom range for a spinbox? Additionally, that range could be changed at run time. The range would have a initial value (design time) of -20 to 25. Those values are for a spinner that determines zoom ratio for a loaded image. The reason for the custom range is that I cannot have zero in the range of values - either the initial range or any calculated range thereafter. If re-implementing the class, how then would you keep the spinner from selecting zero in the range from minimum to maximum? It would have to, for instance go from -1 to 1 or vice-versa.
If I created a custom spinner class and in designer promoted the spinner to use it, using the validate method doesn't help in "skipping" zero when clicking up/down within the range, unless I am missing something.
Thanks in advance.


Reply With Quote


. I guess a test range that never sees a zero and then go outside that range would force a call to QAbstractSpinBox::fixup(). In fixup() I then have to come up with handling the prior value to determine what the stepBy value would be. Perhpaps it be better to just handle the cached value of the last value of the spinbox and then call directly stepBy.

Bookmarks