我看了网上资料,有说通过继承QProxyStyle来设置竖直状态下的text,但是怎么设置Icon呢?
我尝试了继承QProxyStyle后重写drawItemPixmap方法,如下:
void myTabStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,const QPixmap &pixmap) const
{
painter->save();
painter->rotate(90);
QRect r = QRect(0,0,rect.width(),rect.height());
QProxyStyle::drawItemPixmap(painter,r,Qt::AlignRight,QPixmap());
painter->restore();
}
但是没有变化,请各位大神来指教以下。