Change Tab Size In QTabWidget
Asked Answered
A

1

6

I recently learned about QTabWidget and tried using it in python. My question is, can I change the height, width and background of each individual tab?

I tried doing

self.Tab1.setStyleSheet("background: white")

but that did nothing.

Thanks in advance.

Appleby answered 4/4, 2017 at 21:32 Comment(0)
F
8

You must use:

{your QTabWidget}.setStyleSheet("QTabBar::tab { height: 100px; width: 100px; background: 'red'}")
Felony answered 5/4, 2017 at 2:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.