Skip to content

Overriding QDateEdit.textFromDateTime causes segmentation fault #341

@DJCatBlitz

Description

@DJCatBlitz

The example below crashes eventually after some time when objects are cleaned up. I haven't found a way to force the crash directly in a simple script. When the DateEdit is used in a module, it crashes instantly when the module window is opened.

from PythonQt.QtCore import Qt, QDate, QDateTime, QTime
from PythonQt.QtGui import QDateEdit

class DateEdit(QDateEdit):
    def textFromDateTime(self, dt: QDateTime) -> str:
        return QDateEdit.textFromDateTime(self, dt)

d = DateEdit()
d.setDate(QDate(2000, 5, 5))
print(d.date.isValid())

It also crashes when I return an empty string instead of calling "QDateEdit.textFromDateTime"

 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions