I would like to set my QMainWindow class semi-transparent background using QMainWindow::setStyleSheet method. I do something like:
QMainWindow window;
window.setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
window.setStyleSheet("background-color: rgba(255, 0, 0, 128)");
window.setAttribute(Qt::WA_TranslucentBackground, true);
window.setFixedSize(800, 600);
window.show();
and I got fully transparent Window, which is pretty much nothing I can see. and if I do it without
window.setAttribute(Qt::WA_TranslucentBackground, true);
I got fully red Window.
I found out, inheriting 'QMainWindow', overloading 'paintEvent()' and use 'QPainter->fillRect()' with QColor with alpha do what I want, but it's not using stylesheet.
Anyone can help doing this using 'setStyleSheet()' method? I've already found lots of posts and answers, but nothing helped me.
Best regards.