QT QWidget how to achieve border shadow, using many methods are not good, the background is always black

I now have a parent window that is QWidget, with a lot of QLabel controls in it. I want to achieve the edge shadow of QWidget.
looks for various methods such as paintEventgraphics, etc., either have no effect, or the entire parent window QWidget becomes transparent, or the parent window background darkens.

such as this

    QGraphicsDropShadowEffect *wndShadow = new QGraphicsDropShadowEffect;
    wndShadow->setBlurRadius(9.0);
    wndShadow->setColor(QColor(0, 0, 0, 160));
    wndShadow->setOffset(4.0);
    mainWidget->setGraphicsEffect(wndShadow);

I would like to achieve a QWidget parent window edge shadow effect
ask everyone, thank you!

May.11,2021
Menu