我正在构建一个应用程序来从特定的 FTP 平台下载日志文件,我还希望用户能够在单独的 QDateTimeEdit 小部件中选择开始和停止日期。这将让程序选择适当的日志文件。
当用户连接到平台时,datetime
会根据日志文件的可用性设置最小值和最大值. 小部件不会滚动到下个月。
我是否缺少启用或禁用翻转的属性?
我是否可以插入自定义 python (3.6) 代码来创建翻转?我的谷歌搜索除了2008 年的自定义 C++ 代码之外什么也没有产生stepBy
,我无法很好地阅读它。
这是 .ui 文件的 XML 版本:
<widget class="QDateTimeEdit" name="timestart">
<property name="geometry">
<rect>
<x>510</x>
<y>155</y>
<width>126</width>
<height>22</height>
</rect>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="displayFormat">
<string notr="true">yyyy-MM-dd HH:mm:ss</string>
</property>
</widget>
<widget class="QDateTimeEdit" name="timeend">
<property name="geometry">
<rect>
<x>510</x>
<y>205</y>
<width>126</width>
<height>22</height>
</rect>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="displayFormat">
<string notr="true">yyyy-MM-dd HH:mm:ss</string>
</property>
</widget>
我意识到启用calendarPopup
也是一种解决方法,但在设计方面,如果我能找到解决翻转问题的 Pythonic 方法,我宁愿不这样做。