View Full Version : problems about QTabBar

10th October 2006, 09:47

I have a problem about QTabBar. please help me.

I want to subclass QTabBar and implement a tabbar like



10th October 2006, 10:11
Could you be more specific? Did you notice QTabBar::setShape(QTabBar::Triangular..)?

10th October 2006, 10:30
thanks for your reply.

I've noticed the shape provided by QTabBar. and i just want to design the shape of the tab nonrectangle, like the above image.

10th October 2006, 10:36
I would probably go with implementing a custom style (http://doc.trolltech.com/3.3/customstyles.html). It's possible to change the appearance by overriding QTabBar::paintEvent(), but if you draw the tabs with different geometries than the normal implementation assumes, most functionality with the tab bar will most probably be broken.

10th October 2006, 11:05

i found it really difficult to set the tabs different geometry. i give it up.

i have another question.

sometimes i just want to rearrange the layout the widgets, but QT mostly designs the layout funtion private or uses d-pointer in it. so it is impossible to subclass the widgets to override the layout funtions.

for example,I tried to modify QSpinBox to place the buttons on the left and right of the text area instead of on the right above one another.
The layout function is private. so i had to copy the entire class into my project and revise it instead of simply subclassing it.