Details
Description
QAbstractTextDocumentLayout::PaintContext.selections is missing from the python bindings, in both PySide2 and PySide6. This leaves python code unable to highlight text when drawing a QTextDocument.
To reproduce, run this program:
#!/usr/bin/env python3
from PySide6.QtGui import QAbstractTextDocumentLayout
context = QAbstractTextDocumentLayout.PaintContext()
print(context.selections)
Expected result:
[]
Actual result:
Traceback (most recent call last):
File "test_paintcontext_selections", line 4, in <module>
print(context.selections)
AttributeError: 'PySide2.QtGui.QAbstractTextDocumentLayout.PaintCon' object has no attribute 'selections'
Workaround: Use PyQt instead of the official bindings. PyQt correctly exposes the selections attribute.