1 Attachment(s)
QTableWidget Header showing unnecessary checkbox when used with QProxyStyle
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.
Code:
class MyHorizontalHeader: public QProxyStyle
{
public:
MyHorizontalHeader
(QStyle *style
) : QProxyStyle
(style
) {}
{
if (element
== QStyle::CE_HeaderLabel) {
if (!hv || hv->orientation() != Qt::Horizontal)
{
return QProxyStyle::drawControl(element, option, painter, widget);
}
painter->save();
painter->translate(header->rect.bottomLeft());
painter->rotate(270);
painter->drawText(0,10,header->text);
painter->restore();
return;
}
return QProxyStyle::drawControl(element, option, painter, widget);
}
};
Attachment 7257
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