result that returned by my QsSlquery is :
teamId studentId lectureId
--------- ----------- ----------
team1 student1 lecture1
team1 student1 lecture3
team1 student2 lecture1
team2 student1 lecture3
team2 student1 lecture4
teamId studentId lectureId
--------- ----------- ----------
team1 student1 lecture1
team1 student1 lecture3
team1 student2 lecture1
team2 student1 lecture3
team2 student1 lecture4
To copy to clipboard, switch view to plain text mode
i assign my QSqlQuery to QSqlQueryModel using setQuery,
and then assign QSqlQueryModel to QTreeView using setModel.
As a result tree view displays my table without hiyerarchical structure just like the table above.
But I am trying to get a display like this:
-team1
-student1
-lecture1
-lecture3
-student2
-lecture1
-team2
-student1
-lecture3
-lecture4
-team1
-student1
-lecture1
-lecture3
-student2
-lecture1
-team2
-student1
-lecture3
-lecture4
To copy to clipboard, switch view to plain text mode
As i learned i have to use QAbstractProxyModel; but i do not know how to do it.
Bookmarks