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

General: Use qtpy in modules and hosts UIs which are running in OpenPype process #4225

Merged
merged 3 commits into from
Dec 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion openpype/hosts/aftereffects/api/launch_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
WebSocketAsync
)

from Qt import QtCore
from qtpy import QtCore

from openpype.lib import Logger
from openpype.pipeline import legacy_io
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/aftereffects/api/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import logging
from functools import partial

from Qt import QtWidgets
from qtpy import QtWidgets

from openpype.pipeline import install_host
from openpype.modules import ModulesManager
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/aftereffects/api/pipeline.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

from Qt import QtWidgets
from qtpy import QtWidgets

import pyblish.api

Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/blender/api/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from types import ModuleType
from typing import Dict, List, Optional, Union

from Qt import QtWidgets, QtCore
from qtpy import QtWidgets, QtCore

import bpy
import bpy.utils.previews
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/fusion/api/menu.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sys

from Qt import QtWidgets, QtCore, QtGui
from qtpy import QtWidgets, QtCore, QtGui

from openpype.tools.utils import host_tools
from openpype.style import load_stylesheet
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/fusion/api/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import logging

import pyblish.api
from Qt import QtCore
from qtpy import QtCore

from openpype.lib import (
Logger,
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/fusion/api/pulse.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import sys

from Qt import QtCore
from qtpy import QtCore


class PulseThread(QtCore.QThread):
Expand Down
8 changes: 4 additions & 4 deletions openpype/hosts/fusion/deploy/MenuScripts/install_pyside2.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@


try:
from Qt import QtWidgets # noqa: F401
from Qt import __binding__
print(f"Qt binding: {__binding__}")
mod = importlib.import_module(__binding__)
from qtpy import API_NAME

print(f"Qt binding: {API_NAME}")
mod = importlib.import_module(API_NAME)
print(f"Qt path: {mod.__file__}")
print("Qt library found, nothing to do..")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import glob
import logging

from Qt import QtWidgets, QtCore
from qtpy import QtWidgets, QtCore

import qtawesome as qta

Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/fusion/plugins/inventory/set_tool_color.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from Qt import QtGui, QtWidgets
from qtpy import QtGui, QtWidgets

from openpype.pipeline import InventoryAction
from openpype import style
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/fusion/scripts/set_rendermode.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from Qt import QtWidgets
from qtpy import QtWidgets
import qtawesome
from openpype.hosts.fusion.api import get_current_comp

Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/harmony/api/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import signal
import time
from uuid import uuid4
from Qt import QtWidgets, QtCore, QtGui
from qtpy import QtWidgets, QtCore, QtGui
import collections

from .server import Server
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/photoshop/api/launch_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
WebSocketAsync
)

from Qt import QtCore
from qtpy import QtCore

from openpype.lib import Logger
from openpype.pipeline import legacy_io
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/photoshop/api/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import contextlib
import traceback

from Qt import QtWidgets
from qtpy import QtWidgets

from openpype.lib import env_value_to_bool, Logger
from openpype.modules import ModulesManager
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/photoshop/api/pipeline.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
from Qt import QtWidgets
from qtpy import QtWidgets

import pyblish.api

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import re

from Qt import QtWidgets
from qtpy import QtWidgets
from openpype.pipeline import create
from openpype.hosts.photoshop import api as photoshop

Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/tvpaint/api/launch_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import platform
import logging

from Qt import QtWidgets, QtCore, QtGui
from qtpy import QtWidgets, QtCore, QtGui

from openpype import style
from openpype.pipeline import install_host
Expand Down
4 changes: 2 additions & 2 deletions openpype/hosts/tvpaint/plugins/create/create_render_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ def process(self):
)

def _ask_user_subset_override(self, instance):
from Qt import QtCore
from Qt.QtWidgets import QMessageBox
from qtpy import QtCore
from qtpy.QtWidgets import QMessageBox

