mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
set 'AA_EnableHighDpiScaling' attribute before application init
This commit is contained in:
parent
b7bd66eedc
commit
fca96bcb7b
1 changed files with 16 additions and 2 deletions
|
|
@ -775,12 +775,26 @@ class PypeTrayStarter(QtCore.QObject):
|
|||
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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue