Skip to content

Commit

Permalink
Merge pull request #397 from howetuft/hotfix
Browse files Browse the repository at this point in the history
ImageViewer: adapt to PySide6 (QPalette)
  • Loading branch information
howetuft committed May 5, 2024
2 parents 706081d + ba08ca0 commit e5d635c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Render/imageviewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,11 @@ def display_image(img_path):
subw.setVisible(True)

# Set subwindow background to opaque
bkg = Gui.getMainWindow().palette().color(QPalette.Background)
try:
bkg = Gui.getMainWindow().palette().color(QPalette.Background)
except AttributeError:
# Qt6
bkg = Gui.getMainWindow().palette().color(QPalette.ColorRole.Window)
style = (
"QMdiSubWindow {"
f"background-color:rgb({bkg.red()},{bkg.green()},{bkg.blue()});"
Expand Down

0 comments on commit e5d635c

Please sign in to comment.