I have am trying to let my user pick a date and enter into the datebase using the dateedit widget and im doing this by using a delegate but for some reason it attaches the time aswell
class ProductDelegate(QtSql.QSqlRelationalDelegate):
def __init__(self):
super().__init__()
def createEditor(self, parent, option, index):
if index.column() == 3:
editor = QtGui.QDateEdit(parent)
now = QtCore.QDate.currentDate()
editor.setMinimumDate(now)
editor.setCalendarPopup(True)
return editor
else:
return QtSql.QSqlRelationalDelegate.createEditor(self, parent, option, index)
the string that's left once the date is picked is something like '30/01/2015 00:00:00' I do not want the time in there? what is the work around this?