Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Transparent of QWidget



  • Hi,
    My problem is extended problem of one user. His problem:
    https://stackoverflow.com/questions/51644685/display-widget-on-top-of-qvideowidget-with-qmediaplayer

    So this user want a QPushButton on the top of QVideoWidget. And the solution was:
    Create QWidget with QVBoxLayout on it. Add QVideoWidget to this layout and set QPushButton parent's to QVideoWidget. Perfect. It works!

    And now my problem: I would like to set this label's opacity ( or QPushButton's opacity ) to for example 0.1. One solution is like:

    label->setStyleSheet("QLabel {background-color:rgba(255, 0, 0, 25);}");
    

    And this works, but I would like something other. Now I see gray square ( I see QWidget where is layout ). I would like to see video from QVideoWidget.

    In other words: now I see my parent background. I would like to see my brother background.


Log in to reply