title = "Subset \"{}\" already exist".format(instance["subset"])
text = (
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/unreal/api/tools_ui.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sys
from Qt import QtWidgets, QtCore, QtGui
from qtpy import QtWidgets, QtCore, QtGui

from openpype import (
resources,
Expand Down
4 changes: 2 additions & 2 deletions openpype/modules/avalon_apps/avalon_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def tray_menu(self, tray_menu):
if not self._library_loader_imported:
return

from Qt import QtWidgets
from qtpy import QtWidgets
# Actions
action_library_loader = QtWidgets.QAction(
"Loader", tray_menu
Expand All @@ -75,7 +75,7 @@ def tray_exit(self, *_a, **_kw):

def show_library_loader(self):
if self._library_loader_window is None:
from Qt import QtCore
from qtpy import QtCore
from openpype.tools.libraryloader import LibraryLoaderWindow
from openpype.pipeline import install_openpype_plugins

Expand Down
2 changes: 1 addition & 1 deletion openpype/modules/clockify/clockify_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def on_message_widget_close(self):
# Definition of Tray menu
def tray_menu(self, parent_menu):
# Menu for Tray App
from Qt import QtWidgets
from qtpy import QtWidgets
menu = QtWidgets.QMenu("Clockify", parent_menu)
menu.setProperty("submenu", "on")

Expand Down
2 changes: 1 addition & 1 deletion openpype/modules/clockify/widgets.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from Qt import QtCore, QtGui, QtWidgets
from qtpy import QtCore, QtGui, QtWidgets
from openpype import resources, style


Expand Down
2 changes: 1 addition & 1 deletion openpype/modules/example_addons/example_addon/widgets.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from Qt import QtWidgets
from qtpy import QtWidgets

from openpype.style import load_stylesheet

Expand Down
4 changes: 2 additions & 2 deletions openpype/modules/ftrack/tray/ftrack_tray.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import datetime
import threading

from Qt import QtCore, QtWidgets, QtGui

import ftrack_api
from qtpy import QtCore, QtWidgets, QtGui

from openpype import resources
from openpype.lib import Logger
from openpype_modules.ftrack import resolve_ftrack_url, FTRACK_MODULE_DIR
Expand Down
7 changes: 5 additions & 2 deletions openpype/modules/ftrack/tray/login_dialog.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import os

import requests
from qtpy import QtCore, QtGui, QtWidgets

from openpype import style
from openpype_modules.ftrack.lib import credentials
from . import login_tools
from openpype import resources
from Qt import QtCore, QtGui, QtWidgets

from . import login_tools


class CredentialsDialog(QtWidgets.QDialog):
Expand Down
10 changes: 5 additions & 5 deletions openpype/modules/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def on_action_trigger(self):
pass

def tray_menu(self, tray_menu):
from Qt import QtWidgets
from qtpy import QtWidgets

if self.admin_action:
menu = self.admin_submenu(tray_menu)
Expand All @@ -247,7 +247,7 @@ def tray_exit(self):
@staticmethod
def admin_submenu(tray_menu):
if ITrayAction._admin_submenu is None:
from Qt import QtWidgets
from qtpy import QtWidgets

admin_submenu = QtWidgets.QMenu("Admin", tray_menu)
admin_submenu.menuAction().setVisible(False)
Expand Down Expand Up @@ -279,7 +279,7 @@ def label(self):
@staticmethod
def services_submenu(tray_menu):
if ITrayService._services_submenu is None:
from Qt import QtWidgets
from qtpy import QtWidgets

services_submenu = QtWidgets.QMenu("Services", tray_menu)
services_submenu.menuAction().setVisible(False)
Expand All @@ -294,7 +294,7 @@ def add_service_action(action):

@staticmethod
def _load_service_icons():
from Qt import QtGui
from qtpy import QtGui

ITrayService._failed_icon = QtGui.QIcon(
resources.get_resource("icons", "circle_red.png")
Expand Down Expand Up @@ -325,7 +325,7 @@ def get_icon_failed():
return ITrayService._failed_icon

def tray_menu(self, tray_menu):
from Qt import QtWidgets
from qtpy import QtWidgets

action = QtWidgets.QAction(
self.label,
Expand Down
2 changes: 1 addition & 1 deletion openpype/modules/kitsu/kitsu_widgets.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from Qt import QtWidgets, QtCore, QtGui
from qtpy import QtWidgets, QtCore, QtGui

from openpype import style
from openpype.modules.kitsu.utils.credentials import (
Expand Down
2 changes: 1 addition & 1 deletion openpype/modules/log_viewer/log_view_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def tray_init(self):

# Definition of Tray menu
def tray_menu(self, tray_menu):
from Qt import QtWidgets
from qtpy import QtWidgets
# Menu for Tray App
menu = QtWidgets.QMenu('Logging', tray_menu)

Expand Down
2 changes: 1 addition & 1 deletion openpype/modules/log_viewer/tray/app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from Qt import QtWidgets, QtCore
from qtpy import QtWidgets, QtCore
from .widgets import LogsWidget, OutputWidget
from openpype import style

Expand Down
2 changes: 1 addition & 1 deletion openpype/modules/log_viewer/tray/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import collections
from Qt import QtCore, QtGui
from qtpy import QtCore, QtGui
from openpype.lib import Logger


Expand Down
2 changes: 1 addition & 1 deletion openpype/modules/log_viewer/tray/widgets.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import html
from Qt import QtCore, QtWidgets
from qtpy import QtCore, QtWidgets
import qtawesome
from .models import LogModel, LogsFilterProxy

Expand Down
2 changes: 1 addition & 1 deletion openpype/modules/muster/muster.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def tray_exit(self):
# Definition of Tray menu
def tray_menu(self, parent):
"""Add **change credentials** option to tray menu."""
from Qt import QtWidgets
from qtpy import QtWidgets

# Menu for Tray App
menu = QtWidgets.QMenu('Muster', parent)
Expand Down
3 changes: 1 addition & 2 deletions openpype/modules/muster/widget_login.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
from Qt import QtCore, QtGui, QtWidgets
from qtpy import QtCore, QtGui, QtWidgets
from openpype import resources, style


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from code import InteractiveInterpreter

import appdirs
from Qt import QtCore, QtWidgets, QtGui
from qtpy import QtCore, QtWidgets, QtGui

from openpype import resources
from openpype.style import load_stylesheet
Expand Down
2 changes: 1 addition & 1 deletion openpype/modules/shotgrid/tray/credential_dialog.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
from Qt import QtCore, QtWidgets, QtGui
from qtpy import QtCore, QtWidgets, QtGui

from openpype import style
from openpype import resources
Expand Down
2 changes: 1 addition & 1 deletion openpype/modules/shotgrid/tray/shotgrid_tray.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import webbrowser

from Qt import QtWidgets
from qtpy import QtWidgets

from openpype.modules.shotgrid.lib import credentials
from openpype.modules.shotgrid.tray.credential_dialog import (
Expand Down
2 changes: 1 addition & 1 deletion openpype/modules/sync_server/sync_server_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -1244,7 +1244,7 @@ def tray_menu(self, parent_menu):
if not self.enabled:
return

from Qt import QtWidgets
from qtpy import QtWidgets
"""Add menu or action to Tray(or parent)'s menu"""
action = QtWidgets.QAction(self.label, parent_menu)
action.triggered.connect(self.show_widget)
Expand Down
2 changes: 1 addition & 1 deletion openpype/modules/sync_server/tray/app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from Qt import QtWidgets, QtCore, QtGui
from qtpy import QtWidgets, QtCore, QtGui

from openpype.tools.settings import style

Expand Down
2 changes: 1 addition & 1 deletion openpype/modules/sync_server/tray/delegates.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
from Qt import QtCore, QtWidgets, QtGui
from qtpy import QtCore, QtWidgets, QtGui

from openpype.lib import Logger

Expand Down
Loading