Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
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.
JonB last edited by
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
JonB last edited by JonB
Yes. They are both
virtual, 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.
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 how
stepByis 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