Explicitely unset QtQuickControls desktop style for non-QApplications
AbandonedPublic

Authored by arojas on Sep 22 2017, 8:56 PM.

Details

Reviewers
davidedmundson
Group Reviewers
Plasma
Summary

QGuiApplications will crash if the QtQuickControls style (either 1 or 2) is set to desktop, so make sure to unset it in that case.

Test Plan

Login to Plasma session, make sure that QT_QUICK_CONTROLS_STYLE=org.kde.desktop and QT_QUICK_CONTROLS_1_STYLE=/whatever/Desktop, check that Minuet, KAlgebra Mobile and the mapviewer example from QtLocation run correctly and don't crash anymore

Diff Detail

Repository
R135 Integration for Qt applications in Plasma
Lint
Lint Skipped
Unit
Unit Tests Skipped
arojas created this revision.Sep 22 2017, 8:56 PM
Restricted Application added a project: Plasma. · View Herald TranscriptSep 22 2017, 8:56 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
davidedmundson requested changes to this revision.Sep 22 2017, 10:29 PM

I don't see why we should be unsetting anything if a user has explicitly gone out of their way to set it.

We're not doing it from startkde anymore.

This revision now requires changes to proceed.Sep 22 2017, 10:29 PM

I don't see why we should be unsetting anything if a user has explicitly gone out of their way to set it.

We're not doing it from startkde anymore.

It's not the user who sets it, it's plasmashell. See my last comment in bug 384481

davidedmundson accepted this revision.Sep 22 2017, 11:25 PM

I see, shame we're not still using kinit.

Patch makes sense. Thanks

This revision is now accepted and ready to land.Sep 22 2017, 11:25 PM

This change would also fix the crashes if the style was set in startkde as it used to, does it make sense to revert the change or you prefer to leave it where it is?

Revert what?

The move of the style setting from startkde to plasma-integration

We shouldn't. It doesn't gain us anything.

More importantly, the one thing this patch doesn't cover is apps that don't have desktopSettingsAware set as they'll never load the qpt.

Edit: given were doing this in c++in process, maybe can we just call
https://doc.qt.io/qt-5/qquickstyle.html#setStyle

Instead of messing about with environment variables?

Indeed, replacing the qputenv line with QQuickStyle::setStyle(QLatin1String("org.kde.desktop")) fixes the inheritance problem: minuet doesn't crash anymore and systemsettings is correctly themed. Unfortunately QQC1 (such as kalgebramobile) still crash, is there something equivalent for QQC1?

Opened D7953 for the QQuickStyle approach. Keeping this open in case the new dependency is not acceptable for 5.11 at this stage.

arojas abandoned this revision.Sep 25 2017, 6:32 PM

Superseded by D7953