Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
6.3
-
None
-
-
0e62c4db50 (pyside/pyside-setup/dev) 963121d36c (pyside/pyside-setup/6.3) 963121d36c (pyside/tqtc-pyside-setup/6.3) 0e62c4db50 (pyside/tqtc-pyside-setup/dev) e794e7c35e (pyside/tqtc-pyside-setup/5.15) d263e1833e (pyside/tqtc-pyside-setup/6.2)
Description
I cannot read QTextLayout from a QTextEdit. The following code return:
"RuntimeError: Internal C++ object (PySide6.QtGui.QTextLayout) already deleted.
[Finished in 151ms with exit code 1]"
import sys from PySide6.QtWidgets import * from PySide6.QtCore import * from PySide6.QtGui import * app = QApplication(sys.argv) edit = QTextEdit() edit.setText("sacha") edit.show() layout = edit.document().find(QRegularExpression("sacha")).block().layout() print(layout.boundingRect()) app.exec()