PDA

View Full Version : Verticalheader



iguanna
9th April 2008, 20:54
hi all, i have a verticalHeader of my QtableView, i'd like insert a data inside it but i can't i tried it through headerView->setHeaderData but it doesn't insert, it's something weird because if i try it on my horizontalHeader it works fine, i don't know how make. :(

jpn
9th April 2008, 21:21
May we see some code? First of all, QAbstractItemModel::setHeaderData() is not a method of QHeaderView. :) Secondly, which model are you using?

iguanna
10th April 2008, 11:37
sorry jpn, i was in a hurry and i can't explain better.
at the moment i am doing this:
MyHeaderView->model()->setHeaderData (index, Qt::Vertical,index);
MyHeaderView->headerDataChanged (Qt::Vertical, index, index);
where 'index' is the section clicked on MyHeaderView (Vertical always ok)
and it has any effect, i mean that these lines don't insert any value inside MyHeaderView.

My model is a QSqlQueryModel subclassed, i just reimplemented the flags method. the Doc says that setHeaderData of QSqlQueryModel can insert datas inside horizontal header only. Maybe this is the cause of my problem, but i am not sure, acuatlly that i need is the next:

1. you can see my vertical header here: http://imagebin.ca/view/bW6L1uCU.html
i need order my vertical header in a ascending order , simply that is i need.

jpn
10th April 2008, 11:55
It's the actual model which provides data for headers. Don't use "MyHeaderView->model()->setHeaderData(...)" but something like "sqlModel->setHeaderData(...)".