我有一个QDateTimeEdit对象,设置如下:
self.MyInput = QtGui.QDateTimeEdit(Form)
self.MyInput.setCalendarPopup(True)
self.MyInput.setDisplayFormat("dd/MM/yyyy hh:mm")
self.MyInput.setGeometry(88,25,110,20)
当按下按钮时,我想调用一个函数,基本上从输入框中删除日期值,如下所示:
self.MyInput.setDisplayFormat("") #but it doesn't work
我想得到的可视化结果只是一个空的输入框。有人知道怎么做吗?你知道吗
从当时的继承情况来看
http://srinikom.github.io/pyside-docs/PySide/QtGui/QDateTimeEdit.html#PySide.QtGui.PySide.QtGui.QDateTimeEdit.dateTime
QDateTimeEdit继承了提供clear()方法的QAbstractSpinBox,这是您想要的吗?你知道吗
http://srinikom.github.io/pyside-docs/PySide/QtGui/QAbstractSpinBox.html#PySide.QtGui.PySide.QtGui.QAbstractSpinBox.clear
相关问题 更多 >
编程相关推荐