Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-1939

Cannot read QTextLayout

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.15.15
    • 6.3
    • PySide
    • None
    • Linux/X11
    • 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()
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kleint Friedemann Kleint
            sschutz sacha schutz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: