Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-121697

Critical crash when creating QPlainTextEdit when using styles/stylesheets.

XMLWordPrintable

    • All
    • c6af5b9c1 (dev), e9b187a83 (6.7), ff1f12d5a (6.6), 293772f5f (tqtc/lts-6.5), b47ad83d7 (6.6.2)

      I updated Qt to the latest 6.6 repo. I have a styled widgets application and it started crashing in the QPlainTextEdit constructor. 

      I've tracked the error to commit I5c32f5af8b284749732b610e56b4e3d8c8ed1946, QTBUG-1857 because of the change on line 2473 in qwidgettextcontrol.cpp. 

      I've added a number of screenshots of the stacktrace.

       

      In stacktrace2.png one sees that control is being constructed. Further in stacktrace5.png, q->setCursorWidth( minus 1 ) is called, which causes QApplication::style()>pixelMetric() to be called in stacktrace6.png. This is where the code was changed in the commit above, passing the parent widget. This causes QPlainTextEdit::isReadOnly() to be called in QStyleSheetStyle::renderRule line 2157, stacktrace8.png. At stacktrace9.png shows, d->control->textInteractionFlags() is tested. Howerver, d->control is still nullptr as it is still being constructed (stacktrace2.png).

       

        1. stacktrace9.png
          328 kB
          Harald Vistnes
        2. stacktrace1.png
          165 kB
          Harald Vistnes
        3. stacktrace2.png
          348 kB
          Harald Vistnes
        4. stacktrace3.png
          331 kB
          Harald Vistnes
        5. stacktrace4.png
          335 kB
          Harald Vistnes
        6. stacktrace5.png
          326 kB
          Harald Vistnes
        7. stacktrace6.png
          333 kB
          Harald Vistnes
        8. stacktrace7.png
          356 kB
          Harald Vistnes
        9. stacktrace8.png
          368 kB
          Harald Vistnes
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            chehrlic Christian Ehrlicher
            harald Harald Vistnes
            Votes:
            3 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: