Aligning QTabBar from stylesheets
I am trying to align position of tabs in QTabBar to the left. Does any one has any idea?
I was able to do this when I was using QTabWidget using style-开发者_运维知识库sheet. Now, I have restriction that I cannot use QTabWidget. So have to do this in tab-bar.
Any help is highly appreciated.
From line 389 of my Qt 4.6.3 source:
Qt::Alignment tabAlignment = Qt::Alignment(q->style()->styleHint(QStyle::SH_TabBar_Alignment, 0, q));
This is the only place the alignment is set here and using QTabBar in the stylesheet does not work properly. I'd suggest then that it's only possible to do this by creating your own QStyle (this can be quite simple, just subclass an existing one) or by customising your local version of Qt.
Alternatively, if you have to use stylesheets, post a follow up question and link it here about the issues you've had with QTabWidget. They will probably be easier to fix.
精彩评论