title: Qt custom widget background transparent but I want that we can use objects that behind of the widget
body: <p>I created a <strong>CustomWidget</strong> class:<br>
  <em>CustomWidget.h</em>:</p>
  
  <pre><code>#include &lt;QWidget&gt;
  #include &lt;QPainter&gt;
  
  class CustomWidget : public QWidget
  {
    Q_OBJECT
  public:
    explicit CustomWidget(QWidget *parent = nullptr);
  
    void paintEvent(QPaintEvent* event);
  
  signals:
  
  public slots:
  };
  </code></pre>
  
  <p><em>CustomWidget.cpp</em>:</p>
  
  <pre><code>#include "customwidget.h"
  
  CustomWidget::CustomWidget(QWidget *parent) : QWidget(parent)
  {
    this-&gt;setWindowFlag(Qt::FramelessWindowHint);
  }
  
  void CustomWidget::paintEvent(QPaintEvent* event)
  {
    if (this-&gt;isActiveWindow())
    {
      QPainter painter(this);
      painter.setPen(Qt::green);
      painter.setBrush(QBrush(QColor(69, 232, 32, 100)));
      painter.drawRect(rect());
    }
  }
  </code></pre>
  
  <p>When I compile and run this codes on Linux (KDE Neon), I see correct widget with color (color is green = 69, 232, 32) but opacity (alpha = 100) is not working. Here is picture:<br>
  <a href="https://i.stack.imgur.com/ykRN5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ykRN5.png" alt="This is not correct widget background."></a>
  <br>How can I create transparent or opacity widgets? Is this a bug?<br>
  Also, I can see transparent widgets if I can create opacity / transparent widget but can't use background (I mean I can't intervene objects that behind of the widget. You know that screencast applications records all screen and we can use screen). Can I create widgets like this?
  Thanks.</p>