Date/Time Spinner Step Buttons: Change to Left/Right Arrows -- April 2014 -- RiverWare 6.5
Phil Weinstein, CADSWES, 4-28-2014

The Date/Time Spinner's step buttons were changed from Up/Down orientation to Left/Right.

This was done by hiding the base class' (QSpinBox's) internal step buttons, and deploying our own custom buttons. The DateTimeQtSpinner class used to be a QSpinBox subclass. It has been changed to a QWidget subclass containing internal widgets: a QSpinBox subclass instance and two QPushButton subclass instances. The sizes of the new step buttons, and of the custom-drawn triangle arrows, are a function of the current font metrics.

The image below demonstrates the old and new Date/Time spinners in the Pie Chart (along with a Date/Time Spinner Slider, with animation controls) -- with two different size fonts. Note the sizes of the step button triangle-arrows.

The new step buttons have these tooltips:

Stepping repeats when holding down one of the step buttons. This is implemented with a QTimer, initially with the following timing constants:

// Step button repeating (when held down).
static const int REPEAT_DELAY_MSECS  (600); // milliseconds
static const int REPEAT_PERIOD_MSECS (150); // milliseconds

See other images:

  1. Open Slot Dialog, Larger Font
  2. Pie Chart Dialog, Normal Font
  3. Pie Chart Dialog, Larger Font
---