Edit: forgot to add - I am using Qt 5.15 under Windows 10 MSYS2 MinGW
I have a QMainWindow subclass with
in its constructor. I want the widgets to be transparent by default, which works. But now I want to add a special widget, say the member "QWidget* m_opaque;", with a fixed non-transparent background color. However even withQt Code:
setAttribute(Qt::WA_TranslucentBackground);To copy to clipboard, switch view to plain text mode
- m_opaque->setAutofillBackground(true);
- m_opaque->setAttribute(Qt::WA_OpaquePaintEvent);
- m_opaque->setWindowOpacity(1.0);
- m_opaque->setStyleSheet("{ background-color: grey; }");
the widget still has transparent background .. how do I make it opaque?
Bookmarks