- User Since
- Dec 19 2017, 10:55 PM (144 w, 1 d)
Feb 20 2020
Another option would be switching the code to use if instead of switch/case so the || operator would actually do what the code expected (and x || x, unlike duplicate case values, isn't an error)
Probably best to just add a comment explaining what needs to be done if AccountModel::* roles ever diverge from DisplayRole/DecorationRole...
Actually the obvious fix doesn't work (thought it was so obvious that I submitted it before testing, sorry) because Qt::DisplayRole and AccountModel::FriendlyName are both 0 (-> duplicate case value) and Qt::DecorationRole and AccountModel::Face are both 1 (-> duplicate case value). Also explains why the bogus variant before "worked" - (Qt::DisplayRole || AccountModel::FriendlyName) = 0 || 0 = 0 = Qt::DisplayRole = AccountModel::FriendlyName and (Qt::DecorationRole || AccountModel::Face) = 1 || 1 = 1 = Qt::DecorationRole = AccountModel::Face
Nov 6 2019
Sep 23 2019
Yes, currently busy with something totally different, but that should be finished tomorrow.