PDA

View Full Version : Change QTableView orientation



r2d2u2
31st May 2010, 07:59
All greetings!

I have a model of data QAbstractTableModel I connect it to QTableView and all perfectly works. Whether it is possible as that at class QTableView to change property that it showed table heading at the left on a vertical and lines across? That without change of model of the data it was possible to display the table not from top to down and on the right-on the left?
Thanks.

aamer4yu
31st May 2010, 10:10
If I guess right, you want to transform the rows to columns and columns to rows ?
If yes, you can use a proxy model and in data function u can do -
return baseModel::data(QModelIndex(col,row));

hope you get what I mean :)

r2d2u2
31st May 2010, 10:30
Yes, you have correctly understood!

Then in proxy model in headerData function it is necessary to transform the rows to columns and columns to rows too.

Thanks!:)


4706