Skip to content

Commit 86cf6c8

Browse files
authored
Merge pull request #1798 from McStasMcXtrace/qt5qt6-pyqtgraph-fix-1768
Qt5qt6 pyqtgraph candidate fix 1768
2 parents 4662602 + 7b5c03f commit 86cf6c8

File tree

10 files changed

+11
-11
lines changed

10 files changed

+11
-11
lines changed

environment.yml

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ dependencies:
2323
- pillow
2424
- pyqtgraph
2525
- pyqt
26+
- qtpy
2627
- qscintilla2
2728
- nexus
2829
- nexusformat

mcstas-environment.yml

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ dependencies:
2424
- pillow
2525
- pyqtgraph
2626
- pyqt
27+
- qtpy
2728
- qscintilla2
2829
- nexusformat
2930
- nexpy

mcxtrace-environment.yml

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ dependencies:
2424
- pillow
2525
- pyqtgraph
2626
- pyqt
27+
- qtpy
2728
- qscintilla2
2829
- nexusformat
2930
- nexpy

meta-pkgs/windows/environment.yml

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ dependencies:
1717
- pillow
1818
- pyqtgraph
1919
- pyqt
20+
- qtpy
2021
- qscintilla2
2122
- nexus
2223
- nexusformat

tools/Python/mccodelib/pqtgfrontend.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import subprocess
88
import numpy as np
99

10+
import qtpy
1011
import pyqtgraph as pg
1112
from pyqtgraph.Qt import QtCore, QtGui, QtWidgets
1213

@@ -103,11 +104,11 @@ def __init__(self, plotgraph, sourcedir, plot_func, invcanvas):
103104
if hasattr(self.app, "exec_"):
104105
try:
105106
import PySide6
106-
self.isQt6 = True
107+
self.isQt6 = False
107108
except:
108109
self.isQt6 = False
109110
else:
110-
self.isQt6 = True
111+
self.isQt6 = False
111112

112113
if invcanvas:
113114
# switch to using white background and black foreground

tools/Python/mcdisplay/pyqtgraph/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ set(CPACK_NSIS_DISPLAY_NAME "${NSIS_NAME}")
5151
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${NSIS_NAME}")
5252

5353
# Debian
54-
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${FLAVOR}, python3, python3-pyqtgraph, python3-ply, python3-numpy")
54+
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${FLAVOR}, python3, python3-pyqtgraph, python3-ply, python3-numpy, python3-qtpy")
5555
set(CPACK_DEBIAN_PACKAGE_REPLACES "${FLAVOR}-tools-python-${P}display-pyqtgraph-3.5.1")
5656

5757
# RPM

tools/Python/mcdisplay/pyqtgraph/mcdisplay.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
import numpy as np
1515
from enum import Enum
16-
import PyQt5
16+
import qtpy
1717
from pyqtgraph.Qt import QtGui, QtCore, QtWidgets
1818
import pyqtgraph as pg
1919
from pyqtgraph.graphicsItems.LegendItem import LegendItem, ItemSample

tools/Python/mcplot/pyqtgraph/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ set(CPACK_NSIS_DISPLAY_NAME "${NSIS_NAME}")
5151
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${NSIS_NAME}")
5252

5353
# Debian
54-
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${FLAVOR}, python3-pyqtgraph, python3-numpy")
54+
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${FLAVOR}, python3-pyqtgraph, python3-numpy, python3-qtpy")
5555
set(CPACK_DEBIAN_PACKAGE_REPLACES "${FLAVOR}-tools-python-${P}plot-pyqtgraph-3.5.1")
5656

5757
# RPM

tools/Python/mcplot/pyqtgraph/mcplot.in

-6
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@ canrun() {
2424
cmd="${cmd}import ${name}; "
2525
done
2626
python3 -c "${cmd}"
27-
28-
python3 -c "import PySide6" 2> /dev/null
29-
if [ $? == 0 ]; then
30-
mcstas_errmsg Your Python has PySide6 - ${TOOL} will not function correctly. Please run in an environment with PyQt5 only.
31-
exit 127;
32-
fi
3327
}
3428

3529
if ( canrun ); then

tools/Python/mcplot/pyqtgraph/mcplot.py

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import sys
99
import subprocess
1010

11+
import qtpy
1112
import plotfuncs
1213

1314
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..'))

0 commit comments

Comments
 (0)