Treemodel and Treeview
-
wrote on 11 Nov 2022, 05:39 last edited by
Hello, I have a treemodel created according to certain rules according to the data I received from the Db.
This treemodel is available in the photo.
However, this is not exactly the look I want. In TreeView, children open vertically, but I want them to open horizontally like this photo.
I was told that for this I need to create my own view using QAbstractItemView.
But I have no idea what exactly I should do from this base class. Can you give any examples, advice, etc.? -
Hi,
From this base class you need to implement the painting of the model data as well as the interactions with the mouse.
For custom painting you have an example linked in the details of the QAbstractItemView class.
-
wrote on 14 Nov 2022, 10:17 last edited by
The link you provided has documentation on Qabstractitemview, but I still don't see a coded example.
Can you give an explanatory example as I am unfamiliar with this subject? -
The link you provided has documentation on Qabstractitemview, but I still don't see a coded example.
Can you give an explanatory example as I am unfamiliar with this subject?@Nevez In the link provided by @SGaist there is a link to an example application: https://doc.qt.io/qt-6/qtwidgets-itemviews-chart-example.html
1/4