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 #3938 from pypeclub/bugfix/set_high_dpi_before_app…
Browse files Browse the repository at this point in the history
…_init

Tray: Change order of attribute changes
  • Loading branch information
iLLiCiTiT authored Oct 10, 2022
2 parents 1421b78 + fca96bc commit 1b6ea62
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions openpype/tools/tray/pype_tray.py
Original file line number Diff line number Diff line change
Expand Up @@ -775,12 +775,26 @@ def _create_splash(self):
def main():
log = Logger.get_logger(__name__)
app = QtWidgets.QApplication.instance()

high_dpi_scale_attr = None
if not app:
# 'AA_EnableHighDpiScaling' must be set before app instance creation
high_dpi_scale_attr = getattr(
QtCore.Qt, "AA_EnableHighDpiScaling", None
)
if high_dpi_scale_attr is not None:
QtWidgets.QApplication.setAttribute(high_dpi_scale_attr)

app = QtWidgets.QApplication([])

if high_dpi_scale_attr is None:
log.debug((
"Attribute 'AA_EnableHighDpiScaling' was not set."
" UI quality may be affected."
))

for attr_name in (
"AA_EnableHighDpiScaling",
"AA_UseHighDpiPixmaps"
"AA_UseHighDpiPixmaps",
):
attr = getattr(QtCore.Qt, attr_name, None)
if attr is None:
Expand Down

0 comments on commit 1b6ea62

Please sign in to comment.