PySide2 Popup - darken outside of popup

Viewed 24

I have created a popup window to display a custom context menu:

class FileActionDialog(QDialog):

    def __init__(self, parent):
        super().__init__(parent)
        self.ui = Ui_ActionDialog()
        self.ui.setupUi(self)
        self.setWindowFlags(Qt.FramelessWindowHint | Qt.Popup)
        self.setAttribute(Qt.WA_TranslucentBackground)

This is the design requirement: Design requirement

Here is a rendered result: Rendered result

The problem is that the outside of this popup doesn't become dark enough... How can I darken outside?

0 Answers
Related