Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to change background color for qtabbar empty space pyqt

I need to change background color for the empty space of the QTabbar like in image below, I can already use style sheet to change tabbar but it change tabs only not the empty space next to tabs (red bordered area)

I am using PyQt enter image description here

like image 862
Mohamed Yousof Avatar asked Oct 22 '25 01:10

Mohamed Yousof


1 Answers

As far as I know you can make it either via:

tabWidget->setStyleSheet("QTabBar { background-color: red; }"); tabWidget->setDocumentMode(true);

But it doesn't look good.

Or via:

tabWidget->setAutoFillBackground(true); QPalette pal = tabWidget->palette(); pal.setColor(QPalette::Window, Qt::red); tabWidget->setPalette(pal);

Or just create QWidget with some background and insert QTabWidget on top of it.

like image 146
RazrFalcon Avatar answered Oct 24 '25 11:10

RazrFalcon