Unsolved QDateTimeEdit increments
-
How do I put an increment for 30 minutes on the QDateTimeWidget so that the user can only increment time by half an hour for example, 10:30 to 11:00 and so on.
-
@BlueBreezy
I assume that whatever you can do will be via https://doc.qt.io/qt-5/qdatetimeedit.html#stepEnabled and https://doc.qt.io/qt-5/qdatetimeedit.html#stepBy. -
will this work using Pyqt5
-
@BlueBreezy
Yes. They are bothvirtual
, you would have to sub-class and override. Whether they are the right to thing to try to use I'm not sure. There doesn't seem to be anything obvious (to me) to achieve what you want.P.S.
My suspicions conformed by https://stackoverflow.com/questions/47188200/qtimeedit-how-to-increment-to-next-hour-when-minutes-are-incremented. Only example I've found, see howstepBy
is being overridden. I think that question/answer applies to your situation. Or similarly https://stackoverflow.com/questions/48150522/qtimeedit-change-only-hours. -
@JonB ok thanks I will check