@hieuht said in Tree View with varying column counts:
First, the child's count cannot more than the parent's count.
Hmm, I did not see that mentioned. Indeed https://doc.qt.io/qt-6/qabstractitemmodel.html#columnCount says:
In most subclasses, the number of columns is independent of the parent.
Maybe it's a limitation on QTreeView rather than on the model?
Second, the child's column size depend on the parent's size like the following picture.
It looks like the child is only really using the parent's existing columns, just (according to you) it can only use the same number or fewer. Understandable, but not what your picture shows.
Could you provide an example of using delegate to handle this?
Quite beyond me! This is not just a simple delegate, it's virtually the drawing of a complete new table.
@SGaist sometimes picks out something which KDE has added in https://api.kde.org/frameworks/index.html. You might look through that, maybe there is something there for you?