transparent widgets inside transparent frame pyqt5
<p>I have a problem solving an issue for my program. When I create a transparent Widget that holds some other widgets, they become transparent too and I don't understand why.</p>

<pre><code>from PyQt5 import QtWidgets
from PyQt5.QtCore import Qt

class MainFrame(QtWidgets.QWidget):

    def __init__(self, parent=None):
        super(MainFrame, self).__init__(parent)

        self.setWindowFlags(Qt.FramelessWindowHint)
        self.setFixedSize(860, 560)

        # Set the opacity
        self.setWindowOpacity(1 - 50 / 100)

        layout = QtWidgets.QHBoxLayout(self)

        layout.addWidget(QtWidgets.QPushButton("TEST"))
</code></pre>

<p>In this sample code, the widget QPushButton will appear transparent, it's the same with labels, and other widgets. How do I apply transparency ONLY to my class MainFrame.</p>

<p>Edit : </p>

<p>here is what I have (transparent button and transparent QWidget) :
<a href="https://i.stack.imgur.com/Z2eTa.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Z2eTa.jpg" alt="enter image description here"></a>
here is what I need (NO transparent button and transparent QWidget) :
<a href="https://i.stack.imgur.com/UjEgs.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UjEgs.jpg" alt="enter image description here"></a>
Thank you very much.</p>