Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.15.3
-
None
Description
The same code shows transparent background on Lubuntu Gnome desktop, but no transparency on Lubuntu LXQT desktop.
some discussions are here: Qt 6.6.2 has the same issue.
https://forum.qt.io/topic/93408/transparent-widget/12?_=1713971048174
int main(int argc, char *argv[]) { QApplication a(argc, argv); QWidget* tab_content = new QWidget(); tab_content->setAttribute(Qt::WA_OpaquePaintEvent); //makes the widget transparent QTabWidget* tw = new QTabWidget(); tw->addTab(tab_content, "Example"); tw->setStyleSheet("QTabBar::tab { background: transparent; }"); //makes the header transparent QWidget w; w.setAttribute(Qt::WA_TranslucentBackground); //makes the window transparent w.setLayout(new QVBoxLayout()); w.layout()->addWidget(tw); w.show(); return a.exec(); }