mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 21:32:15 +01:00
Use better resolution of Ayon apps on 4k display
Special get_qt_app is used instead of shared get_openpype_qt_app as we don't want to set application icon.
This commit is contained in:
parent
fc844f6a3c
commit
6290343ce7
1 changed files with 31 additions and 1 deletions
|
|
@ -173,8 +173,38 @@ class OpenPypeMenu(QtWidgets.QWidget):
|
|||
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
|
||||
|
||||
|
||||
def launch_openpype_menu():
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
|
||||
app = get_qt_app()
|
||||
|
||||
pype_menu = OpenPypeMenu()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue