diff --git a/openpype/tools/workfiles/app.py b/openpype/tools/workfiles/app.py index 4b5bf07b470..3a772a038c9 100644 --- a/openpype/tools/workfiles/app.py +++ b/openpype/tools/workfiles/app.py @@ -726,9 +726,9 @@ def open_file(self, filepath): self.file_opened.emit() def save_changes_prompt(self): - self._messagebox = messagebox = QtWidgets.QMessageBox() - - messagebox.setWindowFlags(QtCore.Qt.FramelessWindowHint) + self._messagebox = messagebox = QtWidgets.QMessageBox(parent=self) + messagebox.setWindowFlags(messagebox.windowFlags() | + QtCore.Qt.FramelessWindowHint) messagebox.setIcon(messagebox.Warning) messagebox.setWindowTitle("Unsaved Changes!") messagebox.setText( @@ -739,10 +739,6 @@ def save_changes_prompt(self): messagebox.Yes | messagebox.No | messagebox.Cancel ) - # Parenting the QMessageBox to the Widget seems to crash - # so we skip parenting and explicitly apply the stylesheet. - messagebox.setStyle(self.style()) - result = messagebox.exec_() if result == messagebox.Yes: return True