1 Attachment(s)
QT QTabBar. Move close button to right corner QTabBar West possition. Paint event
Hello Professionals! I have an issue with close button position while using QTabBar.
Let's look at picture. I would like to move close button to right corner. I try to play with stylesheet, but had fiasko.
Attachment 7110
Code:
Code:
{
public:
{
}
protected:
QSize tabSizeHint
(int) const {
}
for (int index = 0; index < count(); index++)
{
QStyleOptionTabV3 tab;
initStyleOption(&tab, index);
QIcon tempIcon
= tabIcon
(index
);
QString tempText
= this
->tabText
(index
);
QRect tabrect
= tabRect
(index
);
p.
drawControl(QStyle::CE_TabBarTab, tab
);
tabrect.adjust(0, 3, 0, -3);
p.setPen(Qt::black);
p.
setFont(QFont("Arial",
7));
tempIcon.paint(&p, tabrect, Qt::AlignTop);
p.drawText(tabrect, Qt::AlignBottom | Qt::AlignHCenter, tempText );
}
}
};
.....
WidgetListTabWidget::WidgetListTabWidget(WidgetList* parent)
{
//........
this->setTabBar(new TestTabBar());
//.........
}