Swapping headers in QSqlQueryModel (transpose table)
问题 I am having a problem to properly transpose the table I recieve from db. I followed the path found here , and ended up in subclassing a QAbstractProxyModel - like described here . unfortunatelly, it doesn't fully work, here's where the problem is: What I have: X | A | B ---------- 1 | A1 | B1 2 | A2 | B2 What I want: X | 1 | 2 ---------- A | A1 | A2 B | B1 | B2 What I get: X | 1 | 1 ---------- A | A1 | A2 A | B1 | B2 So as you can see, the data is correctly transposed, but the headers get bad