You must know that QDateTimeEdit
is inherit QAbstractSpinBox
, and QAbstractSpinBox
has wrapping mechanism, using it you can make your spins circular. So, all what you must do is
setWrapping(true)
in your case, it must be something like this: ui->dateTimeEdit->setWrapping(true);
If wrapping is true
stepping up from maximum()
value will take you to the minimum()
value and vica versa. Wrapping only make sense if you have minimum()
and maximum()
values set.
See official documentation here .
Good luck!