segfault using PyQt6 version 6.10.1
Dmitry Shachnev
mitya57 at ubuntu.com
Fri Dec 26 13:29:08 GMT 2025
Hi Phil!
On Fri, Dec 26, 2025 at 12:53:18PM +0000, Phil Thompson wrote:
> I think this may be a bug in calibre (exposed by the change in v6.10.1).
> calibre must have a Python reimplementation of createMimeDataFromSelection()
> that returns a QMimeData object. It should (according to the Qt docs) set
> the parent of that object to be the text editor. I suspect that it doesn't.
Indeed, Calibre does reimplement createMimeDataFromSelection() in two places:
https://github.com/kovidgoyal/calibre/blob/e4dd51df48b8063c2fc9324a029ffdbf61b6d4ee/src/calibre/gui2/comments_editor.py#L1028
https://github.com/kovidgoyal/calibre/blob/e4dd51df48b8063c2fc9324a029ffdbf61b6d4ee/src/calibre/gui2/tweak_book/widgets.py#L1281
The first one gets the QMimeData from super().createMimeDataFromSelection(),
so it probably already has the correct parent.
The second one probably needs a ans.setParent(self) call. Can you please
confirm this?
This will work with both old (≤ 6.10.0) and new (6.10.1) PyQt, right?
Frescobaldi does the same, I left a comment there:
https://github.com/frescobaldi/frescobaldi/issues/2126#issuecomment-3692845244
--
Dmitry Shachnev
More information about the PyQt
mailing list