I have a QTabWidget with tabs which are created and removed dynamically depending upon what option user selects. Now, first thing i need to do is to achieve a look for the tabs as per the attached screenshot (tabs.jpg). So, as per the screenshot, the selected tab is blue and the other tabs are black. Also, the non-selected tabs have a different arrow-like shape.
Here's how i think i can do it:
1) Use stylesheet to set the background of the tabs. I am not sure if this will work properly and upto the desired level of look and feel. Also, in this case, the actual tabs will still be rectangular so it would be a problem.
2) Subclass the QTabBar and draw the tabs myself in paint() method. For this i think i can do either of the following in paint() method:
a) Set the background image for selected and de-selected tabs and use setMask to mask the widget i.e. tabs based on the image shape. So, this way i should get the non-rectangular shape for non-selected tabs.
b) Draw the non-rectangular shape myself and set the background image or color.
Please let me know your thoughts on this. Which approach is feasible or is any any other solution?
Bookmarks