Bug 479606

Summary: OverlayDrawer crashes when setting modal from true to false if drawer is visible
Product: [Frameworks and Libraries] frameworks-kirigami Reporter: Jack Hill <jackhill3103>
Component: generalAssignee: kdelibs bugs <kdelibs-bugs-null>
Status: RESOLVED UPSTREAM    
Severity: crash CC: me, nicolas.fella, notmart
Priority: NOR    
Version First Reported In: Master   
Target Milestone: Not decided   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Basic QML file showing how to reproduce the crash in pure Qt. Not sure if this is a bug in Qt or a misuse of Templates.

Description Jack Hill 2024-01-10 13:09:48 UTC
Created attachment 164785 [details]
Basic QML file showing how to reproduce the crash in pure Qt. Not sure if this is a bug in Qt or a misuse of Templates.

SUMMARY
When the OverlayDrawer is visible and modal is changed from true to false, the app crashes. The crash can be fixed by inheriting from QtQuick.Controls.Drawer instead of QtQuick.Templates.Drawer. I'm not sure if this is a bug in Qt Quick or if Kirigami is misusing the template, hence why I'm reporting the bug here.

I've attached a minimal Qt-only demonstrating the issue. Run the code and press the button twice and the app will crash. Swap T.Drawer for C.Drawer and the app works just fine.

In terms of apps the issue can be reproduced in Koko:
1. Run app in desktop mode
2. Reduce the window width until the sidebar hides and becomes modal
3. Increase the window width

Observed result: app crashes
Expected result: non-modal sidebar re-appears

Can also be reproduced with the Sidebar.qml example provided by Kirigami.
Comment 1 Jack Hill 2024-01-10 13:12:03 UTC
Using Qt version 6.6.1 in /usr/lib64 from openSUSE repos btw
Comment 2 Nicolas Fella 2024-01-10 14:05:13 UTC
This is a Qt bug, fixed in 6.6.2

See https://codereview.qt-project.org/c/qt/qtdeclarative/+/522438