From 3c27b535288b128f6b2fda1881bcc6cff0d94cf9 Mon Sep 17 00:00:00 2001 From: Patrick Avery Date: Thu, 12 Oct 2023 16:29:02 -0500 Subject: [PATCH 01/37] Rename "PySide2" to "PySide6" This was done via this command: ```bash find . -name "*.py" | xargs sed -i 's/PySide2/PySide6/g' ``` This takes care of most changes needed. Signed-off-by: Patrick Avery --- hexrd/ui/__init__.py | 4 ++-- hexrd/ui/about_dialog.py | 10 +++++----- hexrd/ui/async_runner.py | 4 ++-- hexrd/ui/async_worker.py | 2 +- hexrd/ui/azimuthal_overlay_manager.py | 4 ++-- hexrd/ui/azimuthal_overlay_style_picker.py | 6 +++--- hexrd/ui/beam_marker_style_editor.py | 4 ++-- hexrd/ui/brightness_contrast_editor.py | 4 ++-- hexrd/ui/cal_tree_view.py | 6 +++--- hexrd/ui/calibration/auto/powder_calibration_dialog.py | 4 ++-- hexrd/ui/calibration/auto/powder_runner.py | 4 ++-- hexrd/ui/calibration/calibration_runner.py | 4 ++-- .../ui/calibration/hedm/calibration_options_dialog.py | 2 +- .../ui/calibration/hedm/calibration_results_dialog.py | 4 ++-- hexrd/ui/calibration/hedm/calibration_runner.py | 2 +- hexrd/ui/calibration/hkl_picks_tree_view_dialog.py | 4 ++-- hexrd/ui/calibration/laue_auto_picker_dialog.py | 2 +- hexrd/ui/calibration/panel_buffer_dialog.py | 4 ++-- .../ui/calibration/structureless/calibration_dialog.py | 4 ++-- hexrd/ui/calibration/structureless/runner.py | 4 ++-- hexrd/ui/calibration/wppf_options_dialog.py | 6 +++--- hexrd/ui/calibration/wppf_runner.py | 2 +- hexrd/ui/calibration_crystal_editor.py | 4 ++-- hexrd/ui/calibration_crystal_slider_widget.py | 4 ++-- hexrd/ui/calibration_slider_widget.py | 2 +- hexrd/ui/color_map_editor.py | 2 +- hexrd/ui/config_dialog.py | 2 +- hexrd/ui/dynamic_widget.py | 4 ++-- hexrd/ui/edit_colormap_list_dialog.py | 2 +- hexrd/ui/grains_viewer_dialog.py | 2 +- hexrd/ui/hand_drawn_mask_dialog.py | 2 +- hexrd/ui/hand_picked_fibers_widget.py | 4 ++-- hexrd/ui/hexrd_config.py | 2 +- hexrd/ui/hidden_bar_tab_widget.py | 4 ++-- hexrd/ui/image_calculator_dialog.py | 4 ++-- hexrd/ui/image_canvas.py | 4 ++-- hexrd/ui/image_file_manager.py | 2 +- hexrd/ui/image_load_manager.py | 4 ++-- hexrd/ui/image_mode_widget.py | 2 +- hexrd/ui/image_series_toolbar.py | 6 +++--- hexrd/ui/image_stack_dialog.py | 4 ++-- hexrd/ui/image_tab_widget.py | 6 +++--- hexrd/ui/indexing/fit_grains_options_dialog.py | 4 ++-- hexrd/ui/indexing/fit_grains_results_dialog.py | 8 ++++---- hexrd/ui/indexing/fit_grains_select_dialog.py | 4 ++-- hexrd/ui/indexing/fit_grains_tolerances_model.py | 2 +- hexrd/ui/indexing/grains_table_model.py | 2 +- hexrd/ui/indexing/grains_table_view.py | 6 +++--- hexrd/ui/indexing/indexing_results_dialog.py | 4 ++-- hexrd/ui/indexing/ome_maps_select_dialog.py | 4 ++-- hexrd/ui/indexing/ome_maps_viewer_dialog.py | 4 ++-- hexrd/ui/indexing/run.py | 4 ++-- hexrd/ui/indexing/view_spots_dialog.py | 6 +++--- hexrd/ui/input_dialog.py | 2 +- hexrd/ui/instrument_form_view_widget.py | 6 +++--- hexrd/ui/laue_overlay_editor.py | 2 +- hexrd/ui/line_picker_dialog.py | 2 +- hexrd/ui/list_editor.py | 6 +++--- hexrd/ui/llnl_import_tool_dialog.py | 6 +++--- hexrd/ui/load_hdf5_dialog.py | 2 +- hexrd/ui/load_images_dialog.py | 2 +- hexrd/ui/main.py | 6 +++--- hexrd/ui/main_window.py | 6 +++--- hexrd/ui/mask_manager_dialog.py | 6 +++--- hexrd/ui/mask_regions_dialog.py | 2 +- hexrd/ui/material_editor_widget.py | 4 ++-- hexrd/ui/material_list_editor.py | 4 ++-- hexrd/ui/material_site_editor.py | 4 ++-- hexrd/ui/material_structure_editor.py | 4 ++-- hexrd/ui/materials_panel.py | 6 +++--- hexrd/ui/matrix_editor.py | 6 +++--- hexrd/ui/message_box.py | 4 ++-- hexrd/ui/messages_widget.py | 6 +++--- hexrd/ui/overlay_manager.py | 4 ++-- hexrd/ui/overlay_style_picker.py | 6 +++--- hexrd/ui/periodic_table_dialog.py | 4 ++-- hexrd/ui/pinhole_correction_editor.py | 4 ++-- hexrd/ui/pinhole_mask_dialog.py | 4 ++-- hexrd/ui/plot_grains.py | 2 +- hexrd/ui/powder_overlay_editor.py | 2 +- hexrd/ui/progress_dialog.py | 2 +- hexrd/ui/ranges_table_editor.py | 4 ++-- hexrd/ui/reflections_selection_helper.py | 4 ++-- hexrd/ui/reflections_table.py | 4 ++-- hexrd/ui/reorder_pairs_widget.py | 6 +++--- hexrd/ui/rerun_clustering_dialog.py | 4 ++-- hexrd/ui/rotation_series_overlay_editor.py | 2 +- hexrd/ui/save_images_dialog.py | 4 ++-- hexrd/ui/scientificspinbox.py | 4 ++-- hexrd/ui/select_grains_dialog.py | 4 ++-- hexrd/ui/select_item_dialog.py | 2 +- hexrd/ui/select_items_dialog.py | 4 ++-- hexrd/ui/select_items_widget.py | 4 ++-- hexrd/ui/simple_image_series_dialog.py | 6 +++--- hexrd/ui/singletons.py | 2 +- hexrd/ui/snip_viewer_dialog.py | 4 ++-- hexrd/ui/state.py | 2 +- hexrd/ui/table_selector_widget.py | 6 +++--- hexrd/ui/threshold_mask_dialog.py | 4 ++-- hexrd/ui/transform_dialog.py | 2 +- hexrd/ui/tree_views/base_dict_tree_item_model.py | 6 +++--- hexrd/ui/tree_views/base_tree_item_model.py | 2 +- hexrd/ui/tree_views/dict_tree_view.py | 2 +- hexrd/ui/tree_views/generic_picks_tree_view.py | 6 +++--- hexrd/ui/tree_views/hkl_picks_tree_view.py | 4 ++-- hexrd/ui/tree_views/multi_column_dict_tree_view.py | 10 +++++----- hexrd/ui/tree_views/value_column_delegate.py | 6 +++--- hexrd/ui/ui_loader.py | 6 +++--- hexrd/ui/utils/__init__.py | 4 ++-- hexrd/ui/utils/dialog.py | 4 ++-- hexrd/ui/wppf_style_picker.py | 6 +++--- hexrd/ui/xray_energy_selection_dialog.py | 4 ++-- hexrd/ui/zoom_canvas.py | 4 ++-- tests/conftest.py | 2 +- tests/test_hedm.py | 2 +- tests/utils.py | 2 +- 116 files changed, 230 insertions(+), 230 deletions(-) diff --git a/hexrd/ui/__init__.py b/hexrd/ui/__init__.py index fe3b4a4f8..85f709310 100644 --- a/hexrd/ui/__init__.py +++ b/hexrd/ui/__init__.py @@ -1,5 +1,5 @@ -from PySide2.QtCore import QEvent, QObject, Qt -from PySide2.QtWidgets import QDialog, QPushButton +from PySide6.QtCore import QEvent, QObject, Qt +from PySide6.QtWidgets import QDialog, QPushButton class EnterKeyFilter(QObject): diff --git a/hexrd/ui/about_dialog.py b/hexrd/ui/about_dialog.py index ab0db449f..834e98f19 100644 --- a/hexrd/ui/about_dialog.py +++ b/hexrd/ui/about_dialog.py @@ -1,10 +1,10 @@ from importlib.metadata import version import sys -from PySide2.QtCore import Qt, QObject, QSize -from PySide2.QtSvg import QSvgWidget -from PySide2.QtWidgets import QTreeWidgetItem, QLabel -from PySide2.QtGui import QPixmap +from PySide6.QtCore import Qt, QObject, QSize +from PySide6.QtSvg import QSvgWidget +from PySide6.QtWidgets import QTreeWidgetItem, QLabel +from PySide6.QtGui import QPixmap import hexrd @@ -78,7 +78,7 @@ def _populate_versions(self): "HEXRD", "NumPy", "SciPy", - "PySide2" + "PySide6" ] for package in packages: diff --git a/hexrd/ui/async_runner.py b/hexrd/ui/async_runner.py index 41aded8e4..1496856f2 100644 --- a/hexrd/ui/async_runner.py +++ b/hexrd/ui/async_runner.py @@ -1,5 +1,5 @@ -from PySide2.QtCore import QThreadPool, QTimer -from PySide2.QtWidgets import QMessageBox +from PySide6.QtCore import QThreadPool, QTimer +from PySide6.QtWidgets import QMessageBox from hexrd.ui.async_worker import AsyncWorker from hexrd.ui.progress_dialog import ProgressDialog diff --git a/hexrd/ui/async_worker.py b/hexrd/ui/async_worker.py index 608a5ed81..228a6db91 100644 --- a/hexrd/ui/async_worker.py +++ b/hexrd/ui/async_worker.py @@ -1,7 +1,7 @@ # This class was modified from the following example online: # https://www.learnpyqt.com/courses/concurrent-execution/multithreading-pyqt-applications-qthreadpool/ -from PySide2.QtCore import QObject, QRunnable, Signal, Slot +from PySide6.QtCore import QObject, QRunnable, Signal, Slot import inspect import traceback diff --git a/hexrd/ui/azimuthal_overlay_manager.py b/hexrd/ui/azimuthal_overlay_manager.py index 91fa600e6..481f48aa6 100644 --- a/hexrd/ui/azimuthal_overlay_manager.py +++ b/hexrd/ui/azimuthal_overlay_manager.py @@ -1,6 +1,6 @@ import random -from PySide2.QtCore import Qt, QItemSelectionModel -from PySide2.QtWidgets import ( +from PySide6.QtCore import Qt, QItemSelectionModel +from PySide6.QtWidgets import ( QCheckBox, QComboBox, QHBoxLayout, QHeaderView, QSizePolicy, QTableWidgetItem, QWidget ) diff --git a/hexrd/ui/azimuthal_overlay_style_picker.py b/hexrd/ui/azimuthal_overlay_style_picker.py index 1d71e7b05..bf47fe985 100644 --- a/hexrd/ui/azimuthal_overlay_style_picker.py +++ b/hexrd/ui/azimuthal_overlay_style_picker.py @@ -1,6 +1,6 @@ -from PySide2.QtCore import QObject -from PySide2.QtGui import QColor -from PySide2.QtWidgets import QColorDialog +from PySide6.QtCore import QObject +from PySide6.QtGui import QColor +from PySide6.QtWidgets import QColorDialog from hexrd.ui.hexrd_config import HexrdConfig from hexrd.ui.ui_loader import UiLoader diff --git a/hexrd/ui/beam_marker_style_editor.py b/hexrd/ui/beam_marker_style_editor.py index 3905f9647..c4bbaccf3 100644 --- a/hexrd/ui/beam_marker_style_editor.py +++ b/hexrd/ui/beam_marker_style_editor.py @@ -2,8 +2,8 @@ from matplotlib.markers import MarkerStyle -from PySide2.QtGui import QColor -from PySide2.QtWidgets import QColorDialog +from PySide6.QtGui import QColor +from PySide6.QtWidgets import QColorDialog from hexrd.ui.hexrd_config import HexrdConfig from hexrd.ui.ui_loader import UiLoader diff --git a/hexrd/ui/brightness_contrast_editor.py b/hexrd/ui/brightness_contrast_editor.py index a240e2eeb..12774b962 100644 --- a/hexrd/ui/brightness_contrast_editor.py +++ b/hexrd/ui/brightness_contrast_editor.py @@ -1,8 +1,8 @@ import numpy as np from scipy.interpolate import interp1d -from PySide2.QtCore import QObject, Signal -from PySide2.QtWidgets import ( +from PySide6.QtCore import QObject, Signal +from PySide6.QtWidgets import ( QDialog, QDialogButtonBox, QMessageBox, QVBoxLayout ) diff --git a/hexrd/ui/cal_tree_view.py b/hexrd/ui/cal_tree_view.py index 65e794ed1..400eac731 100644 --- a/hexrd/ui/cal_tree_view.py +++ b/hexrd/ui/cal_tree_view.py @@ -1,8 +1,8 @@ -from PySide2.QtCore import QObject, QModelIndex, Qt -from PySide2.QtWidgets import ( +from PySide6.QtCore import QObject, QModelIndex, Qt +from PySide6.QtWidgets import ( QCheckBox, QMenu, QMessageBox, QStyledItemDelegate, QTreeView ) -from PySide2.QtGui import QCursor +from PySide6.QtGui import QCursor import numpy as np diff --git a/hexrd/ui/calibration/auto/powder_calibration_dialog.py b/hexrd/ui/calibration/auto/powder_calibration_dialog.py index cb5878e35..574602edf 100644 --- a/hexrd/ui/calibration/auto/powder_calibration_dialog.py +++ b/hexrd/ui/calibration/auto/powder_calibration_dialog.py @@ -1,5 +1,5 @@ -from PySide2.QtCore import QTimer -from PySide2.QtWidgets import QMessageBox +from PySide6.QtCore import QTimer +from PySide6.QtWidgets import QMessageBox import numpy as np diff --git a/hexrd/ui/calibration/auto/powder_runner.py b/hexrd/ui/calibration/auto/powder_runner.py index fc93f71ca..d3bf05fc9 100644 --- a/hexrd/ui/calibration/auto/powder_runner.py +++ b/hexrd/ui/calibration/auto/powder_runner.py @@ -3,8 +3,8 @@ import numpy as np -from PySide2.QtCore import QObject, QTimer, Qt, Signal -from PySide2.QtWidgets import QCheckBox, QMessageBox +from PySide6.QtCore import QObject, QTimer, Qt, Signal +from PySide6.QtWidgets import QCheckBox, QMessageBox from hexrd.fitting.calibration import InstrumentCalibrator, PowderCalibrator from hexrd.ui.async_runner import AsyncRunner diff --git a/hexrd/ui/calibration/calibration_runner.py b/hexrd/ui/calibration/calibration_runner.py index ac02a985e..6e07de8c6 100644 --- a/hexrd/ui/calibration/calibration_runner.py +++ b/hexrd/ui/calibration/calibration_runner.py @@ -6,8 +6,8 @@ import h5py import numpy as np -from PySide2.QtCore import QObject, Signal -from PySide2.QtWidgets import QFileDialog, QMessageBox +from PySide6.QtCore import QObject, Signal +from PySide6.QtWidgets import QFileDialog, QMessageBox from hexrd.crystallography import hklToStr from hexrd.fitting.calibration import ( diff --git a/hexrd/ui/calibration/hedm/calibration_options_dialog.py b/hexrd/ui/calibration/hedm/calibration_options_dialog.py index 7cb179aa6..890676725 100644 --- a/hexrd/ui/calibration/hedm/calibration_options_dialog.py +++ b/hexrd/ui/calibration/hedm/calibration_options_dialog.py @@ -1,4 +1,4 @@ -from PySide2.QtCore import QObject, Signal +from PySide6.QtCore import QObject, Signal from hexrd.ui.hexrd_config import HexrdConfig from hexrd.ui.grains_viewer_dialog import GrainsViewerDialog diff --git a/hexrd/ui/calibration/hedm/calibration_results_dialog.py b/hexrd/ui/calibration/hedm/calibration_results_dialog.py index 5ed5b9aad..aeefeb212 100644 --- a/hexrd/ui/calibration/hedm/calibration_results_dialog.py +++ b/hexrd/ui/calibration/hedm/calibration_results_dialog.py @@ -1,5 +1,5 @@ -from PySide2.QtCore import Qt -from PySide2.QtWidgets import QSizePolicy +from PySide6.QtCore import Qt +from PySide6.QtWidgets import QSizePolicy from matplotlib.backends.backend_qt5agg import FigureCanvas from matplotlib.figure import Figure diff --git a/hexrd/ui/calibration/hedm/calibration_runner.py b/hexrd/ui/calibration/hedm/calibration_runner.py index 61cf60e2b..6baf76e42 100644 --- a/hexrd/ui/calibration/hedm/calibration_runner.py +++ b/hexrd/ui/calibration/hedm/calibration_runner.py @@ -1,6 +1,6 @@ import numpy as np -from PySide2.QtCore import QObject, Signal +from PySide6.QtCore import QObject, Signal from hexrd import constants as cnst, instrument from hexrd.fitting import calibration diff --git a/hexrd/ui/calibration/hkl_picks_tree_view_dialog.py b/hexrd/ui/calibration/hkl_picks_tree_view_dialog.py index 82ee30fd9..2183a141b 100644 --- a/hexrd/ui/calibration/hkl_picks_tree_view_dialog.py +++ b/hexrd/ui/calibration/hkl_picks_tree_view_dialog.py @@ -6,8 +6,8 @@ from hexrd.crystallography import hklToStr -from PySide2.QtCore import QTimer -from PySide2.QtWidgets import QFileDialog, QMessageBox +from PySide6.QtCore import QTimer +from PySide6.QtWidgets import QFileDialog, QMessageBox from hexrd.instrument import unwrap_dict_to_h5, unwrap_h5_to_dict diff --git a/hexrd/ui/calibration/laue_auto_picker_dialog.py b/hexrd/ui/calibration/laue_auto_picker_dialog.py index 8e498dc0a..b6c311fdf 100644 --- a/hexrd/ui/calibration/laue_auto_picker_dialog.py +++ b/hexrd/ui/calibration/laue_auto_picker_dialog.py @@ -1,4 +1,4 @@ -from PySide2.QtWidgets import QMessageBox +from PySide6.QtWidgets import QMessageBox import numpy as np diff --git a/hexrd/ui/calibration/panel_buffer_dialog.py b/hexrd/ui/calibration/panel_buffer_dialog.py index 0a804bafd..a02326d0c 100644 --- a/hexrd/ui/calibration/panel_buffer_dialog.py +++ b/hexrd/ui/calibration/panel_buffer_dialog.py @@ -1,8 +1,8 @@ import copy import os -from PySide2.QtCore import Signal, QObject -from PySide2.QtWidgets import QFileDialog, QMessageBox +from PySide6.QtCore import Signal, QObject +from PySide6.QtWidgets import QFileDialog, QMessageBox import matplotlib.pyplot as plt import numpy as np diff --git a/hexrd/ui/calibration/structureless/calibration_dialog.py b/hexrd/ui/calibration/structureless/calibration_dialog.py index 9252046a2..a24aaa3fb 100644 --- a/hexrd/ui/calibration/structureless/calibration_dialog.py +++ b/hexrd/ui/calibration/structureless/calibration_dialog.py @@ -1,8 +1,8 @@ import copy import yaml -from PySide2.QtCore import QObject, Qt, Signal -from PySide2.QtWidgets import QComboBox, QDoubleSpinBox, QMessageBox, QSpinBox +from PySide6.QtCore import QObject, Qt, Signal +from PySide6.QtWidgets import QComboBox, QDoubleSpinBox, QMessageBox, QSpinBox from hexrd.ui import resource_loader from hexrd.ui.tree_views.multi_column_dict_tree_view import ( diff --git a/hexrd/ui/calibration/structureless/runner.py b/hexrd/ui/calibration/structureless/runner.py index 369b41fee..7a3f9bb82 100644 --- a/hexrd/ui/calibration/structureless/runner.py +++ b/hexrd/ui/calibration/structureless/runner.py @@ -5,8 +5,8 @@ import matplotlib.pyplot as plt import numpy as np -from PySide2.QtCore import QObject, Signal -from PySide2.QtWidgets import QFileDialog, QMessageBox +from PySide6.QtCore import QObject, Signal +from PySide6.QtWidgets import QFileDialog, QMessageBox from hexrd.fitting.calibration import StructureLessCalibrator diff --git a/hexrd/ui/calibration/wppf_options_dialog.py b/hexrd/ui/calibration/wppf_options_dialog.py index 764cdd4ef..26be1199d 100644 --- a/hexrd/ui/calibration/wppf_options_dialog.py +++ b/hexrd/ui/calibration/wppf_options_dialog.py @@ -4,8 +4,8 @@ import matplotlib.pyplot as plt import numpy as np -from PySide2.QtCore import Qt, QObject, QTimer, Signal -from PySide2.QtWidgets import ( +from PySide6.QtCore import Qt, QObject, QTimer, Signal +from PySide6.QtWidgets import ( QCheckBox, QFileDialog, QHBoxLayout, QMessageBox, QSizePolicy, QTableWidgetItem, QWidget ) @@ -921,7 +921,7 @@ def dict_to_param(d): if __name__ == '__main__': - from PySide2.QtWidgets import QApplication + from PySide6.QtWidgets import QApplication app = QApplication() diff --git a/hexrd/ui/calibration/wppf_runner.py b/hexrd/ui/calibration/wppf_runner.py index 8cb94a271..d7a6e080d 100644 --- a/hexrd/ui/calibration/wppf_runner.py +++ b/hexrd/ui/calibration/wppf_runner.py @@ -1,6 +1,6 @@ import copy -from PySide2.QtCore import QCoreApplication +from PySide6.QtCore import QCoreApplication from hexrd.wppf import Rietveld diff --git a/hexrd/ui/calibration_crystal_editor.py b/hexrd/ui/calibration_crystal_editor.py index 82f7d0845..8ab4490ad 100644 --- a/hexrd/ui/calibration_crystal_editor.py +++ b/hexrd/ui/calibration_crystal_editor.py @@ -2,8 +2,8 @@ import numpy as np from numpy.linalg import LinAlgError -from PySide2.QtCore import QObject, Signal -from PySide2.QtWidgets import QFileDialog +from PySide6.QtCore import QObject, Signal +from PySide6.QtWidgets import QFileDialog from hexrd import instrument, matrixutil diff --git a/hexrd/ui/calibration_crystal_slider_widget.py b/hexrd/ui/calibration_crystal_slider_widget.py index 6e46b4faa..3d0a90123 100644 --- a/hexrd/ui/calibration_crystal_slider_widget.py +++ b/hexrd/ui/calibration_crystal_slider_widget.py @@ -1,7 +1,7 @@ from enum import IntEnum -from PySide2.QtCore import QObject, Signal -from PySide2.QtWidgets import QProxyStyle, QStyle +from PySide6.QtCore import QObject, Signal +from PySide6.QtWidgets import QProxyStyle, QStyle from hexrd.ui.ui_loader import UiLoader from hexrd.ui.utils import block_signals diff --git a/hexrd/ui/calibration_slider_widget.py b/hexrd/ui/calibration_slider_widget.py index b2c4ed4f4..69eae715c 100644 --- a/hexrd/ui/calibration_slider_widget.py +++ b/hexrd/ui/calibration_slider_widget.py @@ -1,4 +1,4 @@ -from PySide2.QtCore import QObject +from PySide6.QtCore import QObject import numpy as np diff --git a/hexrd/ui/color_map_editor.py b/hexrd/ui/color_map_editor.py index e9a75778b..c5cb3154d 100644 --- a/hexrd/ui/color_map_editor.py +++ b/hexrd/ui/color_map_editor.py @@ -159,7 +159,7 @@ def bc_editor_modified(self): self.range_edited() def update_mins_and_maxes(self): - # We can't do this in PySide2 for some reason: + # We can't do this in PySide6 for some reason: # self.ui.maximum.valueChanged.connect(self.ui.minimum.setMaximum) # self.ui.minimum.valueChanged.connect(self.ui.maximum.setMinimum) self.ui.maximum.setMinimum(self.ui.minimum.value()) diff --git a/hexrd/ui/config_dialog.py b/hexrd/ui/config_dialog.py index 387c7bacd..bcb7ab1db 100644 --- a/hexrd/ui/config_dialog.py +++ b/hexrd/ui/config_dialog.py @@ -1,4 +1,4 @@ -from PySide2.QtWidgets import QMessageBox +from PySide6.QtWidgets import QMessageBox from hexrd.ui.hexrd_config import HexrdConfig from hexrd.ui.ui_loader import UiLoader diff --git a/hexrd/ui/dynamic_widget.py b/hexrd/ui/dynamic_widget.py index bbcdc59fb..0f4c7e724 100644 --- a/hexrd/ui/dynamic_widget.py +++ b/hexrd/ui/dynamic_widget.py @@ -1,5 +1,5 @@ -from PySide2.QtCore import QObject, Signal -from PySide2.QtWidgets import QCheckBox, QDoubleSpinBox, QLabel, QSpinBox +from PySide6.QtCore import QObject, Signal +from PySide6.QtWidgets import QCheckBox, QDoubleSpinBox, QLabel, QSpinBox from hexrd.ui.scientificspinbox import ScientificDoubleSpinBox diff --git a/hexrd/ui/edit_colormap_list_dialog.py b/hexrd/ui/edit_colormap_list_dialog.py index c5b52342a..54f4c80ac 100644 --- a/hexrd/ui/edit_colormap_list_dialog.py +++ b/hexrd/ui/edit_colormap_list_dialog.py @@ -1,4 +1,4 @@ -from PySide2.QtCore import QObject, Qt +from PySide6.QtCore import QObject, Qt from hexrd.ui import constants from hexrd.ui.hexrd_config import HexrdConfig diff --git a/hexrd/ui/grains_viewer_dialog.py b/hexrd/ui/grains_viewer_dialog.py index 5e9f47240..57909d861 100644 --- a/hexrd/ui/grains_viewer_dialog.py +++ b/hexrd/ui/grains_viewer_dialog.py @@ -1,4 +1,4 @@ -from PySide2.QtWidgets import QDialog, QVBoxLayout +from PySide6.QtWidgets import QDialog, QVBoxLayout from hexrd.ui.indexing.grains_table_model import GrainsTableModel from hexrd.ui.plot_grains import plot_grains diff --git a/hexrd/ui/hand_drawn_mask_dialog.py b/hexrd/ui/hand_drawn_mask_dialog.py index deb27164e..685eea29c 100644 --- a/hexrd/ui/hand_drawn_mask_dialog.py +++ b/hexrd/ui/hand_drawn_mask_dialog.py @@ -1,4 +1,4 @@ -from PySide2.QtCore import QObject, Signal, Qt +from PySide6.QtCore import QObject, Signal, Qt from itertools import cycle diff --git a/hexrd/ui/hand_picked_fibers_widget.py b/hexrd/ui/hand_picked_fibers_widget.py index 50f9849f4..90330f7a0 100644 --- a/hexrd/ui/hand_picked_fibers_widget.py +++ b/hexrd/ui/hand_picked_fibers_widget.py @@ -1,7 +1,7 @@ import numpy as np -from PySide2.QtCore import QItemSelectionModel, QObject, Qt, Signal -from PySide2.QtWidgets import QTableWidgetItem +from PySide6.QtCore import QItemSelectionModel, QObject, Qt, Signal +from PySide6.QtWidgets import QTableWidgetItem from hexrd.rotations import quatOfExpMap diff --git a/hexrd/ui/hexrd_config.py b/hexrd/ui/hexrd_config.py index 29d8a6924..5317d9115 100644 --- a/hexrd/ui/hexrd_config.py +++ b/hexrd/ui/hexrd_config.py @@ -4,7 +4,7 @@ from pathlib import Path import sys -from PySide2.QtCore import Signal, QCoreApplication, QObject, QSettings, QTimer +from PySide6.QtCore import Signal, QCoreApplication, QObject, QSettings, QTimer import h5py import matplotlib diff --git a/hexrd/ui/hidden_bar_tab_widget.py b/hexrd/ui/hidden_bar_tab_widget.py index 0a04d8040..6a49b2b15 100644 --- a/hexrd/ui/hidden_bar_tab_widget.py +++ b/hexrd/ui/hidden_bar_tab_widget.py @@ -1,5 +1,5 @@ -from PySide2.QtCore import QTimer -from PySide2.QtWidgets import QTabWidget +from PySide6.QtCore import QTimer +from PySide6.QtWidgets import QTabWidget class HiddenBarTabWidget(QTabWidget): diff --git a/hexrd/ui/image_calculator_dialog.py b/hexrd/ui/image_calculator_dialog.py index bf332d2f0..08ea6c2c4 100644 --- a/hexrd/ui/image_calculator_dialog.py +++ b/hexrd/ui/image_calculator_dialog.py @@ -1,7 +1,7 @@ from pathlib import Path -from PySide2.QtCore import QCoreApplication, QObject, Signal -from PySide2.QtWidgets import QFileDialog, QInputDialog, QMessageBox +from PySide6.QtCore import QCoreApplication, QObject, Signal +from PySide6.QtWidgets import QFileDialog, QInputDialog, QMessageBox from hexrd import imageseries diff --git a/hexrd/ui/image_canvas.py b/hexrd/ui/image_canvas.py index a65e308f0..b21b02a35 100644 --- a/hexrd/ui/image_canvas.py +++ b/hexrd/ui/image_canvas.py @@ -1,8 +1,8 @@ import copy import math -from PySide2.QtCore import QThreadPool, QTimer, Signal, Qt -from PySide2.QtWidgets import QFileDialog, QMessageBox +from PySide6.QtCore import QThreadPool, QTimer, Signal, Qt +from PySide6.QtWidgets import QFileDialog, QMessageBox from matplotlib.backends.backend_qt5agg import FigureCanvas diff --git a/hexrd/ui/image_file_manager.py b/hexrd/ui/image_file_manager.py index b0326948c..1a8172058 100644 --- a/hexrd/ui/image_file_manager.py +++ b/hexrd/ui/image_file_manager.py @@ -5,7 +5,7 @@ import yaml import h5py -from PySide2.QtWidgets import QMessageBox +from PySide6.QtWidgets import QMessageBox from hexrd import imageseries diff --git a/hexrd/ui/image_load_manager.py b/hexrd/ui/image_load_manager.py index 2c82df3f7..03211d83d 100644 --- a/hexrd/ui/image_load_manager.py +++ b/hexrd/ui/image_load_manager.py @@ -7,8 +7,8 @@ import numpy as np -from PySide2.QtCore import QObject, QThreadPool, Signal -from PySide2.QtWidgets import QMessageBox +from PySide6.QtCore import QObject, QThreadPool, Signal +from PySide6.QtWidgets import QMessageBox from hexrd import imageseries from hexrd.imageseries.omega import OmegaImageSeries diff --git a/hexrd/ui/image_mode_widget.py b/hexrd/ui/image_mode_widget.py index 77a37bd4c..d2924c4a8 100644 --- a/hexrd/ui/image_mode_widget.py +++ b/hexrd/ui/image_mode_widget.py @@ -2,7 +2,7 @@ import multiprocessing import numpy as np -from PySide2.QtCore import QObject, QTimer, Signal +from PySide6.QtCore import QObject, QTimer, Signal from hexrd.ui.azimuthal_overlay_manager import AzimuthalOverlayManager from hexrd.ui.constants import PolarXAxisType, ViewType diff --git a/hexrd/ui/image_series_toolbar.py b/hexrd/ui/image_series_toolbar.py index d5be6ee34..083192793 100644 --- a/hexrd/ui/image_series_toolbar.py +++ b/hexrd/ui/image_series_toolbar.py @@ -1,7 +1,7 @@ from pathlib import Path -from PySide2.QtCore import Qt -from PySide2.QtWidgets import QGridLayout, QLabel, QSlider, QSpinBox, QWidget -from PySide2.QtGui import QPixmap +from PySide6.QtCore import Qt +from PySide6.QtWidgets import QGridLayout, QLabel, QSlider, QSpinBox, QWidget +from PySide6.QtGui import QPixmap from hexrd.ui import resource_loader import hexrd.ui.resources.icons diff --git a/hexrd/ui/image_stack_dialog.py b/hexrd/ui/image_stack_dialog.py index b9d20ebce..c74463658 100644 --- a/hexrd/ui/image_stack_dialog.py +++ b/hexrd/ui/image_stack_dialog.py @@ -3,8 +3,8 @@ import numpy as np from pathlib import Path -from PySide2.QtCore import QObject, Signal, Qt -from PySide2.QtWidgets import QFileDialog, QMessageBox, QTableWidgetItem, QTreeWidgetItem, QAbstractItemView +from PySide6.QtCore import QObject, Signal, Qt +from PySide6.QtWidgets import QFileDialog, QMessageBox, QTableWidgetItem, QTreeWidgetItem, QAbstractItemView from hexrd.ui.constants import MAXIMUM_OMEGA_RANGE from hexrd.ui.hexrd_config import HexrdConfig diff --git a/hexrd/ui/image_tab_widget.py b/hexrd/ui/image_tab_widget.py index dbc7cf05f..a4c5b0d73 100644 --- a/hexrd/ui/image_tab_widget.py +++ b/hexrd/ui/image_tab_widget.py @@ -1,5 +1,5 @@ -from PySide2.QtCore import Signal, Slot, Qt -from PySide2.QtWidgets import QMessageBox, QTabWidget, QHBoxLayout +from PySide6.QtCore import Signal, Slot, Qt +from PySide6.QtWidgets import QMessageBox, QTabWidget, QHBoxLayout import numpy as np @@ -434,7 +434,7 @@ def export_to_maud(self, filename): if __name__ == '__main__': import sys - from PySide2.QtWidgets import QApplication + from PySide6.QtWidgets import QApplication app = QApplication(sys.argv) diff --git a/hexrd/ui/indexing/fit_grains_options_dialog.py b/hexrd/ui/indexing/fit_grains_options_dialog.py index 7ddd227e0..a44cae90b 100644 --- a/hexrd/ui/indexing/fit_grains_options_dialog.py +++ b/hexrd/ui/indexing/fit_grains_options_dialog.py @@ -1,8 +1,8 @@ from pathlib import Path -from PySide2.QtCore import ( +from PySide6.QtCore import ( QItemSelectionModel, QModelIndex, QObject, Qt, Signal) -from PySide2.QtWidgets import ( +from PySide6.QtWidgets import ( QDialogButtonBox, QFileDialog, QHeaderView, QMessageBox ) diff --git a/hexrd/ui/indexing/fit_grains_results_dialog.py b/hexrd/ui/indexing/fit_grains_results_dialog.py index 084b66a9c..721caa75a 100644 --- a/hexrd/ui/indexing/fit_grains_results_dialog.py +++ b/hexrd/ui/indexing/fit_grains_results_dialog.py @@ -12,8 +12,8 @@ from matplotlib.backends.backend_qt5agg import FigureCanvas from matplotlib.figure import Figure -from PySide2.QtCore import QObject, QTimer, Qt, Signal -from PySide2.QtWidgets import QFileDialog, QMenu, QMessageBox, QSizePolicy +from PySide6.QtCore import QObject, QTimer, Qt, Signal +from PySide6.QtWidgets import QFileDialog, QMenu, QMessageBox, QSizePolicy from hexrd.matrixutil import vecMVToSymm from hexrd.rotations import rotMatOfExpMap @@ -753,8 +753,8 @@ def on_export_workflow_clicked(self): self.async_runner.run(self._save_workflow_files, selected_directory) if __name__ == '__main__': - from PySide2.QtCore import QCoreApplication - from PySide2.QtWidgets import QApplication + from PySide6.QtCore import QCoreApplication + from PySide6.QtWidgets import QApplication # User specifies grains.out file if (len(sys.argv) < 2): diff --git a/hexrd/ui/indexing/fit_grains_select_dialog.py b/hexrd/ui/indexing/fit_grains_select_dialog.py index 342692f1b..76d0bc795 100644 --- a/hexrd/ui/indexing/fit_grains_select_dialog.py +++ b/hexrd/ui/indexing/fit_grains_select_dialog.py @@ -2,8 +2,8 @@ import numpy as np -from PySide2.QtCore import QObject, Signal -from PySide2.QtWidgets import QFileDialog, QMessageBox +from PySide6.QtCore import QObject, Signal +from PySide6.QtWidgets import QFileDialog, QMessageBox from hexrd.ui.hexrd_config import HexrdConfig from hexrd.ui.indexing.utils import generate_grains_table diff --git a/hexrd/ui/indexing/fit_grains_tolerances_model.py b/hexrd/ui/indexing/fit_grains_tolerances_model.py index a3ffa7f90..b406b4cf9 100644 --- a/hexrd/ui/indexing/fit_grains_tolerances_model.py +++ b/hexrd/ui/indexing/fit_grains_tolerances_model.py @@ -1,4 +1,4 @@ -from PySide2.QtCore import QAbstractTableModel, QModelIndex, Qt, Signal +from PySide6.QtCore import QAbstractTableModel, QModelIndex, Qt, Signal class FitGrainsToleranceModel(QAbstractTableModel): diff --git a/hexrd/ui/indexing/grains_table_model.py b/hexrd/ui/indexing/grains_table_model.py index 79168e54d..cb0cfb5b9 100644 --- a/hexrd/ui/indexing/grains_table_model.py +++ b/hexrd/ui/indexing/grains_table_model.py @@ -1,6 +1,6 @@ import numpy as np -from PySide2.QtCore import QAbstractTableModel, QModelIndex, Qt, Signal +from PySide6.QtCore import QAbstractTableModel, QModelIndex, Qt, Signal class GrainsTableModel(QAbstractTableModel): diff --git a/hexrd/ui/indexing/grains_table_view.py b/hexrd/ui/indexing/grains_table_view.py index e08422c54..07b847505 100644 --- a/hexrd/ui/indexing/grains_table_view.py +++ b/hexrd/ui/indexing/grains_table_view.py @@ -1,8 +1,8 @@ import numpy as np -from PySide2.QtCore import QSortFilterProxyModel, Qt, Signal -from PySide2.QtGui import QCursor -from PySide2.QtWidgets import QMenu, QMessageBox, QTableView +from PySide6.QtCore import QSortFilterProxyModel, Qt, Signal +from PySide6.QtGui import QCursor +from PySide6.QtWidgets import QMenu, QMessageBox, QTableView from hexrd.ui.async_runner import AsyncRunner from hexrd.ui.hexrd_config import HexrdConfig diff --git a/hexrd/ui/indexing/indexing_results_dialog.py b/hexrd/ui/indexing/indexing_results_dialog.py index 143b5bf9c..4ccf0896f 100644 --- a/hexrd/ui/indexing/indexing_results_dialog.py +++ b/hexrd/ui/indexing/indexing_results_dialog.py @@ -4,8 +4,8 @@ from matplotlib.figure import Figure import numpy as np -from PySide2.QtCore import Signal, QObject, Qt, QTimer -from PySide2.QtWidgets import QSizePolicy +from PySide6.QtCore import Signal, QObject, Qt, QTimer +from PySide6.QtWidgets import QSizePolicy from hexrd.transforms import xfcapi diff --git a/hexrd/ui/indexing/ome_maps_select_dialog.py b/hexrd/ui/indexing/ome_maps_select_dialog.py index 6a95ed1c0..bc29cc342 100644 --- a/hexrd/ui/indexing/ome_maps_select_dialog.py +++ b/hexrd/ui/indexing/ome_maps_select_dialog.py @@ -1,7 +1,7 @@ import os -from PySide2.QtCore import Signal, QObject -from PySide2.QtWidgets import QFileDialog, QMessageBox +from PySide6.QtCore import Signal, QObject +from PySide6.QtWidgets import QFileDialog, QMessageBox from hexrd.ui.hexrd_config import HexrdConfig from hexrd.ui.reflections_table import ReflectionsTable diff --git a/hexrd/ui/indexing/ome_maps_viewer_dialog.py b/hexrd/ui/indexing/ome_maps_viewer_dialog.py index 645aff3d1..327cdfd3c 100644 --- a/hexrd/ui/indexing/ome_maps_viewer_dialog.py +++ b/hexrd/ui/indexing/ome_maps_viewer_dialog.py @@ -6,8 +6,8 @@ import numpy as np import yaml -from PySide2.QtCore import Signal, QObject, QTimer, Qt -from PySide2.QtWidgets import ( +from PySide6.QtCore import Signal, QObject, QTimer, Qt +from PySide6.QtWidgets import ( QCheckBox, QComboBox, QDoubleSpinBox, QFileDialog, QMessageBox, QSizePolicy, QSpinBox ) diff --git a/hexrd/ui/indexing/run.py b/hexrd/ui/indexing/run.py index 9e69a2e99..4167be392 100644 --- a/hexrd/ui/indexing/run.py +++ b/hexrd/ui/indexing/run.py @@ -2,8 +2,8 @@ import numpy as np -from PySide2.QtCore import QObject, QThreadPool, Qt, Signal -from PySide2.QtWidgets import QMessageBox +from PySide6.QtCore import QObject, QThreadPool, Qt, Signal +from PySide6.QtWidgets import QMessageBox from hexrd import indexer, instrument from hexrd.cli.find_orientations import write_scored_orientations diff --git a/hexrd/ui/indexing/view_spots_dialog.py b/hexrd/ui/indexing/view_spots_dialog.py index 65864396c..052d48540 100644 --- a/hexrd/ui/indexing/view_spots_dialog.py +++ b/hexrd/ui/indexing/view_spots_dialog.py @@ -1,5 +1,5 @@ -from PySide2.QtCore import Qt -from PySide2.QtWidgets import QSizePolicy +from PySide6.QtCore import Qt +from PySide6.QtWidgets import QSizePolicy from matplotlib.backends.backend_qt5agg import FigureCanvas from matplotlib.figure import Figure @@ -322,7 +322,7 @@ def _find_data(all_spots, grain_id, det_key, gvec_id, peak_id): import pickle import sys - from PySide2.QtWidgets import QApplication + from PySide6.QtWidgets import QApplication if len(sys.argv) < 2: sys.exit('Usage: