def createEditor(self, parent, option, index):
        editor = QDateEdit(parent=parent)

        editor.setMinimumDate(datetime.datetime(year=2017, month=9, day=1))
        editor.setMaximumDate(datetime.datetime(year=2020, month=9, day=1))
        editor.setDisplayFormat("yyyy-MM-dd")
        editor.setCalendarPopup(True)

        # setFrame(): tell whether the line edit draws itself with a frame.
        # If enabled (the default) the line edit draws itself inside a frame, otherwise the line edit draws itself without any frame.
        editor.setFrame(False)

        return editor
    def createEditor(self, parent, option, index):
        editor = QDateEdit(parent=parent)

        editor.setMinimumDate(datetime.datetime(year=2017, month=9, day=1))
        editor.setMaximumDate(datetime.datetime(year=2020, month=9, day=1))
        editor.setDisplayFormat("yyyy-MM-dd")
        editor.setCalendarPopup(True)

        # setFrame(): tell whether the line edit draws itself with a frame.
        # If enabled (the default) the line edit draws itself inside a frame, otherwise the line edit draws itself without any frame.
        editor.setFrame(False)

        return editor
Example #3
0
 def createEditor(self, parent: QWidget, option,
                  index: QModelIndex) -> QWidget:
     editor = QDateEdit(parent)
     editor.setFrame(False)
     editor.setMinimumDate(date(year=2021, month=1, day=1))
     return editor