diff --git a/environment.yml b/environment.yml index 99eaec574d..a744c88af9 100644 --- a/environment.yml +++ b/environment.yml @@ -23,6 +23,7 @@ dependencies: - pillow - pyqtgraph - pyqt + - qtpy - qscintilla2 - nexus - nexusformat diff --git a/mcstas-environment.yml b/mcstas-environment.yml index fff3ae7493..c54909b334 100644 --- a/mcstas-environment.yml +++ b/mcstas-environment.yml @@ -24,6 +24,7 @@ dependencies: - pillow - pyqtgraph - pyqt + - qtpy - qscintilla2 - nexusformat - nexpy diff --git a/mcxtrace-environment.yml b/mcxtrace-environment.yml index e2c4758104..9060ff21a7 100644 --- a/mcxtrace-environment.yml +++ b/mcxtrace-environment.yml @@ -24,6 +24,7 @@ dependencies: - pillow - pyqtgraph - pyqt + - qtpy - qscintilla2 - nexusformat - nexpy diff --git a/meta-pkgs/windows/environment.yml b/meta-pkgs/windows/environment.yml index ad5f7bd73e..ef54df2263 100644 --- a/meta-pkgs/windows/environment.yml +++ b/meta-pkgs/windows/environment.yml @@ -17,6 +17,7 @@ dependencies: - pillow - pyqtgraph - pyqt + - qtpy - qscintilla2 - nexus - nexusformat diff --git a/tools/Python/mccodelib/pqtgfrontend.py b/tools/Python/mccodelib/pqtgfrontend.py index 2c83921150..ce18def529 100644 --- a/tools/Python/mccodelib/pqtgfrontend.py +++ b/tools/Python/mccodelib/pqtgfrontend.py @@ -7,6 +7,7 @@ import subprocess import numpy as np +import qtpy import pyqtgraph as pg from pyqtgraph.Qt import QtCore, QtGui, QtWidgets @@ -103,11 +104,11 @@ def __init__(self, plotgraph, sourcedir, plot_func, invcanvas): if hasattr(self.app, "exec_"): try: import PySide6 - self.isQt6 = True + self.isQt6 = False except: self.isQt6 = False else: - self.isQt6 = True + self.isQt6 = False if invcanvas: # switch to using white background and black foreground diff --git a/tools/Python/mcdisplay/pyqtgraph/CMakeLists.txt b/tools/Python/mcdisplay/pyqtgraph/CMakeLists.txt index 1dcf6064f7..1a20907620 100644 --- a/tools/Python/mcdisplay/pyqtgraph/CMakeLists.txt +++ b/tools/Python/mcdisplay/pyqtgraph/CMakeLists.txt @@ -51,7 +51,7 @@ set(CPACK_NSIS_DISPLAY_NAME "${NSIS_NAME}") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${NSIS_NAME}") # Debian -set(CPACK_DEBIAN_PACKAGE_DEPENDS "${FLAVOR}, python3, python3-pyqtgraph, python3-ply, python3-numpy") +set(CPACK_DEBIAN_PACKAGE_DEPENDS "${FLAVOR}, python3, python3-pyqtgraph, python3-ply, python3-numpy, python3-qtpy") set(CPACK_DEBIAN_PACKAGE_REPLACES "${FLAVOR}-tools-python-${P}display-pyqtgraph-3.5.1") # RPM diff --git a/tools/Python/mcdisplay/pyqtgraph/mcdisplay.py b/tools/Python/mcdisplay/pyqtgraph/mcdisplay.py index e5683b3922..449b8e7bff 100755 --- a/tools/Python/mcdisplay/pyqtgraph/mcdisplay.py +++ b/tools/Python/mcdisplay/pyqtgraph/mcdisplay.py @@ -13,7 +13,7 @@ import numpy as np from enum import Enum -import PyQt5 +import qtpy from pyqtgraph.Qt import QtGui, QtCore, QtWidgets import pyqtgraph as pg from pyqtgraph.graphicsItems.LegendItem import LegendItem, ItemSample diff --git a/tools/Python/mcplot/pyqtgraph/CMakeLists.txt b/tools/Python/mcplot/pyqtgraph/CMakeLists.txt index b6930b19cf..8f7f225191 100644 --- a/tools/Python/mcplot/pyqtgraph/CMakeLists.txt +++ b/tools/Python/mcplot/pyqtgraph/CMakeLists.txt @@ -51,7 +51,7 @@ set(CPACK_NSIS_DISPLAY_NAME "${NSIS_NAME}") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${NSIS_NAME}") # Debian -set(CPACK_DEBIAN_PACKAGE_DEPENDS "${FLAVOR}, python3-pyqtgraph, python3-numpy") +set(CPACK_DEBIAN_PACKAGE_DEPENDS "${FLAVOR}, python3-pyqtgraph, python3-numpy, python3-qtpy") set(CPACK_DEBIAN_PACKAGE_REPLACES "${FLAVOR}-tools-python-${P}plot-pyqtgraph-3.5.1") # RPM diff --git a/tools/Python/mcplot/pyqtgraph/mcplot.in b/tools/Python/mcplot/pyqtgraph/mcplot.in index 3d263a9acf..ae4654e66e 100755 --- a/tools/Python/mcplot/pyqtgraph/mcplot.in +++ b/tools/Python/mcplot/pyqtgraph/mcplot.in @@ -24,12 +24,6 @@ canrun() { cmd="${cmd}import ${name}; " done python3 -c "${cmd}" - - python3 -c "import PySide6" 2> /dev/null - if [ $? == 0 ]; then - mcstas_errmsg Your Python has PySide6 - ${TOOL} will not function correctly. Please run in an environment with PyQt5 only. - exit 127; - fi } if ( canrun ); then diff --git a/tools/Python/mcplot/pyqtgraph/mcplot.py b/tools/Python/mcplot/pyqtgraph/mcplot.py index 49de6231da..bda1ee06b3 100644 --- a/tools/Python/mcplot/pyqtgraph/mcplot.py +++ b/tools/Python/mcplot/pyqtgraph/mcplot.py @@ -8,6 +8,7 @@ import sys import subprocess +import qtpy import plotfuncs sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..'))