Skip to content

[applets/batterymonitor] Restructure GridLayout based table into model-view

ivan tkachenko requested to merge work/ratijas/battery/v63-change-batteries into master

Time to change my mind. I was the one who earlier refactored it from an (abusive) model based implementation to a simply bunch of components. But now I found the perfect way to reparent whole rows of Items to a GridLayout — or any other layout type for that matter. The secret, as always in QML land, is to have some deeply magical very built-in and insanely integrated way of doing things: extra Repeater + ObjectModel.


No visual changes except new smallSpacing between the health notice and the "table". No regressions found.

Also the first commit in this chain adds tons of null checks for this component, so it can be considered a (potential) bugfix.

Thanks QML for being so obvious. I've been looking for such thing for ages. This is fúкin perfection 🤌

Merge request reports