Class: QgsDateEdit

class qgis.gui.QgsDateEdit(parent: QWidget = None)

Bases: QgsDateTimeEdit

Constructor for QgsDateEdit. The current time is used by default. The widget is allowing null by default. If allow null is disabled, you should check allowNull before getting values from the widget.

The QgsDateEdit class is a QDateEdit widget with the capability of setting/reading null dates.

Warning

You should use the signal valueChanged of this subclass rather than QDateTimeEdit.dateChanged. (If you consequently connect parent’s dateChanged signal and call date() afterwards there is no guarantee that NULL values will be correctly handled).

See also

QgsDateTimeEdit

See also

QgsTimeEdit

New in version 3.14.

Parameters

parent

actionEvent()
changeEvent()
childEvent()
closeEvent()
connectNotify()
contextMenuEvent()
create()
customEvent()
dateTimeFromText()
dateValueChanged

Signal emitted whenever the date changes. [signal]

Parameters

date (Union[QDate) –

destroy()
disconnectNotify()
displayNull()
dragEnterEvent()
dragLeaveEvent()
dragMoveEvent()
dropEvent()
emitValueChanged(self, value: Any)
Parameters

value (Any) –

enterEvent()
fixup()
focusInEvent()
focusNextChild()
focusNextPrevChild()
focusOutEvent()
focusPreviousChild()
hideEvent()
initPainter()
initStyleOption()
inputMethodEvent()
isNull()
isSignalConnected()
keyPressEvent()
keyReleaseEvent()
leaveEvent()
lineEdit()
metric()
mouseDoubleClickEvent()
mouseMoveEvent()
mousePressEvent()
mouseReleaseEvent()
moveEvent()
nativeEvent()
paintEvent()
receivers()
resizeEvent()
sender()
senderSignalIndex()
setDate(self, date: Union[QDate, datetime.date])

Sets the date for the widget and handles null dates.

Note

Since QDateTimeEdit.setDate() is not virtual, setDate must be called for QgsDateEdit.

Parameters

date (Union[QDate) –

setLineEdit()
sharedPainter()
showEvent()
stepEnabled()
tabletEvent()
textFromDateTime()
timerEvent()
updateMicroFocus()
validate()
wheelEvent()