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

Fusion: Use better resolution of Ayon apps on 4k display #6199

Merged
merged 2 commits into from
Feb 7, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion openpype/hosts/fusion/api/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,38 @@ def on_set_framerange_clicked(self):
set_asset_framerange()


def get_qt_app():
"""Main Qt application."""

app = QtWidgets.QApplication.instance()
if app is None:
for attr_name in (
"AA_EnableHighDpiScaling",
"AA_UseHighDpiPixmaps",
):
attr = getattr(QtCore.Qt, attr_name, None)
if attr is not None:
QtWidgets.QApplication.setAttribute(attr)

policy = os.getenv("QT_SCALE_FACTOR_ROUNDING_POLICY")
if (
hasattr(
QtWidgets.QApplication, "setHighDpiScaleFactorRoundingPolicy"
)
and not policy
):
QtWidgets.QApplication.setHighDpiScaleFactorRoundingPolicy(
QtCore.Qt.HighDpiScaleFactorRoundingPolicy.PassThrough
)

app = QtWidgets.QApplication(sys.argv)

return app

iLLiCiTiT marked this conversation as resolved.
Show resolved Hide resolved

def launch_openpype_menu():
app = QtWidgets.QApplication(sys.argv)

app = get_qt_app()

pype_menu = OpenPypeMenu()

Expand Down
Loading