PDA

View Full Version : TableWidget



matulik
15th April 2010, 23:00
Hello.
I have a litte question about QTableWidget:
I want to change header label text orientation to vertical.
Can you tell me how to do it?
I have tried different ways, I have asked a google, but I still dont know to solve this problem. ;-(

Lykurg
15th April 2010, 23:34
Create your own QTableWidgetItem by subclassing, swap the size hint and rotate the painter before drawing by calling the base class function. Set this item then as a header item.

matulik
16th April 2010, 18:32
I dont understand..
First: i create item:

QTableWidgetItem *item = new QTableWidgetItem;
Next: i set text:

item->setText("Dupa");

And what now?

Lykurg
16th April 2010, 20:51
Ups, sorry I was confused with graphics items. Please forget my last post. See http://qt-apps.org/content/show.php/HierarchicalHeaderView?content=103154 for ideas to solve your problem.

matulik
17th April 2010, 18:25
I still dont know how to do it..
I use QtCreator and:



ui->tableWidget->setColumnCount(8);
ui->tableWidget->setRowCount(8);


after


QStringList poz;
...
ui->tableWidget->setHorizontalHeaderLabels(poz);


What write between?

matulik
19th April 2010, 17:08
Anyone can help me? ;- (

genomega
2nd May 2010, 18:47
wrong response