Below is the example code:
date = "1-Jan-2020"
widget_date = QtWidgets.QDateEdit()
widget_date .setDisplayFormat("d-MMM-yyyy")
widget_date .setDate(QDate.fromString(date))
I want to set that date to QtWidgets.QDateEdit(). But it is setting up the default date as 1-jan-2000
You are confusing concepts,
setDisplayFormat()
establishes the format of how the text will be displayed in the widget and nothing intervenes with the conversion of the string to QDate: