Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2784 from BigRoy/workfiles_fix_save_prompt_parent
Browse files Browse the repository at this point in the history
Work Files: Fix parenting of save prompt QMessageBox
  • Loading branch information
iLLiCiTiT authored Feb 22, 2022
2 parents ad6ab79 + bb10520 commit 9386c47
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions openpype/tools/workfiles/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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
Expand Down

0 comments on commit 9386c47

Please sign in to comment.