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

QApplication::setStyleSheet crashes QTextEdit

    XMLWordPrintable

Details

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

    Description

      The following minimal example gives me a crash:

      #include <QApplication>
      #include <QTextEdit>
      
      int main(int argc, char **argv) 
      {
          QApplication app(argc, argv);
          app.setStyleSheet("QWidget { font: 10pt; }");
      
          QTextEdit edit;
          edit.show();
      
          return app.exec();
      }
      

      Windows Debugger:

      Exception has occurred: W32/0xC0000005
      Exception thrown: read access violation.
      this was 0x8.
      

      Stack:

      Qt6Widgetsd.dll!QScopedPointer<QObjectData,QScopedPointerDeleter<QObjectData>>::get() Line 112 (c:\tt\develop\usr\src\qt\qtbase\src\corelib\tools\qscopedpointer.h:112)
      Qt6Widgetsd.dll!qGetPtrHelper<QScopedPointer<QObjectData,QScopedPointerDeleter<QObjectData>> const>(const QScopedPointer<QObjectData,QScopedPointerDeleter<QObjectData>> & ptr) Line 79 (c:\tt\develop\usr\src\qt\qtbase\src\corelib\global\qtclasshelpermacros.h:79)
      Qt6Widgetsd.dll!QWidgetTextControl::d_func() Line 53 (c:\tt\develop\usr\src\qt\qtbase\src\widgets\widgets\qwidgettextcontrol_p.h:53)
      Qt6Widgetsd.dll!QWidgetTextControl::textInteractionFlags() Line 3078 (c:\tt\develop\usr\src\qt\qtbase\src\widgets\widgets\qwidgettextcontrol.cpp:3078)
      Qt6Widgetsd.dll!QTextEdit::isReadOnly() Line 2216 (c:\tt\develop\usr\src\qt\qtbase\src\widgets\widgets\qtextedit.cpp:2216)
      Qt6Widgetsd.dll!QStyleSheetStyle::renderRule(const QObject * obj, const QStyleOption * opt, int pseudoElement) Line 2160 (c:\tt\develop\usr\src\qt\qtbase\src\widgets\styles\qstylesheetstyle.cpp:2160)
      Qt6Widgetsd.dll!QStyleSheetStyle::pixelMetric(QStyle::PixelMetric m, const QStyleOption * opt, const QWidget * w) Line 4967 (c:\tt\develop\usr\src\qt\qtbase\src\widgets\styles\qstylesheetstyle.cpp:4967)
      Qt6Widgetsd.dll!QWidgetTextControl::setCursorWidth(int width) Line 2473 (c:\tt\develop\usr\src\qt\qtbase\src\widgets\widgets\qwidgettextcontrol.cpp:2473)
      Qt6Widgetsd.dll!QWidgetTextControlPrivate::init(Qt::TextFormat format, const QString & text, QTextDocument * document) Line 402 (c:\tt\develop\usr\src\qt\qtbase\src\widgets\widgets\qwidgettextcontrol.cpp:402)
      Qt6Widgetsd.dll!QWidgetTextControl::QWidgetTextControl(QObject * parent) Line 856 (c:\tt\develop\usr\src\qt\qtbase\src\widgets\widgets\qwidgettextcontrol.cpp:856)
      Qt6Widgetsd.dll!QTextEditControl::QTextEditControl(QObject * parent) Line 56 (c:\tt\develop\usr\src\qt\qtbase\src\widgets\widgets\qtextedit.cpp:56)
      Qt6Widgetsd.dll!QTextEditPrivate::init(const QString & html) Line 123 (c:\tt\develop\usr\src\qt\qtbase\src\widgets\widgets\qtextedit.cpp:123)
      Qt6Widgetsd.dll!QTextEdit::QTextEdit(QWidget * parent) Line 605 (c:\tt\develop\usr\src\qt\qtbase\src\widgets\widgets\qtextedit.cpp:605)
      a.exe!main(int argc, char * * argv) Line 9 (c:\tt\develop\src\TT_CodeBase\LabSoft\a\main.cpp:9)
      a.exe!invoke_main() Line 79 (d:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:79)
      a.exe!__scrt_common_main_seh() Line 288 (d:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)
      a.exe!__scrt_common_main() Line 331 (d:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:331)
      a.exe!mainCRTStartup(void * __formal) Line 17 (d:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp:17)
      kernel32.dll!00007ffe6cbc257d() (Unknown Source:0)
      ntdll.dll!00007ffe6d72aa58() (Unknown Source:0)
      

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-121790
          # Subject Branch Project Status CR V

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              bebuch Benjamin Buch
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: