1 Attachment(s)
Custom QHeaderView in Qt 4.1.1
Hi guys!
I'm using Qt 4.1.1 and have come across an unsolvable (at least to me) problem:
Normally text in sections of horizontal header view are drawn horizontally.
The question is - how to make that text drawn vertically, i.e. rotated by 90 degree? (see the attachment picture)
I've tried this:
Code:
{
....
public:
void paint(...){
doMyCustomPaint();
}
};
...
// usage
tableView->setModel(myModel);
myCustomDelegate = new MyCustomDelegate(this);
tableView->getHorizontalHeader()->setItemDelegate(myCustomDelegate);
But code above does not help. Have any idea?
Re: Custom QHeaderView in Qt 4.1.1
QHeaderView is not a full-featured model-view class and doesn't unfortunately use item delegates for anything at all. Check this thread.
Re: Custom QHeaderView in Qt 4.1.1
I've got a similiar problem, I'd like to rotate some QPushButtons and place them vertically, similiar to Amarok or Kate sidebars on KDE.
I have looked at the Amarok source code 'multitabbar.cpp' and it subclasses the QPushbuttons and on a paint event it rotates them 90 degrees.
I wonder if this is the right way to go.