Several years ago, the KDE project had a FlatProxyModel class. It doesn't seem to be a part of the current project, but you can still find it online as part of some other projects in the kptflatproxymodel.[h, cpp] files.

There is now a KDescendantsProxyModel in the KDE Frameworks (KItemModels section) which looks like it might be the replacement for the FlatProxyModel class.

These are both KDE "Tier 1" classes, meaning they have no dependence on other parts of KDE, only on Qt.

These do essentially the same thing as your private model does - flatten a tree into a table by turning each leaf into a row. Parents are added as new columns at the start of the row. It has the advantage that it isn't going to break your code in the future when it is modified. Private classes are private because the authors of Qt want to be able to change them while keeping the external public API the same.