See https://bugs.kde.org/show_bug.cgi?id=396287
Setting QT_QUICK_CONTROLS_STYLE=org.kde.desktop used to be safe but has started the cause applications to crash. Or I just never ran into what seem to be random (from a Joe User experience) but in fact are QGuiApplication-based applications.
This patch presents a proof-of-concept fix that makes it safe to set QT_QUICK_CONTROLS_STYLE or whatever other options there are to use the QQC2 desktop style in all applications that use QuickControls2.
The current implementation creates a local instance of the user's current desktop style obtained from KConfig, with Qt's built-in Fusion style as fallback. Creating a new QStyle instance is an easy way to follow changes to the user style. There's probably some optimisation to be done here though I'm not convinced it will make any difference in practice, in the general context of using QtQuick.
An alternative approach would be to do the programmatic equivalent of the command-line override (e.g. quickcontrols2/gallery/gallery -style Default) but I have not yet been able to figure out if it is possible to change the QQuickStyle at this point. Probably not.