QTabWidget background not transparent
-
Does anyone know why qTab is not transparent?
I have a control on the back, but still covered by QTab. Right side is a button stackedWidget(didn't set stylesheet for StackedWidget) .ui->tabWidget->setAttribute(Qt::WA_TranslucentBackground); ui->tabWidget->setStyleSheet("background-color: transparent"); ui->tab->setAttribute(Qt::WA_TranslucentBackground); ui->tab->setStyleSheet("background-color: transparent"); ui->tab_2->setAttribute(Qt::WA_TranslucentBackground); ui->tab_2->setStyleSheet("background-color: transparent");
Thanks
-
Try using:
QWidget::setAttribute(Qt::WA_TranslucentBackground);
-
@T3STY
Still looks the same.ui->tabWidget->setAttribute(Qt::WA_TranslucentBackground);
ui->tabWidget->setStyleSheet("QTabWidget{ background-color: transparent}"); -
the ui->tabWidget widget is the main tabs container, right? It might be that you need to set translucent background and transparent background color on all the child widgets of it. Or viceversa.
-
I have updated the question, with latest image, seems set all child tabs doesn't work either.
-
While looking for similar problems on google I found this:
http://www.qtforum.org/post/96233/qtabwidget-background-color-problem.html#post96233I can see from your screenshot that you're not on Windows, but maybe the trick still does the job. Other than that, I found other issues with background transparency related to Qt 4, but nothing else.
-
Yes, T3STY, If I deploy it to embedded linux, it could show transparent background.