Unsolved Customizing Qt Tab Widget
-
Hello everyone. I am new to Qt and currently playing with Qt Tab widget. I was just wondering if could customize tabs so that the background color of the tab name(where we click to switch tabs) is different from the background color of the rest of the tab(inner space of the tab). Currently when i set some background color in the style sheet of the tab, it assigns the same color to the whole tab widget. I want the tab like a toolbar where the background of the toolbar(usually white) can be different from the rest of the window. How can I do that?
Any help would be really appreciated. -
-
Exactly! how did you do that?
-
@Farhan
I just usedsetStyleSheet
on QTabWidget . -
what properties did you set in style sheet? can you show the style sheet?
-
ui->tabWidget->setStyleSheet("background-color: red");
-
-
@Farhan
So you want the preview window to display same as the StyleSheet window? -
yes I want to get my final window like this
-
@Farhan
Now how is your final window? so you already have? or what is the problem now? -
I am getting my final window like this . Here you can see the white color that apeared around the tab icons(blue colored icons) in designer_mode is gone. This is my problem. I want white color around my blue icons.
-
-
Oh God! i thought preview would be same as the application. Application is showing the desired result. Problem solved. Thank you very much.
-
Just one more thing. Is it possible to create something like this using tab widget?
-
-
@Ratzz I mean the dark gray color.
-
@Farhan
I think you can set using http://doc.qt.io/qt-4.8/qtabwidget.html#tabBar -
@Ratzz Thank you that was really helpful.