hi,
i have added a QProxyStyle to get horizontal text in vertical QTreeHeader.In windows XP this header shows unnecessary checkbox in header.i have attached a image of this.Any one had this kind of problem?

This is because of the QProxyStyle that i applied.
Is there a better way to get my vertical header text written as horizontal.


this is the styled i used.

Qt Code:
  1. class MyHorizontalHeader: public QProxyStyle
  2. {
  3. public:
  4. MyHorizontalHeader(QStyle *style) : QProxyStyle(style) {}
  5.  
  6. void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter,const QWidget *widget = 0) const
  7. {
  8. if (element == QStyle::CE_HeaderLabel)
  9. {
  10. const QHeaderView *hv = qobject_cast<const QHeaderView *>(widget);
  11. if (!hv || hv->orientation() != Qt::Horizontal)
  12. {
  13. return QProxyStyle::drawControl(element, option, painter, widget);
  14. }
  15. const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(option);
  16. painter->save();
  17. painter->translate(header->rect.bottomLeft());
  18. painter->rotate(270);
  19. painter->drawText(0,10,header->text);
  20. painter->restore();
  21. return;
  22. }
  23. return QProxyStyle::drawControl(element, option, painter, widget);
  24. }
  25. };
To copy to clipboard, switch view to plain text mode 

img.png

this is the vertical header of my tree view.. in the 1st column i don't have any text,from the 2nd column onwards i have text.

Thanks