Don't assign a QtObject to a model

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



It's a weird thing to do, and that's causing us to hit 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

R120 Plasma Workspace
Automatic diff as part of commit; lint not applicable.
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.May 21 2019, 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.May 21 2019, 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.