Don't assign a QtObject to a model
ClosedPublic

Authored by davidedmundson on May 18 2019, 5:19 PM.

Details

Summary

It's a weird thing to do, and that's causing us to hit
https://bugreports.qt.io/browse/QTBUG-75900 when it tries to lookup a
property (icon) that we don't have.

BUG: 407220

Test Plan

Opened sddm-greeter --test-mode --theme clicked button

Diff Detail

Repository
R120 Plasma Workspace
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
davidedmundson created this revision.May 18 2019, 5:19 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMay 18 2019, 5:19 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
davidedmundson requested review of this revision.May 18 2019, 5:19 PM
apol added a subscriber: apol.May 19 2019, 12:17 AM

To do this in the past I've used an object array which would read a bit less hacky.

userListModel: [ QtObject { /*...*/} ]

That would still hit the Qt crash unless I declare all used properties, which is the part I wanted to avoid.

fvogt accepted this revision.Tue, May 21, 11:54 AM
fvogt added a subscriber: fvogt.

Tested on top of the 5.16 beta, works fine. Please add a comment referencing the QTBUG though, so that this doesn't get reintroduced by accident.

This revision is now accepted and ready to land.Tue, May 21, 11:54 AM

FWIW, the relevant Qt bug is fixed.

Yes, but the workaround here has no actual downsides, and the upside is avoiding a guaranteed crash with the still latest non-development release of Qt.

This revision was automatically updated to reflect the committed changes.