[Interest] Model-view solution

Lars Sunde laasunde at hotmail.com
Sun Jun 6 20:54:15 CEST 2021


Hello folks,

We are looking for some feedback on using Qt5 model view framework.

Our model contains two building blocks (item and list) that has the same metadata attributes (id, title, type, author, publish year, revision, data etc). List is basically just references to items.

A conceptual example of our model:
Item A (rev 1)
Item B
Item C
Item A (rev 3)
List 1 (contains reference to Item A[rev 2], Item B, Item E)
Item D
Item A (rev 2)
Item E
List 2 (contains reference to Item D, Item E)

Our primary concern is whether to use a list or tree model to represent the data.

Using a list model appear easier to implement but does this model introduce limitation or increased complexities in view logic?

The following views is needed:
# In list view
   - show all items
   - show all items with metadata attribute type equal "foo"
   - show all items with metadata attribute type equal "foo" and only latest revision
# In tree view
   - show all items structured by revision. This means Item A (rev 3) will be on level 1, with a child node on level 2(Item A rev 2) and with a child node on level 3 (Item A rev 1).
   - show all items structured by categories. This means adding a node "foo" (this is not an item or list, but will be shown in UI) and adding all items with metadata attribute type equal "foo" as children. Same for "bar" and others.
   - show all lists with content of list a children.

It is difficult to estimate data load but anywhere between 100 and 100'000 items.

Qt5 has a concept of Proxy Model - would it be possible to implement a list model and then use proxy model to "transforms" the data into a tree structure? How memory and CPU demanding would such a solution be for the system?

Appreciate any input.

kind regards, Lars

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20210606/9b63532f/attachment.html>


More information about the Interest mailing list