顶层QWidget弹窗设置背景为透明,透明部分为黑色。

setAttribute(Qt::WA_TranslucentBackground);

设置此属性,解决。

原文地址:https://www.cnblogs.com/ohsolong/p/14214773.html