Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make tabs in Qt look like tabs in Google Chrome?

I don't want my tabs to have a Drag and Drop feature like Chrome (as covered by this question: Apply chrome like tabs in Qt) - I just want them to look like Chrome tabs.

I'm currently using QTabWidget, but its built-in shape QTabWidget::Triangular is so ugly. What do I need to use? Stylesheet or image or something else?

like image 819
JayXon Avatar asked Jan 15 '23 19:01

JayXon


2 Answers

You can use border-image property of the QTabBar::tab. Just read the documentation as to how you could style border-image. There is a nice explanation in the documentation.

I have done something like this using above method.

enter image description here

You could do the same. To change the close button you could style QTabBar::close-button. The final answer is you can achieve what you required, just using Qt stylesheets.

like image 85
warunanc Avatar answered Jan 29 '23 00:01

warunanc


I'm not really sure how you can make it look exactly like Chrome, but you can try using border-top-left-radius, border-top-right-radius, border-bottom-right-radius, and border-bottom-left-radius in Stylesheets

Reference

like image 38
drivfe Avatar answered Jan 29 '23 02:01

drivfe