Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
标准行为是,只要一天达到 31,升压按钮就会停止工作。我希望它重置为 1 并跳转到下个月。
我没有机会对此进行测试,但我知道 QDateEdit 实现了 QAbstractSpinBox,因此您应该可以调用
myDateEdit.setWrapping(True)
这应该完成你想要的。
文档链接
更新:
这种行为的术语显然被称为“翻转”,这是一个人的实现,(同样,我没有测试过)似乎是另一种潜在的解决方案:
翻转QDate编辑
他指出,他的实施没有考虑最小或最大日期。