Skip to content

Avoid a crash with kscreenlocker_greet or any other QGuiApplication

A crash accessing QApplication::style() when the hosting application is only a QGuiApplication was fixed by commit 1e02355c in response to https://bugs.kde.org/show_bug.cgi?id=396287, but there appear to be been changes to Qt since then which mean that even testing qApp->style() in the KQuickStyleItem constructor will assert.

Check that qApp really is a QApplication before trying to do anything with its style(), and comment that any QApplication function must be checked or guarded to avoid a crash with a QGuiApplication.

Merge request reports