Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.6.1, 6.8
-
None
-
Windows 11; MSVC 2019 & MSVC 2022
-
-
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
- is duplicated by
-
PYSIDE-2598 Qt.Orientation used in combination with Property causes crash
- Closed
-
QTBUG-121697 Critical crash when creating QPlainTextEdit when using styles/stylesheets.
- Closed
- resulted from
-
QTBUG-1857 Ensure that when pixelMetric() is called, the widget pointer is always passed
- Closed
For Gerrit Dashboard: QTBUG-121790 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
538197,1 | Q(Plain)TextEdit: don't crash when using a style sheet | tqtc/lts-6.2 | qt/tqtc-qtbase | Status: NEW | 0 | 0 |
537295,6 | Q(Plain)TextEdit: don't crash when using a style sheet | dev | qt/qtbase | Status: MERGED | +2 | 0 |
537841,2 | Q(Plain)TextEdit: don't crash when using a style sheet | 6.7 | qt/qtbase | Status: MERGED | +2 | 0 |
537914,2 | Q(Plain)TextEdit: don't crash when using a style sheet | 6.6 | qt/qtbase | Status: MERGED | +2 | 0 |
538057,2 | Q(Plain)TextEdit: don't crash when using a style sheet | 6.6.2 | qt/qtbase | Status: MERGED | +2 | 0 |
538059,2 | Q(Plain)TextEdit: don't crash when using a style sheet | tqtc/lts-6.5 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |