Skip to content

Commit af37e8b

Browse files
remove explicit calls to PyQt5 (#356)
We are on the verge of moving from Qt5 to Qt6 As part of this effort, we need to remove all the explicit calls to PyQt5 and use the qtpy wrapper, which adapts to the underlying Qt environment
1 parent f71c77e commit af37e8b

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ dependencies = [
4747
"scipy<=1.15.3", # breaks ADR if not included. Remove when statsmodels is updated
4848
"docutils>=0.21",
4949
"psycopg[binary]>=3.2.3",
50+
"qtpy>=2.4.3"
5051
]
5152

5253
[tool.setuptools.packages.find]

src/ansys/dynamicreporting/core/utils/report_download_pdf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
import os
33

44
try:
5-
from PyQt5 import QtCore, QtGui, QtWebEngineWidgets
5+
from qtpy import QtCore, QtGui, QtWebEngineWidgets
66

77
# Classes for saving PDF representation
88
# pagedef = {width}X{height}X{0=port|1=land}X{left}X{right}X{top}X{bottom} all in mm
9-
from PyQt5.QtCore import QTimer
9+
from qtpy.QtCore import QTimer
1010

1111
has_qt = True
1212
except Exception:

src/ansys/dynamicreporting/core/utils/report_objects.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from .encoders import PayloaddataEncoder
2323

2424
try:
25-
from PyQt5 import QtCore, QtGui
25+
from qtpy import QtCore, QtGui
2626

2727
has_qt = True
2828
except ImportError:

src/ansys/dynamicreporting/core/utils/report_remote_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from requests import JSONDecodeError
44

55
try:
6-
from PyQt5 import QtCore, QtGui, QtWidgets
6+
from qtpy import QtCore, QtGui, QtWidgets
77

88
has_qt = True
99
except ImportError:

0 commit comments

Comments
 (0)