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.
Attachments
For Gerrit Dashboard: PYSIDE-2252 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
465872,5 | Expose QAbstractTextDocumentLayout::PaintContext | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
467100,2 | PySide6: Clean up rejections | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
467120,2 | shiboken6: Add explanatory comment about issues of field getters in lists | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |