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 #4237 from pypeclub/feature/OP-4654_qtpy-in-igniter
Browse files Browse the repository at this point in the history
Igniter: Use qtpy modules instead of Qt
  • Loading branch information
iLLiCiTiT authored Dec 16, 2022
2 parents d3753fe + 07e14f9 commit f803d4a
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions igniter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def open_dialog():
if os.getenv("OPENPYPE_HEADLESS_MODE"):
print("!!! Can't open dialog in headless mode. Exiting.")
sys.exit(1)
from Qt import QtWidgets, QtCore
from qtpy import QtWidgets, QtCore
from .install_dialog import InstallDialog

scale_attr = getattr(QtCore.Qt, "AA_EnableHighDpiScaling", None)
Expand All @@ -47,7 +47,7 @@ def open_update_window(openpype_version):
if os.getenv("OPENPYPE_HEADLESS_MODE"):
print("!!! Can't open dialog in headless mode. Exiting.")
sys.exit(1)
from Qt import QtWidgets, QtCore
from qtpy import QtWidgets, QtCore
from .update_window import UpdateWindow

scale_attr = getattr(QtCore.Qt, "AA_EnableHighDpiScaling", None)
Expand All @@ -71,7 +71,7 @@ def show_message_dialog(title, message):
if os.getenv("OPENPYPE_HEADLESS_MODE"):
print("!!! Can't open dialog in headless mode. Exiting.")
sys.exit(1)
from Qt import QtWidgets, QtCore
from qtpy import QtWidgets, QtCore
from .message_dialog import MessageDialog

scale_attr = getattr(QtCore.Qt, "AA_EnableHighDpiScaling", None)
Expand Down
3 changes: 1 addition & 2 deletions igniter/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"""Open install dialog."""

import sys
from Qt import QtWidgets # noqa
from Qt.QtCore import Signal # noqa
from qtpy import QtWidgets

from .install_dialog import InstallDialog

Expand Down
4 changes: 1 addition & 3 deletions igniter/install_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
import re
import collections

from Qt import QtCore, QtGui, QtWidgets # noqa
from Qt.QtGui import QValidator # noqa
from Qt.QtCore import QTimer # noqa
from qtpy import QtCore, QtGui, QtWidgets

from .install_thread import InstallThread
from .tools import (
Expand Down
10 changes: 5 additions & 5 deletions igniter/install_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import sys
from pathlib import Path

from Qt.QtCore import QThread, Signal, QObject # noqa
from qtpy import QtCore

from .bootstrap_repos import (
BootstrapRepos,
Expand All @@ -17,7 +17,7 @@
from .tools import validate_mongo_connection


class InstallThread(QThread):
class InstallThread(QtCore.QThread):
"""Install Worker thread.
This class takes care of finding OpenPype version on user entered path
Expand All @@ -28,14 +28,14 @@ class InstallThread(QThread):
user data dir.
"""
progress = Signal(int)
message = Signal((str, bool))
progress = QtCore.Signal(int)
message = QtCore.Signal((str, bool))

def __init__(self, parent=None,):
self._mongo = None
self._result = None

QThread.__init__(self, parent)
super().__init__(parent)

def result(self):
"""Result of finished installation."""
Expand Down
2 changes: 1 addition & 1 deletion igniter/message_dialog.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from Qt import QtWidgets, QtGui
from qtpy import QtWidgets, QtGui

from .tools import (
load_stylesheet,
Expand Down
2 changes: 1 addition & 1 deletion igniter/nice_progress_bar.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from Qt import QtCore, QtGui, QtWidgets # noqa
from qtpy import QtWidgets


class NiceProgressBar(QtWidgets.QProgressBar):
Expand Down
10 changes: 5 additions & 5 deletions igniter/update_thread.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# -*- coding: utf-8 -*-
"""Working thread for update."""
from Qt.QtCore import QThread, Signal, QObject # noqa
from qtpy import QtCore

from .bootstrap_repos import (
BootstrapRepos,
OpenPypeVersion
)


class UpdateThread(QThread):
class UpdateThread(QtCore.QThread):
"""Install Worker thread.
This class takes care of finding OpenPype version on user entered path
Expand All @@ -19,13 +19,13 @@ class UpdateThread(QThread):
user data dir.
"""
progress = Signal(int)
message = Signal((str, bool))
progress = QtCore.Signal(int)
message = QtCore.Signal((str, bool))

def __init__(self, parent=None):
self._result = None
self._openpype_version = None
QThread.__init__(self, parent)
super().__init__(parent)

def set_version(self, openpype_version: OpenPypeVersion):
self._openpype_version = openpype_version
Expand Down
4 changes: 3 additions & 1 deletion igniter/update_window.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# -*- coding: utf-8 -*-
"""Progress window to show when OpenPype is updating/installing locally."""
import os

from qtpy import QtCore, QtGui, QtWidgets

from .update_thread import UpdateThread
from Qt import QtCore, QtGui, QtWidgets # noqa
from .bootstrap_repos import OpenPypeVersion
from .nice_progress_bar import NiceProgressBar
from .tools import load_stylesheet
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def validate_thirdparty_binaries():
"jinxed",
"blessed",
"Qt",
"qtpy",
"speedcopy",
"googleapiclient",
"httplib2",
Expand Down

0 comments on commit f803d4a

Please sign in to comment.