我有一个启用日历的 QDateEdit,并试图捕捉编辑的结束:
the_date = QDateEdit(...)
<some more initialization>
the_date.setCalendarPopup(True)
the_date.editingFinished.connect(checkDate)
...
def checkDate():
print ("checkDate called")
如果我从键盘编辑日期,checkDate()
当焦点通过 Tab 键离开小部件时被调用,按回车键等。但是如果我点击强制显示日历的向下箭头,checkDate()
当日历出现时立即调用,然后再次调用小部件失去焦点。我不想与 userDateChanged 绑定,因为它会在编辑框中的每次击键时发出信号。