I need to get the date of a QDateEdit
. I made the designer using Qt Designer, in properties enabled calendarPopup
and displayFormat
to dd/MM/yyyy
.
I want to capture this date to insert into a query. I've tried using the following codes:
data = self.dlg.data.currentDate() # apresenta um erro 'QDateEdit' object has no attribute 'currentDate'
I've tried another way:
data = self.dlg.data.date() # Até pego a data, mas no formato estranho veja: "PyQt4.QtCore.QDate(2016, 9, 14)"
I also used:
data = self.dlg.data.currentSection() # traz um número 512, mas não no formato dd/MM/yyyy.
What is the solution?