Hello everybody,

I have a problem how to merge a QTableView and QTreeView.

Originally, I have an SQL table of type:
Qt Code:
  1. -------------------------------------------------
  2. | Name | Surname | Profession | Age
  3. -------------------------------------------------
  4. | John | Smith | Engineer | 25
  5. | Mike | Parrot | Designer | 35
  6. | Alex | Funny | Engineer | 45
  7. | Alex | Fellow | Designer | 29
  8. | Alice | Young | Secretary | 20
  9. --------------------------------------------------
To copy to clipboard, switch view to plain text mode 
The simplest way to represent data is to use QSqlTableModel and get a single table.

My question is, if it is possible to merge QTableView and QTreeView and represent result as a tree of tables, based by one of the fields, e.g. by "Profession":
Qt Code:
  1. +---Engineer:
  2. | -------------------------------------------------
  3. | | John | Smith | engineer | 25
  4. | | Alex | Funny | engineer | 45
  5. | -------------------------------------------------
  6. |
  7. +---Designer:
  8. | -------------------------------------------------
  9. | | Mike | Parrot | designer | 35
  10. | | Alex | Fellow | designer | 29
  11. | -------------------------------------------------
  12. |
  13. +---Secretary:
  14. -------------------------------------------------
  15. | Alice | Young | Secretary | 20
  16. -------------------------------------------------
To copy to clipboard, switch view to plain text mode 

Thanks in advance for possible hints,
Xaleandr