PDA

View Full Version : setHeaderData



wirasto
14th November 2009, 20:00
How to set vertical header data for QSqlQueryModel ? If horizontal is fine

model->setHeaderData(1, Qt::Horizontal, "Jam 11.30");
model->setHeaderData(1, Qt::Vertical, "Jam 11.30");

ChrisW67
14th November 2009, 22:07
These are the labels used by the QHeaderView when it is oriented vertically, i.e. labelling rows. This should work as-is.

If you wanted vertical text rendered in the cells of your horizontalHeader() then I think you need to subclass QHeaderview to provide a method to set the text orientation, some new size hinting, and a new paint routine. You could look at the code of Hierarchical Header View (http://www.qt-apps.org/content/show.php/HierarchicalHeaderView?content=103154) for clues as to how this might be done.