QTabWidget setStyleSheet of background-color; QT5.12 Linux
Solved
General and Desktop
-
void LogWidget::initStyle() { QString styleString = "QTabWidget {" " background-color: #302c3a4a;" " color: #ffffff;" "};" "QTabWidget QPlainTextEdit {" " background-color: transparent;" " color: #ffffff;" "}"; setStyleSheet(styleString); } LogWidget::LogWidget(QWidget *parent) : QWidget(parent), ui(new Ui::LogWidget) { ui->setupUi(this); initStyle(); }
I am facing issues with the tab switching being stuck. I find the background color of QTabWidget will change from default black to #302c3a4a if I call this function when switch tabs. How to set the background color of the QTabWidget always be #302c3a4a ?
-
Here is an example of how to style
QTabWidget
I think the background changes when you switch the tabs because you show a widget with doesnt have your background color.
-