Well, long time ago somebody told me, inventing wheels from scratch was
useless spent time. So, I'm always trying to invent something new; and
here we go again: Let me proudly introduce "flat trees" to the world...
:-)
This is a QAbstractItemModel that takes a list of strings and separates
each of them by a char. Segments are taken as nodes in a tree. Just like
a filesystem does. Items are than flatly stored inside a list
(internally keeping a tree, of course). The non-leaves are declared
"headers" and not selectable; the leaves are selectable.
The delegate draws this structure as a edge-less tree, forming a flat
looking hierarchy. A CombBox is provided that will set up a QListView as
drop down view.
Well, long time ago somebody told me, inventing wheels from scratch was useless spent time. So, I'm always trying to invent something new; and here we go again: Let me proudly introduce "flat trees" to the world... :-)
This is a QAbstractItemModel that takes a list of strings and separates each of them by a char. Segments are taken as nodes in a tree. Just like a filesystem does. Items are than flatly stored inside a list (internally keeping a tree, of course). The non-leaves are declared "headers" and not selectable; the leaves are selectable.
The delegate draws this structure as a edge-less tree, forming a flat looking hierarchy. A CombBox is provided that will set up a QListView as drop down view.