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 #6199 from ynput/chore/use_better_resolution_fusion
Browse files Browse the repository at this point in the history
Fusion: Use better resolution of Ayon apps on 4k display
  • Loading branch information
iLLiCiTiT authored Feb 7, 2024
2 parents 71f09ed + 9452cdb commit 75dd13c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
4 changes: 3 additions & 1 deletion openpype/hosts/fusion/api/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
)
from openpype.pipeline import get_current_asset_name
from openpype.resources import get_openpype_icon_filepath
from openpype.tools.utils import get_qt_app

from .pipeline import FusionEventHandler
from .pulse import FusionPulse
Expand Down Expand Up @@ -174,7 +175,8 @@ def on_set_framerange_clicked(self):


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

app = get_qt_app()

pype_menu = OpenPypeMenu()

Expand Down
1 change: 1 addition & 0 deletions openpype/tools/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
set_style_property,
DynamicQThread,
qt_app_context,
get_qt_app,
get_openpype_qt_app,
get_asset_icon,
get_asset_icon_by_name,
Expand Down
23 changes: 19 additions & 4 deletions openpype/tools/utils/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,15 @@ def qt_app_context():
yield app


def get_openpype_qt_app():
"""Main Qt application initialized for OpenPype processed.
def get_qt_app():
"""Get Qt application.
This function should be used only inside OpenPype process and never inside
other processes.
The function initializes new Qt application if it is not already
initialized. It also sets some attributes to the application to
ensure that it will work properly on high DPI displays.
Returns:
QtWidgets.QApplication: Current Qt application.
"""

app = QtWidgets.QApplication.instance()
Expand All @@ -184,6 +188,17 @@ def get_openpype_qt_app():

app = QtWidgets.QApplication(sys.argv)

return app


def get_openpype_qt_app():
"""Main Qt application initialized for OpenPype processed.
This function should be used only inside OpenPype process and never inside
other processes.
"""

app = get_qt_app()
app.setWindowIcon(QtGui.QIcon(get_app_icon_path()))
return app

Expand Down

0 comments on commit 75dd13c

Please sign in to comment.