[Qt-interest] drow text vertical in using CE_TabBarTabLabel
arjun
me_arjun2008 at rediffmail.com
Thu Aug 20 20:05:33 CEST 2009
Hi
I appling style sheet to tabwidget. I have applied stylesheet to tab frame and tabwidget tab, my tab position is QTabWidget::West. I want to draw text on tab with vertical orientation.
how can i achive it.
I am using following code.
case CE_TabBarTab:
if (const QStyleOptionTab *tabBarTab = qstyleoption_cast(option))
{
QRect r = tabBarTab->rect;
QSize size1= r.size();
QSize tabSize = sizeFromContents(CT_TabBarTab,option,size1,widget);
painter->save();
QPen pen = QPen(Qt::white);
painter->setPen(pen);
QPointF points[4] = {
QPointF(r.topRight().x(), r.topRight().y()),
QPointF(r.topLeft().x(), r.topLeft().y()+4),
QPointF(r.bottomLeft().x(), r.bottomLeft().y()-4),
QPointF(r.bottomRight().x(), r.bottomRight().y()),
};
painter->drawPolygon(points,4);
painter->drawText(r, tabBarTab->text); //text drowing
painter->restore();
}
break;
how can i use CE_TabBarTabLabel for drawing text
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090820/d8a2df71/attachment.html
More information about the Qt-interest-old
mailing list