From b57ee2bf3b649d432f636eaccb3d959346db9363 Mon Sep 17 00:00:00 2001 From: qku Date: Sun, 29 Jan 2023 20:57:23 +0100 Subject: [PATCH 1/3] replace PySide2 with PySide6 --- docs/module_conversion.md | 4 ++-- setup.py | 4 ++-- src/qudi/gui/camera/camera_settings_dialog.py | 2 +- src/qudi/gui/camera/cameragui.py | 2 +- src/qudi/gui/laser/laser_control_dockwidget.py | 2 +- src/qudi/gui/laser/laser_gui.py | 2 +- src/qudi/gui/laser/laser_plot_dockwidgets.py | 2 +- src/qudi/gui/laserscanner/laserscannergui.py | 2 +- src/qudi/gui/nv_calculator/nv_calculatorgui.py | 2 +- src/qudi/gui/odmr/odmr_control_dockwidget.py | 2 +- src/qudi/gui/odmr/odmr_main_window.py | 2 +- src/qudi/gui/odmr/odmr_plot_widget.py | 2 +- src/qudi/gui/odmr/odmr_settings_dialog.py | 2 +- src/qudi/gui/odmr/odmrgui.py | 2 +- src/qudi/gui/pidgui/pidgui.py | 2 +- src/qudi/gui/poimanager/poimanagergui.py | 2 +- src/qudi/gui/pulsed/pulse_editors.py | 2 +- src/qudi/gui/pulsed/pulsed_custom_widgets.py | 2 +- src/qudi/gui/pulsed/pulsed_item_delegates.py | 2 +- src/qudi/gui/pulsed/pulsed_maingui.py | 2 +- src/qudi/gui/qdplot/main_window.py | 2 +- src/qudi/gui/qdplot/plot_widget.py | 2 +- src/qudi/gui/qdplot/qdplot_gui.py | 2 +- src/qudi/gui/scanning/axes_control_dockwidget.py | 2 +- src/qudi/gui/scanning/optimizer_dockwidget.py | 2 +- src/qudi/gui/scanning/optimizer_setting_dialog.py | 2 +- src/qudi/gui/scanning/scan_dockwidget.py | 2 +- src/qudi/gui/scanning/scan_settings_dialog.py | 2 +- src/qudi/gui/scanning/scan_widget.py | 2 +- src/qudi/gui/scanning/scannergui.py | 2 +- src/qudi/gui/spectrometer/control_widget.py | 4 ++-- src/qudi/gui/spectrometer/data_widget.py | 4 ++-- src/qudi/gui/spectrometer/settingsdialog.py | 2 +- src/qudi/gui/spectrometer/spectrometer_gui.py | 2 +- src/qudi/gui/spectrometer/spectrometer_window.py | 6 +++--- src/qudi/gui/switch/switch_gui.py | 2 +- src/qudi/gui/switch/switch_state_widgets.py | 2 +- src/qudi/gui/time_series/time_series_gui.py | 2 +- src/qudi/gui/wavemeter/wavemeterloggui.py | 2 +- src/qudi/hardware/dummy/finite_sampling_output_dummy.py | 2 +- src/qudi/hardware/dummy/scanning_probe_dummy.py | 2 +- src/qudi/hardware/dummy/wavemeter_dummy.py | 2 +- src/qudi/hardware/interfuse/ni_scanning_probe_interfuse.py | 4 ++-- src/qudi/logic/camera_logic.py | 2 +- src/qudi/logic/laser_logic.py | 2 +- src/qudi/logic/nv_calculator_logic.py | 2 +- src/qudi/logic/odmr_logic.py | 2 +- src/qudi/logic/poi_manager_logic.py | 2 +- src/qudi/logic/pulsed/pulsed_master_logic.py | 2 +- src/qudi/logic/pulsed/pulsed_measurement_logic.py | 2 +- src/qudi/logic/pulsed/sequence_generator_logic.py | 2 +- src/qudi/logic/qdplot_logic.py | 2 +- src/qudi/logic/scanning_data_logic.py | 2 +- src/qudi/logic/scanning_optimize_logic.py | 2 +- src/qudi/logic/scanning_probe_logic.py | 2 +- src/qudi/logic/spectrometer_logic.py | 2 +- src/qudi/logic/switch_logic.py | 2 +- src/qudi/logic/time_series_reader_logic.py | 2 +- 58 files changed, 65 insertions(+), 65 deletions(-) diff --git a/docs/module_conversion.md b/docs/module_conversion.md index 582372114..5936431fe 100644 --- a/docs/module_conversion.md +++ b/docs/module_conversion.md @@ -95,7 +95,7 @@ so it keeps track of them and also shows them in the thread view. A simple example for spawning a worker thread and executing a worker method inside this thread. ```Python import time -from PySide2.QtCore import QObject, QThread +from PySide6.QtCore import QObject, QThread from qudi.core.threadmanager import ThreadManager @@ -118,7 +118,7 @@ def run_in_thread(thread_name='MyThread'): thread_manager = ThreadManager.instance() if thread_manager is None: raise RuntimeError('No thread manager found. Qudi application is probably not running.') - # Get a newly spawned thread (PySide2.QtCore.QThread) from the thread manager and give it a name + # Get a newly spawned thread (PySide6.QtCore.QThread) from the thread manager and give it a name my_thread = thread_manager.get_new_thread(thread_name) # Create worker instance and move the worker object to the new thread my_worker = Worker() diff --git a/setup.py b/setup.py index 2cb5b4f5c..be8c4c321 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ 'nidaqmx>=0.5.7', 'numpy>=1.23.3', 'pyqtgraph>=0.13.1', - 'PySide2>=5.15.2', + 'PySide6', 'PyVisa>=1.12.0', 'scipy>=1.9.1', 'zaber_motion>=2.14.6' @@ -30,7 +30,7 @@ 'nidaqmx>=0.5.7', 'numpy>>=1.23.3', 'pyqtgraph>=0.13.1', - 'PySide2>=5.15.2', + 'PySide6', 'PyVisa>=1.12.0', 'scipy>=1.9.1', 'zaber_motion>=2.14.6' diff --git a/src/qudi/gui/camera/camera_settings_dialog.py b/src/qudi/gui/camera/camera_settings_dialog.py index 1f65f3e8d..bdd05b038 100644 --- a/src/qudi/gui/camera/camera_settings_dialog.py +++ b/src/qudi/gui/camera/camera_settings_dialog.py @@ -22,7 +22,7 @@ __all__ = ('CameraSettingsDialog',) -from PySide2 import QtCore, QtWidgets +from PySide6 import QtCore, QtWidgets from qudi.util.widgets.scientific_spinbox import ScienDSpinBox diff --git a/src/qudi/gui/camera/cameragui.py b/src/qudi/gui/camera/cameragui.py index 6418718c4..6a8c8bc94 100644 --- a/src/qudi/gui/camera/cameragui.py +++ b/src/qudi/gui/camera/cameragui.py @@ -20,7 +20,7 @@ """ import os -from PySide2 import QtCore, QtWidgets, QtGui +from PySide6 import QtCore, QtWidgets, QtGui import datetime from qudi.core.module import GuiBase diff --git a/src/qudi/gui/laser/laser_control_dockwidget.py b/src/qudi/gui/laser/laser_control_dockwidget.py index 9db5d6c7a..c3baf7743 100644 --- a/src/qudi/gui/laser/laser_control_dockwidget.py +++ b/src/qudi/gui/laser/laser_control_dockwidget.py @@ -22,7 +22,7 @@ __all__ = ('LaserControlDockWidget',) -from PySide2 import QtCore, QtWidgets +from PySide6 import QtCore, QtWidgets from qudi.util.widgets.scientific_spinbox import ScienDSpinBox from qudi.util.widgets.slider import DoubleSlider diff --git a/src/qudi/gui/laser/laser_gui.py b/src/qudi/gui/laser/laser_gui.py index 2f6308f37..26eb5bc0f 100644 --- a/src/qudi/gui/laser/laser_gui.py +++ b/src/qudi/gui/laser/laser_gui.py @@ -21,7 +21,7 @@ """ import os -from PySide2 import QtCore, QtWidgets, QtGui +from PySide6 import QtCore, QtWidgets, QtGui from qudi.core.connector import Connector from qudi.util.colordefs import QudiPalettePale as palette diff --git a/src/qudi/gui/laser/laser_plot_dockwidgets.py b/src/qudi/gui/laser/laser_plot_dockwidgets.py index ec04d1dac..9c587a51a 100644 --- a/src/qudi/gui/laser/laser_plot_dockwidgets.py +++ b/src/qudi/gui/laser/laser_plot_dockwidgets.py @@ -24,7 +24,7 @@ import time import pyqtgraph as pg -from PySide2 import QtCore +from PySide6 import QtCore from qudi.util.colordefs import QudiPalettePale as palette from qudi.util.widgets.advanced_dockwidget import AdvancedDockWidget diff --git a/src/qudi/gui/laserscanner/laserscannergui.py b/src/qudi/gui/laserscanner/laserscannergui.py index 835c430a4..8eca3daef 100644 --- a/src/qudi/gui/laserscanner/laserscannergui.py +++ b/src/qudi/gui/laserscanner/laserscannergui.py @@ -28,7 +28,7 @@ from qudi.util.colordefs import QudiPalettePale as palette from qudi.core.module import GuiBase from qudi.util.paths import get_artwork_dir -from PySide2 import QtCore, QtWidgets, QtGui +from PySide6 import QtCore, QtWidgets, QtGui from qudi.util.uic import loadUi diff --git a/src/qudi/gui/nv_calculator/nv_calculatorgui.py b/src/qudi/gui/nv_calculator/nv_calculatorgui.py index ad01f8d85..245f96722 100644 --- a/src/qudi/gui/nv_calculator/nv_calculatorgui.py +++ b/src/qudi/gui/nv_calculator/nv_calculatorgui.py @@ -23,7 +23,7 @@ from qudi.core.connector import Connector from qudi.core.module import GuiBase -from PySide2 import QtCore, QtWidgets +from PySide6 import QtCore, QtWidgets from qudi.util import uic diff --git a/src/qudi/gui/odmr/odmr_control_dockwidget.py b/src/qudi/gui/odmr/odmr_control_dockwidget.py index 694fdc1f6..5c13fb759 100644 --- a/src/qudi/gui/odmr/odmr_control_dockwidget.py +++ b/src/qudi/gui/odmr/odmr_control_dockwidget.py @@ -23,7 +23,7 @@ __all__ = ('OdmrCwControlDockWidget', 'OdmrScanControlDockWidget') import numpy as np -from PySide2 import QtCore, QtWidgets, QtGui +from PySide6 import QtCore, QtWidgets, QtGui from qudi.util.widgets.advanced_dockwidget import AdvancedDockWidget from qudi.util.widgets.scientific_spinbox import ScienDSpinBox diff --git a/src/qudi/gui/odmr/odmr_main_window.py b/src/qudi/gui/odmr/odmr_main_window.py index 8b3e802fc..866150bba 100644 --- a/src/qudi/gui/odmr/odmr_main_window.py +++ b/src/qudi/gui/odmr/odmr_main_window.py @@ -23,7 +23,7 @@ import os import datetime -from PySide2 import QtCore, QtWidgets, QtGui +from PySide6 import QtCore, QtWidgets, QtGui from qudi.util.widgets.scientific_spinbox import ScienDSpinBox from qudi.util.paths import get_artwork_dir diff --git a/src/qudi/gui/odmr/odmr_plot_widget.py b/src/qudi/gui/odmr/odmr_plot_widget.py index 8b0f5abc2..cb4085e5d 100644 --- a/src/qudi/gui/odmr/odmr_plot_widget.py +++ b/src/qudi/gui/odmr/odmr_plot_widget.py @@ -23,7 +23,7 @@ __all__ = ('OdmrPlotWidget',) import pyqtgraph as pg -from PySide2 import QtCore, QtWidgets +from PySide6 import QtCore, QtWidgets from qudi.util.widgets.plotting.plot_item import DataImageItem from qudi.util.widgets.plotting.colorbar import ColorBarWidget diff --git a/src/qudi/gui/odmr/odmr_settings_dialog.py b/src/qudi/gui/odmr/odmr_settings_dialog.py index 48d1dede7..4a8009288 100644 --- a/src/qudi/gui/odmr/odmr_settings_dialog.py +++ b/src/qudi/gui/odmr/odmr_settings_dialog.py @@ -23,7 +23,7 @@ __all__ = ('OdmrSettingsDialog',) import numpy as np -from PySide2 import QtCore, QtWidgets +from PySide6 import QtCore, QtWidgets from qudi.util.widgets.scientific_spinbox import ScienDSpinBox from qudi.util.units import ScaledFloat diff --git a/src/qudi/gui/odmr/odmrgui.py b/src/qudi/gui/odmr/odmrgui.py index a6453073a..b69f15edf 100644 --- a/src/qudi/gui/odmr/odmrgui.py +++ b/src/qudi/gui/odmr/odmrgui.py @@ -22,7 +22,7 @@ import os import datetime import numpy as np -from PySide2 import QtCore, QtWidgets, QtGui +from PySide6 import QtCore, QtWidgets, QtGui from qudi.core.connector import Connector from qudi.core.statusvariable import StatusVar diff --git a/src/qudi/gui/pidgui/pidgui.py b/src/qudi/gui/pidgui/pidgui.py index f081e1776..0f4cb6bc2 100644 --- a/src/qudi/gui/pidgui/pidgui.py +++ b/src/qudi/gui/pidgui/pidgui.py @@ -29,7 +29,7 @@ from qudi.util.colordefs import QudiPalettePale as palette from qudi.util.units import create_formatted_output from qudi.core.module import GuiBase -from PySide2 import QtCore, QtWidgets +from PySide6 import QtCore, QtWidgets class PIDMainWindow(QtWidgets.QMainWindow): diff --git a/src/qudi/gui/poimanager/poimanagergui.py b/src/qudi/gui/poimanager/poimanagergui.py index fb6b88626..96366e193 100644 --- a/src/qudi/gui/poimanager/poimanagergui.py +++ b/src/qudi/gui/poimanager/poimanagergui.py @@ -32,7 +32,7 @@ from qudi.core.module import GuiBase from qudi.util.colordefs import QudiPalettePale as palette -from PySide2 import QtCore, QtGui, QtWidgets +from PySide6 import QtCore, QtGui, QtWidgets from qudi.util import uic from qudi.util.widgets.plotting.image_widget import MouseTrackingImageWidget diff --git a/src/qudi/gui/pulsed/pulse_editors.py b/src/qudi/gui/pulsed/pulse_editors.py index 199954d1e..bd6e68af3 100644 --- a/src/qudi/gui/pulsed/pulse_editors.py +++ b/src/qudi/gui/pulsed/pulse_editors.py @@ -22,7 +22,7 @@ import copy from qudi.util.helpers import natural_sort -from PySide2 import QtCore, QtGui, QtWidgets +from PySide6 import QtCore, QtGui, QtWidgets from qudi.gui.pulsed.pulsed_item_delegates import ScienDSpinBoxItemDelegate, ComboBoxItemDelegate from qudi.gui.pulsed.pulsed_item_delegates import MultipleCheckboxItemDelegate, CheckBoxItemDelegate from qudi.gui.pulsed.pulsed_item_delegates import SpinBoxItemDelegate, AnalogParametersItemDelegate diff --git a/src/qudi/gui/pulsed/pulsed_custom_widgets.py b/src/qudi/gui/pulsed/pulsed_custom_widgets.py index 8fb78e47d..9b121eae3 100644 --- a/src/qudi/gui/pulsed/pulsed_custom_widgets.py +++ b/src/qudi/gui/pulsed/pulsed_custom_widgets.py @@ -21,7 +21,7 @@ """ from enum import Enum -from PySide2 import QtCore, QtGui, QtWidgets +from PySide6 import QtCore, QtGui, QtWidgets from qudi.util.widgets.scientific_spinbox import ScienDSpinBox, ScienSpinBox diff --git a/src/qudi/gui/pulsed/pulsed_item_delegates.py b/src/qudi/gui/pulsed/pulsed_item_delegates.py index 01d4dfaa9..033cd7de5 100644 --- a/src/qudi/gui/pulsed/pulsed_item_delegates.py +++ b/src/qudi/gui/pulsed/pulsed_item_delegates.py @@ -21,7 +21,7 @@ """ import numpy as np -from PySide2 import QtCore, QtGui, QtWidgets +from PySide6 import QtCore, QtGui, QtWidgets from qudi.gui.pulsed.pulsed_custom_widgets import MultipleCheckboxWidget, AnalogParametersWidget from qudi.util.widgets.scientific_spinbox import ScienDSpinBox diff --git a/src/qudi/gui/pulsed/pulsed_maingui.py b/src/qudi/gui/pulsed/pulsed_maingui.py index b2c1bd0f7..fa01335c8 100644 --- a/src/qudi/gui/pulsed/pulsed_maingui.py +++ b/src/qudi/gui/pulsed/pulsed_maingui.py @@ -35,7 +35,7 @@ from qudi.util.widgets.fitting import FitConfigurationDialog from qudi.core.module import GuiBase from qudi.util import uic -from PySide2 import QtCore, QtWidgets +from PySide6 import QtCore, QtWidgets from qudi.util.widgets.scientific_spinbox import ScienDSpinBox, ScienSpinBox from qudi.util.widgets.loading_indicator import CircleLoadingIndicator diff --git a/src/qudi/gui/qdplot/main_window.py b/src/qudi/gui/qdplot/main_window.py index 11fe9dce8..3eec854bf 100644 --- a/src/qudi/gui/qdplot/main_window.py +++ b/src/qudi/gui/qdplot/main_window.py @@ -22,7 +22,7 @@ __all__ = ('QDPlotMainWindow',) import os -from PySide2 import QtCore, QtWidgets, QtGui +from PySide6 import QtCore, QtWidgets, QtGui from qudi.util.paths import get_artwork_dir diff --git a/src/qudi/gui/qdplot/plot_widget.py b/src/qudi/gui/qdplot/plot_widget.py index b49830700..a63145535 100644 --- a/src/qudi/gui/qdplot/plot_widget.py +++ b/src/qudi/gui/qdplot/plot_widget.py @@ -23,7 +23,7 @@ __all__ = ['QDPlotDockWidget', 'QDPlotWidget', 'QDPlotControlWidget'] import os -from PySide2 import QtWidgets, QtCore, QtGui +from PySide6 import QtWidgets, QtCore, QtGui from typing import Tuple, Dict, Union, List from qudi.util.paths import get_artwork_dir diff --git a/src/qudi/gui/qdplot/qdplot_gui.py b/src/qudi/gui/qdplot/qdplot_gui.py index c6c1726fb..20c40f5cb 100644 --- a/src/qudi/gui/qdplot/qdplot_gui.py +++ b/src/qudi/gui/qdplot/qdplot_gui.py @@ -26,7 +26,7 @@ from enum import Enum from functools import partial from itertools import cycle -from PySide2 import QtCore, QtGui +from PySide6 import QtCore, QtGui from pyqtgraph import mkColor from typing import Optional, Mapping, Sequence, Union, Tuple, List from lmfit.model import ModelResult as _ModelResult diff --git a/src/qudi/gui/scanning/axes_control_dockwidget.py b/src/qudi/gui/scanning/axes_control_dockwidget.py index 31eaea178..f8398e650 100644 --- a/src/qudi/gui/scanning/axes_control_dockwidget.py +++ b/src/qudi/gui/scanning/axes_control_dockwidget.py @@ -22,7 +22,7 @@ __all__ = ('AxesControlDockWidget', 'AxesControlWidget') -from PySide2 import QtCore, QtGui, QtWidgets +from PySide6 import QtCore, QtGui, QtWidgets from qudi.util.widgets.scientific_spinbox import ScienDSpinBox from qudi.util.widgets.slider import DoubleSlider diff --git a/src/qudi/gui/scanning/optimizer_dockwidget.py b/src/qudi/gui/scanning/optimizer_dockwidget.py index 8fe9510d6..ffaa46cb1 100644 --- a/src/qudi/gui/scanning/optimizer_dockwidget.py +++ b/src/qudi/gui/scanning/optimizer_dockwidget.py @@ -23,7 +23,7 @@ __all__ = ('OptimizerDockWidget',) import numpy as np -from PySide2 import QtCore, QtWidgets +from PySide6 import QtCore, QtWidgets from pyqtgraph import PlotDataItem, mkPen import copy as cp diff --git a/src/qudi/gui/scanning/optimizer_setting_dialog.py b/src/qudi/gui/scanning/optimizer_setting_dialog.py index 004264cb6..bdd91d35e 100644 --- a/src/qudi/gui/scanning/optimizer_setting_dialog.py +++ b/src/qudi/gui/scanning/optimizer_setting_dialog.py @@ -23,7 +23,7 @@ __all__ = ('OptimizerSettingDialog', 'OptimizerSettingWidget', 'OptimizerAxesWidget') import copy as cp -from PySide2 import QtCore, QtGui, QtWidgets +from PySide6 import QtCore, QtGui, QtWidgets from qudi.util.widgets.scientific_spinbox import ScienDSpinBox from qudi.logic.scanning_optimize_logic import OptimizerScanSequence diff --git a/src/qudi/gui/scanning/scan_dockwidget.py b/src/qudi/gui/scanning/scan_dockwidget.py index 91d9681d3..cdfd72b20 100644 --- a/src/qudi/gui/scanning/scan_dockwidget.py +++ b/src/qudi/gui/scanning/scan_dockwidget.py @@ -22,7 +22,7 @@ __all__ = ['ScanDockWidget'] -from PySide2 import QtWidgets +from PySide6 import QtWidgets from typing import Optional, Tuple, Sequence, Union from qudi.gui.scanning.scan_widget import Scan2DWidget, Scan1DWidget from qudi.interface.scanning_probe_interface import ScannerAxis, ScannerChannel diff --git a/src/qudi/gui/scanning/scan_settings_dialog.py b/src/qudi/gui/scanning/scan_settings_dialog.py index 3252d7264..4b522aea5 100644 --- a/src/qudi/gui/scanning/scan_settings_dialog.py +++ b/src/qudi/gui/scanning/scan_settings_dialog.py @@ -23,7 +23,7 @@ __all__ = ('ScannerSettingDialog', 'ScannerSettingsWidget') -from PySide2 import QtCore, QtGui, QtWidgets +from PySide6 import QtCore, QtGui, QtWidgets from qudi.util.widgets.scientific_spinbox import ScienDSpinBox diff --git a/src/qudi/gui/scanning/scan_widget.py b/src/qudi/gui/scanning/scan_widget.py index c3dddb4e6..75bb784a4 100644 --- a/src/qudi/gui/scanning/scan_widget.py +++ b/src/qudi/gui/scanning/scan_widget.py @@ -25,7 +25,7 @@ import os import numpy as np from typing import Tuple, Union, Sequence -from PySide2 import QtCore, QtWidgets, QtGui +from PySide6 import QtCore, QtWidgets, QtGui from typing import Optional, List from qudi.util.widgets.plotting.plot_widget import RubberbandZoomSelectionPlotWidget from qudi.util.widgets.plotting.image_widget import RubberbandZoomSelectionImageWidget diff --git a/src/qudi/gui/scanning/scannergui.py b/src/qudi/gui/scanning/scannergui.py index 1f3a6460a..1c63e3ec5 100644 --- a/src/qudi/gui/scanning/scannergui.py +++ b/src/qudi/gui/scanning/scannergui.py @@ -25,7 +25,7 @@ import copy as cp from typing import Union, Tuple from functools import partial -from PySide2 import QtCore, QtGui, QtWidgets +from PySide6 import QtCore, QtGui, QtWidgets import qudi.util.uic as uic from qudi.core.connector import Connector diff --git a/src/qudi/gui/spectrometer/control_widget.py b/src/qudi/gui/spectrometer/control_widget.py index 933dce093..6fe024b11 100644 --- a/src/qudi/gui/spectrometer/control_widget.py +++ b/src/qudi/gui/spectrometer/control_widget.py @@ -21,8 +21,8 @@ __all__ = ['SpectrometerControlWidget'] -from PySide2 import QtCore -from PySide2 import QtWidgets +from PySide6 import QtCore +from PySide6 import QtWidgets from qudi.util.widgets.toggle_switch import ToggleSwitch diff --git a/src/qudi/gui/spectrometer/data_widget.py b/src/qudi/gui/spectrometer/data_widget.py index b7876b8f9..761436581 100644 --- a/src/qudi/gui/spectrometer/data_widget.py +++ b/src/qudi/gui/spectrometer/data_widget.py @@ -22,8 +22,8 @@ __all__ = ['SpectrometerDataWidget'] import pyqtgraph as pg -from PySide2 import QtCore -from PySide2 import QtWidgets +from PySide6 import QtCore +from PySide6 import QtWidgets from qudi.util.colordefs import QudiPalettePale as palette from qudi.util.widgets.toggle_switch import ToggleSwitch diff --git a/src/qudi/gui/spectrometer/settingsdialog.py b/src/qudi/gui/spectrometer/settingsdialog.py index 63b1efc6f..2f2b8d843 100644 --- a/src/qudi/gui/spectrometer/settingsdialog.py +++ b/src/qudi/gui/spectrometer/settingsdialog.py @@ -20,7 +20,7 @@ If not, see . """ -from PySide2 import QtCore, QtWidgets +from PySide6 import QtCore, QtWidgets from qudi.util.widgets.scientific_spinbox import ScienDSpinBox, ScienSpinBox from qudi.util.widgets.toggle_switch import ToggleSwitch diff --git a/src/qudi/gui/spectrometer/spectrometer_gui.py b/src/qudi/gui/spectrometer/spectrometer_gui.py index 3a0a647a5..1fb1454ab 100644 --- a/src/qudi/gui/spectrometer/spectrometer_gui.py +++ b/src/qudi/gui/spectrometer/spectrometer_gui.py @@ -23,7 +23,7 @@ import importlib from time import perf_counter -from PySide2 import QtCore +from PySide6 import QtCore from qudi.core.module import GuiBase from qudi.core.connector import Connector diff --git a/src/qudi/gui/spectrometer/spectrometer_window.py b/src/qudi/gui/spectrometer/spectrometer_window.py index d778dd844..197a38dbe 100644 --- a/src/qudi/gui/spectrometer/spectrometer_window.py +++ b/src/qudi/gui/spectrometer/spectrometer_window.py @@ -23,9 +23,9 @@ import os import importlib -from PySide2 import QtCore -from PySide2 import QtWidgets -from PySide2 import QtGui +from PySide6 import QtCore +from PySide6 import QtWidgets +from PySide6 import QtGui from qudi.util.paths import get_artwork_dir from qudi.util.widgets.advanced_dockwidget import AdvancedDockWidget diff --git a/src/qudi/gui/switch/switch_gui.py b/src/qudi/gui/switch/switch_gui.py index 410f78622..bf956bc61 100644 --- a/src/qudi/gui/switch/switch_gui.py +++ b/src/qudi/gui/switch/switch_gui.py @@ -20,7 +20,7 @@ """ from enum import IntEnum -from PySide2 import QtWidgets, QtCore, QtGui +from PySide6 import QtWidgets, QtCore, QtGui from qudi.core.connector import Connector from qudi.core.statusvariable import StatusVar diff --git a/src/qudi/gui/switch/switch_state_widgets.py b/src/qudi/gui/switch/switch_state_widgets.py index 66220cd4e..7897fc80f 100644 --- a/src/qudi/gui/switch/switch_state_widgets.py +++ b/src/qudi/gui/switch/switch_state_widgets.py @@ -19,7 +19,7 @@ If not, see . """ -from PySide2 import QtWidgets, QtCore, QtGui +from PySide6 import QtWidgets, QtCore, QtGui from qudi.util.widgets.toggle_switch import ToggleSwitch diff --git a/src/qudi/gui/time_series/time_series_gui.py b/src/qudi/gui/time_series/time_series_gui.py index 86c63bb77..2bccfd27f 100644 --- a/src/qudi/gui/time_series/time_series_gui.py +++ b/src/qudi/gui/time_series/time_series_gui.py @@ -22,7 +22,7 @@ import os import pyqtgraph as pg -from PySide2 import QtCore, QtWidgets +from PySide6 import QtCore, QtWidgets from qudi.core.statusvariable import StatusVar from qudi.util.uic import loadUi diff --git a/src/qudi/gui/wavemeter/wavemeterloggui.py b/src/qudi/gui/wavemeter/wavemeterloggui.py index 177178dcd..11ba156c8 100644 --- a/src/qudi/gui/wavemeter/wavemeterloggui.py +++ b/src/qudi/gui/wavemeter/wavemeterloggui.py @@ -31,7 +31,7 @@ from qudi.core.module import GuiBase from qudi.util.colordefs import QudiPalettePale as palette from qudi.util.widgets.fitting import FitConfigurationDialog -from PySide2 import QtCore, QtWidgets, QtGui +from PySide6 import QtCore, QtWidgets, QtGui from qudi.util.uic import loadUi diff --git a/src/qudi/hardware/dummy/finite_sampling_output_dummy.py b/src/qudi/hardware/dummy/finite_sampling_output_dummy.py index 91e5f952d..5ababf263 100644 --- a/src/qudi/hardware/dummy/finite_sampling_output_dummy.py +++ b/src/qudi/hardware/dummy/finite_sampling_output_dummy.py @@ -23,7 +23,7 @@ import time import numpy as np -from PySide2.QtCore import QTimer +from PySide6.QtCore import QTimer from qudi.interface.finite_sampling_output_interface import FiniteSamplingOutputInterface from qudi.interface.finite_sampling_output_interface import FiniteSamplingOutputConstraints from qudi.util.mutex import RecursiveMutex diff --git a/src/qudi/hardware/dummy/scanning_probe_dummy.py b/src/qudi/hardware/dummy/scanning_probe_dummy.py index 38da20f8f..9f24c7e37 100644 --- a/src/qudi/hardware/dummy/scanning_probe_dummy.py +++ b/src/qudi/hardware/dummy/scanning_probe_dummy.py @@ -21,7 +21,7 @@ import time import numpy as np -from PySide2 import QtCore +from PySide6 import QtCore from fysom import FysomError from qudi.core.configoption import ConfigOption from qudi.util.mutex import RecursiveMutex diff --git a/src/qudi/hardware/dummy/wavemeter_dummy.py b/src/qudi/hardware/dummy/wavemeter_dummy.py index 6f7a1c965..00f51c40f 100644 --- a/src/qudi/hardware/dummy/wavemeter_dummy.py +++ b/src/qudi/hardware/dummy/wavemeter_dummy.py @@ -22,7 +22,7 @@ """ import random -from PySide2 import QtCore +from PySide6 import QtCore from qudi.core.module import Base from qudi.core.configoption import ConfigOption diff --git a/src/qudi/hardware/interfuse/ni_scanning_probe_interfuse.py b/src/qudi/hardware/interfuse/ni_scanning_probe_interfuse.py index 0bf01fdf4..bd39aa1f1 100644 --- a/src/qudi/hardware/interfuse/ni_scanning_probe_interfuse.py +++ b/src/qudi/hardware/interfuse/ni_scanning_probe_interfuse.py @@ -24,8 +24,8 @@ import numpy as np import time -from PySide2 import QtCore -from PySide2.QtGui import QGuiApplication +from PySide6 import QtCore +from PySide6.QtGui import QGuiApplication from qudi.interface.scanning_probe_interface import ScanningProbeInterface, ScanConstraints, \ ScannerAxis, ScannerChannel, ScanData diff --git a/src/qudi/logic/camera_logic.py b/src/qudi/logic/camera_logic.py index 63ea3e7e7..02e4e5872 100644 --- a/src/qudi/logic/camera_logic.py +++ b/src/qudi/logic/camera_logic.py @@ -24,7 +24,7 @@ import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl -from PySide2 import QtCore +from PySide6 import QtCore from qudi.core.connector import Connector from qudi.core.configoption import ConfigOption from qudi.util.mutex import RecursiveMutex diff --git a/src/qudi/logic/laser_logic.py b/src/qudi/logic/laser_logic.py index 53c4f7922..7ce9640fc 100644 --- a/src/qudi/logic/laser_logic.py +++ b/src/qudi/logic/laser_logic.py @@ -22,7 +22,7 @@ import time import numpy as np -from PySide2 import QtCore +from PySide6 import QtCore from qudi.util.mutex import RecursiveMutex from qudi.core.connector import Connector diff --git a/src/qudi/logic/nv_calculator_logic.py b/src/qudi/logic/nv_calculator_logic.py index bf18274e5..3b2536a26 100644 --- a/src/qudi/logic/nv_calculator_logic.py +++ b/src/qudi/logic/nv_calculator_logic.py @@ -20,7 +20,7 @@ If not, see . """ -from PySide2 import QtCore +from PySide6 import QtCore import numpy as np from qudi.core.module import LogicBase diff --git a/src/qudi/logic/odmr_logic.py b/src/qudi/logic/odmr_logic.py index 45b638fc7..d9426d8ee 100644 --- a/src/qudi/logic/odmr_logic.py +++ b/src/qudi/logic/odmr_logic.py @@ -24,7 +24,7 @@ import time import datetime import matplotlib.pyplot as plt -from PySide2 import QtCore +from PySide6 import QtCore from qudi.util.datafitting import FitContainer, FitConfigurationsModel from qudi.core.module import LogicBase diff --git a/src/qudi/logic/poi_manager_logic.py b/src/qudi/logic/poi_manager_logic.py index 7d3c6e135..e464b40fd 100644 --- a/src/qudi/logic/poi_manager_logic.py +++ b/src/qudi/logic/poi_manager_logic.py @@ -30,7 +30,7 @@ import time from datetime import datetime from collections import OrderedDict -from PySide2 import QtCore +from PySide6 import QtCore from qudi.core.module import LogicBase from qudi.core.connector import Connector diff --git a/src/qudi/logic/pulsed/pulsed_master_logic.py b/src/qudi/logic/pulsed/pulsed_master_logic.py index 109c1297d..9c81e4a5b 100644 --- a/src/qudi/logic/pulsed/pulsed_master_logic.py +++ b/src/qudi/logic/pulsed/pulsed_master_logic.py @@ -21,7 +21,7 @@ """ import numpy as np -from PySide2 import QtCore +from PySide6 import QtCore from qudi.core.connector import Connector from qudi.core.module import LogicBase diff --git a/src/qudi/logic/pulsed/pulsed_measurement_logic.py b/src/qudi/logic/pulsed/pulsed_measurement_logic.py index f49a351da..c555e3ab1 100644 --- a/src/qudi/logic/pulsed/pulsed_measurement_logic.py +++ b/src/qudi/logic/pulsed/pulsed_measurement_logic.py @@ -20,7 +20,7 @@ """ import os.path -from PySide2 import QtCore +from PySide6 import QtCore import numpy as np import time import datetime diff --git a/src/qudi/logic/pulsed/sequence_generator_logic.py b/src/qudi/logic/pulsed/sequence_generator_logic.py index d6295af36..5785256da 100644 --- a/src/qudi/logic/pulsed/sequence_generator_logic.py +++ b/src/qudi/logic/pulsed/sequence_generator_logic.py @@ -29,7 +29,7 @@ import datetime import re -from PySide2 import QtCore +from PySide6 import QtCore from qudi.core.statusvariable import StatusVar from qudi.core.connector import Connector from qudi.core.configoption import ConfigOption diff --git a/src/qudi/logic/qdplot_logic.py b/src/qudi/logic/qdplot_logic.py index 352144b85..5062faf50 100644 --- a/src/qudi/logic/qdplot_logic.py +++ b/src/qudi/logic/qdplot_logic.py @@ -23,7 +23,7 @@ import numpy as np import matplotlib.pyplot as plt -from PySide2 import QtCore +from PySide6 import QtCore from lmfit.model import ModelResult as _ModelResult from typing import Tuple, Optional, Sequence, Union, List, Dict, Any, Mapping from collections.abc import MutableMapping diff --git a/src/qudi/logic/scanning_data_logic.py b/src/qudi/logic/scanning_data_logic.py index 89faa3b8b..19bdeba0c 100644 --- a/src/qudi/logic/scanning_data_logic.py +++ b/src/qudi/logic/scanning_data_logic.py @@ -30,7 +30,7 @@ import matplotlib as mpl import matplotlib.pyplot as plt -from PySide2 import QtCore +from PySide6 import QtCore from qudi.core.module import LogicBase from qudi.util.mutex import RecursiveMutex diff --git a/src/qudi/logic/scanning_optimize_logic.py b/src/qudi/logic/scanning_optimize_logic.py index df8474f96..afc5c6629 100644 --- a/src/qudi/logic/scanning_optimize_logic.py +++ b/src/qudi/logic/scanning_optimize_logic.py @@ -22,7 +22,7 @@ import numpy as np -from PySide2 import QtCore +from PySide6 import QtCore import itertools import copy as cp diff --git a/src/qudi/logic/scanning_probe_logic.py b/src/qudi/logic/scanning_probe_logic.py index a5090757d..f1cd58284 100644 --- a/src/qudi/logic/scanning_probe_logic.py +++ b/src/qudi/logic/scanning_probe_logic.py @@ -20,7 +20,7 @@ If not, see . """ -from PySide2 import QtCore +from PySide6 import QtCore import copy as cp import numpy as np diff --git a/src/qudi/logic/spectrometer_logic.py b/src/qudi/logic/spectrometer_logic.py index 71ac6299e..8367729b4 100644 --- a/src/qudi/logic/spectrometer_logic.py +++ b/src/qudi/logic/spectrometer_logic.py @@ -19,7 +19,7 @@ If not, see . """ -from PySide2 import QtCore +from PySide6 import QtCore import numpy as np import matplotlib.pyplot as plt from datetime import datetime diff --git a/src/qudi/logic/switch_logic.py b/src/qudi/logic/switch_logic.py index d0c5d62a8..10b898e32 100644 --- a/src/qudi/logic/switch_logic.py +++ b/src/qudi/logic/switch_logic.py @@ -19,7 +19,7 @@ If not, see . """ -from PySide2 import QtCore +from PySide6 import QtCore from qudi.core.module import LogicBase from qudi.core.connector import Connector diff --git a/src/qudi/logic/time_series_reader_logic.py b/src/qudi/logic/time_series_reader_logic.py index d06135986..cf9c9045a 100644 --- a/src/qudi/logic/time_series_reader_logic.py +++ b/src/qudi/logic/time_series_reader_logic.py @@ -19,7 +19,7 @@ If not, see . """ -from PySide2 import QtCore +from PySide6 import QtCore import numpy as np import datetime as dt # import matplotlib.pyplot as plt From f9f16d34195a63d3f387be047044122ae7707fad Mon Sep 17 00:00:00 2001 From: qku Date: Sun, 29 Jan 2023 21:52:26 +0100 Subject: [PATCH 2/3] add pyside6 compatibility --- src/qudi/gui/camera/cameragui.py | 10 +++++----- src/qudi/gui/laser/laser_gui.py | 14 ++++++-------- src/qudi/gui/odmr/odmr_control_dockwidget.py | 4 ++-- src/qudi/gui/odmr/odmr_fit_dockwidget.py | 3 ++- src/qudi/gui/odmr/odmr_main_window.py | 18 +++++++++--------- src/qudi/gui/poimanager/poimanagergui.py | 10 +++++----- src/qudi/gui/qdplot/main_window.py | 14 +++++++------- src/qudi/gui/qdplot/plot_widget.py | 2 +- src/qudi/gui/spectrometer/settingsdialog.py | 2 +- .../gui/spectrometer/spectrometer_window.py | 14 +++++++------- src/qudi/gui/switch/switch_gui.py | 14 +++++++------- 11 files changed, 52 insertions(+), 53 deletions(-) diff --git a/src/qudi/gui/camera/cameragui.py b/src/qudi/gui/camera/cameragui.py index 6a8c8bc94..e07aa8786 100644 --- a/src/qudi/gui/camera/cameragui.py +++ b/src/qudi/gui/camera/cameragui.py @@ -40,17 +40,17 @@ def __init__(self, *args, **kwargs): # Create menu bar menu_bar = QtWidgets.QMenuBar() menu = menu_bar.addMenu('File') - self.action_save_frame = QtWidgets.QAction('Save Frame') + self.action_save_frame = QtGui.QAction('Save Frame') path = os.path.join(get_artwork_dir(), 'icons', 'document-save') self.action_save_frame.setIcon(QtGui.QIcon(path)) menu.addAction(self.action_save_frame) menu.addSeparator() - self.action_show_settings = QtWidgets.QAction('Settings') + self.action_show_settings = QtGui.QAction('Settings') path = os.path.join(get_artwork_dir(), 'icons', 'configure') self.action_show_settings.setIcon(QtGui.QIcon(path)) menu.addAction(self.action_show_settings) menu.addSeparator() - self.action_close = QtWidgets.QAction('Close') + self.action_close = QtGui.QAction('Close') path = os.path.join(get_artwork_dir(), 'icons', 'application-exit') self.action_close.setIcon(QtGui.QIcon(path)) self.action_close.triggered.connect(self.close) @@ -60,10 +60,10 @@ def __init__(self, *args, **kwargs): # Create toolbar toolbar = QtWidgets.QToolBar() toolbar.setAllowedAreas(QtCore.Qt.AllToolBarAreas) - self.action_start_video = QtWidgets.QAction('Start Video') + self.action_start_video = QtGui.QAction('Start Video') self.action_start_video.setCheckable(True) toolbar.addAction(self.action_start_video) - self.action_capture_frame = QtWidgets.QAction('Capture Frame') + self.action_capture_frame = QtGui.QAction('Capture Frame') self.action_capture_frame.setCheckable(True) toolbar.addAction(self.action_capture_frame) self.addToolBar(QtCore.Qt.TopToolBarArea, toolbar) diff --git a/src/qudi/gui/laser/laser_gui.py b/src/qudi/gui/laser/laser_gui.py index 26eb5bc0f..a8d61fdf1 100644 --- a/src/qudi/gui/laser/laser_gui.py +++ b/src/qudi/gui/laser/laser_gui.py @@ -52,34 +52,34 @@ def __init__(self, *args, **kwargs): layout.addWidget(self.extra_info_label) layout.addWidget(extra_info_button_box) self.extra_info_dialog.setLayout(layout) - layout.setSizeConstraint(layout.SetFixedSize) + layout.setSizeConstraint(QtWidgets.QLayout.SetFixedSize) # create menu bar and actions menu_bar = QtWidgets.QMenuBar(self) self.setMenuBar(menu_bar) menu = menu_bar.addMenu('File') - self.action_close = QtWidgets.QAction('Close') + self.action_close = QtGui.QAction('Close') path = os.path.join(get_artwork_dir(), 'icons', 'application-exit') self.action_close.setIcon(QtGui.QIcon(path)) self.action_close.triggered.connect(self.close) menu.addAction(self.action_close) menu = menu_bar.addMenu('View') - self.action_view_controls = QtWidgets.QAction('Show Controls') + self.action_view_controls = QtGui.QAction('Show Controls') self.action_view_controls.setCheckable(True) self.action_view_controls.setChecked(True) menu.addAction(self.action_view_controls) - self.action_view_output_graph = QtWidgets.QAction('Show Output Graph') + self.action_view_output_graph = QtGui.QAction('Show Output Graph') self.action_view_output_graph.setCheckable(True) self.action_view_output_graph.setChecked(True) menu.addAction(self.action_view_output_graph) - self.action_view_temperature_graph = QtWidgets.QAction('Show Temperature Graph') + self.action_view_temperature_graph = QtGui.QAction('Show Temperature Graph') self.action_view_temperature_graph.setCheckable(True) self.action_view_temperature_graph.setChecked(True) menu.addAction(self.action_view_temperature_graph) menu.addSeparator() - self.action_view_default = QtWidgets.QAction('Restore Default') + self.action_view_default = QtGui.QAction('Restore Default') menu.addAction(self.action_view_default) # Create status bar @@ -187,7 +187,6 @@ def on_activate(self): self.control_dock_widget.current_spinbox.setSuffix(logic.current_unit) self.output_graph_dock_widget = LaserOutputDockWidget() - self.output_graph_dock_widget.setFeatures(QtWidgets.QDockWidget.AllDockWidgetFeatures) self.output_graph_dock_widget.setAllowedAreas(QtCore.Qt.AllDockWidgetAreas) self._mw.addDockWidget(QtCore.Qt.RightDockWidgetArea, self.output_graph_dock_widget) self.output_graph_dock_widget.visibilityChanged.connect( @@ -204,7 +203,6 @@ def on_activate(self): self.temperature_graph_dock_widget = LaserTemperatureDockWidget( curve_names=tuple(logic.temperatures) ) - self.temperature_graph_dock_widget.setFeatures(QtWidgets.QDockWidget.AllDockWidgetFeatures) self.temperature_graph_dock_widget.setAllowedAreas(QtCore.Qt.AllDockWidgetAreas) self._mw.addDockWidget(QtCore.Qt.RightDockWidgetArea, self.temperature_graph_dock_widget) self.temperature_graph_dock_widget.visibilityChanged.connect( diff --git a/src/qudi/gui/odmr/odmr_control_dockwidget.py b/src/qudi/gui/odmr/odmr_control_dockwidget.py index 5c13fb759..264d1ef60 100644 --- a/src/qudi/gui/odmr/odmr_control_dockwidget.py +++ b/src/qudi/gui/odmr/odmr_control_dockwidget.py @@ -116,7 +116,7 @@ class OdmrScanControlDockWidget(AdvancedDockWidget): def __init__(self, *args, power_range=None, frequency_range=None, data_channels=None, points_range=None, **kwargs): super().__init__(*args, **kwargs) self.setWindowTitle('ODMR Scan Control') - self.setFeatures(self.DockWidgetFloatable | self.DockWidgetMovable) + self.setFeatures(QtWidgets.QDockWidget.DockWidgetFloatable | QtWidgets.QDockWidget.DockWidgetMovable) # Determine minimal spinbox width from current default metrics self._min_spinbox_width = QtGui.QFontMetrics(ScienDSpinBox().font()).width( @@ -167,7 +167,7 @@ def __init__(self, *args, power_range=None, frequency_range=None, data_channels= h_layout.addWidget(self.scan_power_spinbox) layout.addLayout(h_layout) frame = QtWidgets.QFrame() - frame.setFrameShape(frame.HLine) + frame.setFrameShape(QtWidgets.QFrame.HLine) layout.addWidget(frame) self._ranges_layout = QtWidgets.QGridLayout() self._ranges_layout.setContentsMargins(0, 0, 0, 0) diff --git a/src/qudi/gui/odmr/odmr_fit_dockwidget.py b/src/qudi/gui/odmr/odmr_fit_dockwidget.py index 4a91ee7e7..946f561a4 100644 --- a/src/qudi/gui/odmr/odmr_fit_dockwidget.py +++ b/src/qudi/gui/odmr/odmr_fit_dockwidget.py @@ -22,6 +22,7 @@ __all__ = ('OdmrFitDockWidget',) +from PySide6 import QtWidgets from qudi.util.widgets.advanced_dockwidget import AdvancedDockWidget from qudi.util.widgets.fitting import FitWidget @@ -33,7 +34,7 @@ class OdmrFitDockWidget(AdvancedDockWidget): def __init__(self, *args, fit_container=None, **kwargs): super().__init__(*args, **kwargs) self.setWindowTitle('ODMR Fit') - self.setFeatures(self.DockWidgetFloatable | self.DockWidgetMovable) + self.setFeatures(QtWidgets.QDockWidget.DockWidgetFloatable | QtWidgets.QDockWidget.DockWidgetMovable) self.fit_widget = FitWidget(fit_container=fit_container) self.setWidget(self.fit_widget) diff --git a/src/qudi/gui/odmr/odmr_main_window.py b/src/qudi/gui/odmr/odmr_main_window.py index 866150bba..954be25cc 100644 --- a/src/qudi/gui/odmr/odmr_main_window.py +++ b/src/qudi/gui/odmr/odmr_main_window.py @@ -50,18 +50,18 @@ def __init__(self, *args, **kwargs): icon = QtGui.QIcon(os.path.join(icon_path, 'start-counter')) icon.addFile(os.path.join(icon_path, 'stop-counter'), state=QtGui.QIcon.On) - self.action_toggle_measurement = QtWidgets.QAction('Toggle Measurement') + self.action_toggle_measurement = QtGui.QAction('Toggle Measurement') self.action_toggle_measurement.setCheckable(True) self.action_toggle_measurement.setIcon(icon) self.action_toggle_measurement.setToolTip('Start/Stop ODMR scan measurement') icon = QtGui.QIcon(os.path.join(icon_path, 'restart-counter')) - self.action_resume_measurement = QtWidgets.QAction('Resume Measurement') + self.action_resume_measurement = QtGui.QAction('Resume Measurement') self.action_resume_measurement.setIcon(icon) self.action_resume_measurement.setToolTip('Resume ODMR scan measurement') icon = QtGui.QIcon(os.path.join(icon_path, 'document-save')) - self.action_save_measurement = QtWidgets.QAction('Save Measurement') + self.action_save_measurement = QtGui.QAction('Save Measurement') self.action_save_measurement.setIcon(icon) self.action_save_measurement.setToolTip( 'Save ODMR scan measurement.\n' @@ -69,31 +69,31 @@ def __init__(self, *args, **kwargs): ) icon = QtGui.QIcon(os.path.join(icon_path, 'dialog-warning')) - self.action_toggle_cw = QtWidgets.QAction('Toggle CW') + self.action_toggle_cw = QtGui.QAction('Toggle CW') self.action_toggle_cw.setCheckable(True) self.action_toggle_cw.setIcon(icon) self.action_toggle_cw.setToolTip('Toggle continuous microwave output.\n' 'WARNING: Ensure RF network can handle CW power.') icon = QtGui.QIcon(os.path.join(icon_path, 'application-exit')) - self.action_close = QtWidgets.QAction('Close') + self.action_close = QtGui.QAction('Close') self.action_close.setIcon(icon) - self.action_show_cw_controls = QtWidgets.QAction('Show CW Controls') + self.action_show_cw_controls = QtGui.QAction('Show CW Controls') self.action_show_cw_controls.setCheckable(True) self.action_show_cw_controls.setChecked(True) self.action_show_cw_controls.setToolTip('Show/Hide CW controls') - self.action_restore_default_view = QtWidgets.QAction('Restore Default') + self.action_restore_default_view = QtGui.QAction('Restore Default') icon = QtGui.QIcon(os.path.join(icon_path, 'configure')) - self.action_show_odmr_settings = QtWidgets.QAction('ODMR Settings') + self.action_show_odmr_settings = QtGui.QAction('ODMR Settings') self.action_show_odmr_settings.setToolTip( 'Open a dialog to edit ODMR settings that are not very frequently used.' ) self.action_show_odmr_settings.setIcon(icon) - self.action_show_fit_configuration = QtWidgets.QAction('Fit Configuration') + self.action_show_fit_configuration = QtGui.QAction('Fit Configuration') self.action_show_fit_configuration.setToolTip( 'Open a dialog to edit data fitting configurations available to ODMR.' ) diff --git a/src/qudi/gui/poimanager/poimanagergui.py b/src/qudi/gui/poimanager/poimanagergui.py index 96366e193..5ed5a8f82 100644 --- a/src/qudi/gui/poimanager/poimanagergui.py +++ b/src/qudi/gui/poimanager/poimanagergui.py @@ -201,19 +201,19 @@ def validate(self, string, position): # Return intermediate status when empty string is passed if not string: if self._empty_allowed: - return self.Acceptable, '', position + return QtGui.QValidator.Acceptable, '', position else: - return self.Intermediate, string, position + return QtGui.QValidator.Intermediate, string, position match = self.name_re.match(string) if not match: - return self.Invalid, '', position + return QtGui.QValidator.Invalid, '', position matched = match.group() if matched == string: - return self.Acceptable, string, position + return QtGui.QValidator.Acceptable, string, position - return self.Invalid, matched, position + return QtGui.QValidator.Invalid, matched, position def fixup(self, text): match = self.name_re.search(text) diff --git a/src/qudi/gui/qdplot/main_window.py b/src/qudi/gui/qdplot/main_window.py index 3eec854bf..9124fb777 100644 --- a/src/qudi/gui/qdplot/main_window.py +++ b/src/qudi/gui/qdplot/main_window.py @@ -45,34 +45,34 @@ def __init__(self, *args, **kwargs): icon_path = os.path.join(get_artwork_dir(), 'icons') icon = QtGui.QIcon(os.path.join(icon_path, 'application-exit')) - self.action_close = QtWidgets.QAction('Close') + self.action_close = QtGui.QAction('Close') self.action_close.setIcon(icon) icon = QtGui.QIcon(os.path.join(icon_path, 'document-save')) - self.action_save_all = QtWidgets.QAction('Save All') + self.action_save_all = QtGui.QAction('Save All') self.action_save_all.setToolTip('Save all available plots, each in their own file.') self.action_save_all.setIcon(icon) icon = QtGui.QIcon(os.path.join(icon_path, 'configure')) - self.action_show_fit_configuration = QtWidgets.QAction('Fit Configuration') + self.action_show_fit_configuration = QtGui.QAction('Fit Configuration') self.action_show_fit_configuration.setToolTip('Open a dialog to edit data fitting configurations.') self.action_show_fit_configuration.setIcon(icon) icon = QtGui.QIcon(os.path.join(icon_path, 'document-new')) - self.action_new_plot = QtWidgets.QAction('New Plot') + self.action_new_plot = QtGui.QAction('New Plot') self.action_new_plot.setToolTip('Adds another DockWidget for a new Plot.') self.action_new_plot.setIcon(icon) icon = QtGui.QIcon(os.path.join(icon_path, 'zoom-fit-best')) - self.action_restore_tabbed_view = QtWidgets.QAction('Restore tabbed view') + self.action_restore_tabbed_view = QtGui.QAction('Restore tabbed view') self.action_restore_tabbed_view.setToolTip('Restore the tabbed view of the DockWidgets for the plots.') self.action_restore_tabbed_view.setIcon(icon) - self.action_restore_side_by_side_view = QtWidgets.QAction('Restore side by side view') + self.action_restore_side_by_side_view = QtGui.QAction('Restore side by side view') self.action_restore_side_by_side_view.setToolTip('Restore the side by side of the DockWidgets for the plots.') self.action_restore_side_by_side_view.setIcon(icon) - self.action_restore_arced_view = QtWidgets.QAction('Restore arced view') + self.action_restore_arced_view = QtGui.QAction('Restore arced view') self.action_restore_arced_view.setToolTip('Restore the arced view of the DockWidgets for the plots.') self.action_restore_arced_view.setIcon(icon) diff --git a/src/qudi/gui/qdplot/plot_widget.py b/src/qudi/gui/qdplot/plot_widget.py index a63145535..b69236a2b 100644 --- a/src/qudi/gui/qdplot/plot_widget.py +++ b/src/qudi/gui/qdplot/plot_widget.py @@ -281,7 +281,7 @@ class QDPlotDockWidget(AdvancedDockWidget): def __init__(self, *args, plot_number=0, fit_container=None, **kwargs): super().__init__(*args, **kwargs) self.setWindowTitle(f'Plot {plot_number:d}') - self.setFeatures(self.DockWidgetFloatable | self.DockWidgetMovable) + self.setFeatures(QtWidgets.QDockWidget.DockWidgetFloatable | QtWidgets.QDockWidget.DockWidgetMovable) widget = QDPlotWidget(fit_container=fit_container) self.setWidget(widget) diff --git a/src/qudi/gui/spectrometer/settingsdialog.py b/src/qudi/gui/spectrometer/settingsdialog.py index 2f2b8d843..57307721f 100644 --- a/src/qudi/gui/spectrometer/settingsdialog.py +++ b/src/qudi/gui/spectrometer/settingsdialog.py @@ -72,4 +72,4 @@ def __init__(self, parent=None, **kwargs): # Add internal signals buttonbox.accepted.connect(self.accept) buttonbox.rejected.connect(self.reject) - buttonbox.button(buttonbox.Apply).clicked.connect(self.accepted) + buttonbox.button(QtWidgets.QDialogButtonBox.Apply).clicked.connect(self.accepted) diff --git a/src/qudi/gui/spectrometer/spectrometer_window.py b/src/qudi/gui/spectrometer/spectrometer_window.py index 197a38dbe..1f75242f2 100644 --- a/src/qudi/gui/spectrometer/spectrometer_window.py +++ b/src/qudi/gui/spectrometer/spectrometer_window.py @@ -69,37 +69,37 @@ def __init__(self, *args, **kwargs): # Create QActions close_icon = QtGui.QIcon(os.path.join(icon_path, 'application-exit')) - self.action_close = QtWidgets.QAction(icon=close_icon, text='Close Window', parent=self) + self.action_close = QtGui.QAction(icon=close_icon, text='Close Window', parent=self) restore_icon = QtGui.QIcon(os.path.join(icon_path, 'view-refresh')) - self.action_restore_view = QtWidgets.QAction(icon=restore_icon, text='Restore', parent=self) + self.action_restore_view = QtGui.QAction(icon=restore_icon, text='Restore', parent=self) self.action_restore_view.setToolTip('Restore the view to the default.') spec_setting_icon = QtGui.QIcon(os.path.join(icon_path, 'utilities-terminal')) - self.action_spectrometer_settings = QtWidgets.QAction(icon=spec_setting_icon, + self.action_spectrometer_settings = QtGui.QAction(icon=spec_setting_icon, text='Show Spectrometer Settings', parent=self) self.action_spectrometer_settings.setToolTip('Show the Spectrometer Settings.') fit_settings_icon = QtGui.QIcon(os.path.join(icon_path, 'configure')) - self.action_show_fit_settings = QtWidgets.QAction(icon=fit_settings_icon, + self.action_show_fit_settings = QtGui.QAction(icon=fit_settings_icon, text='Show Fit Settings', parent=self) self.action_show_fit_settings.setToolTip('Show the Fit Settings.') save_spec_icon = QtGui.QIcon(os.path.join(icon_path, 'document-save')) - self.action_save_spectrum = QtWidgets.QAction(icon=save_spec_icon, + self.action_save_spectrum = QtGui.QAction(icon=save_spec_icon, text='Save Spectrum', parent=self) self.action_save_spectrum.setToolTip('Save the currently shown spectrum.') save_back_icon = QtGui.QIcon(os.path.join(icon_path, 'document-save')) - self.action_save_background = QtWidgets.QAction(icon=save_back_icon, + self.action_save_background = QtGui.QAction(icon=save_back_icon, text='Save Background', parent=self) self.action_save_background.setToolTip('Save the current background spectrum.') - self.action_show_data = QtWidgets.QAction(text='Show Data', parent=self) + self.action_show_data = QtGui.QAction(text='Show Data', parent=self) self.action_show_data.setToolTip('Show/Hide spectrometer data plot and analysis dock.') self.action_show_data.setCheckable(True) self.action_show_data.setChecked(True) diff --git a/src/qudi/gui/switch/switch_gui.py b/src/qudi/gui/switch/switch_gui.py index bf956bc61..76318a848 100644 --- a/src/qudi/gui/switch/switch_gui.py +++ b/src/qudi/gui/switch/switch_gui.py @@ -57,29 +57,29 @@ def __init__(self, *args, **kwargs): self.setMenuBar(menu_bar) menu = menu_bar.addMenu('Menu') - self.action_close = QtWidgets.QAction('Close Window') + self.action_close = QtGui.QAction('Close Window') self.action_close.setCheckable(False) self.action_close.setIcon(QtGui.QIcon('artwork/icons/application-exit.svg')) self.addAction(self.action_close) menu.addAction(self.action_close) menu = menu_bar.addMenu('View') - self.action_periodic_state_check = QtWidgets.QAction('Periodic State Checking') + self.action_periodic_state_check = QtGui.QAction('Periodic State Checking') self.action_periodic_state_check.setCheckable(True) menu.addAction(self.action_periodic_state_check) separator = menu.addSeparator() separator.setText('Switch Appearance') - self.switch_view_actions = [QtWidgets.QAction('use toggle switches'), - QtWidgets.QAction('use radio buttons')] - self.switch_view_action_group = QtWidgets.QActionGroup(self) + self.switch_view_actions = [QtGui.QAction('use toggle switches'), + QtGui.QAction('use radio buttons')] + self.switch_view_action_group = QtGui.QActionGroup(self) for action in self.switch_view_actions: action.setCheckable(True) self.switch_view_action_group.addAction(action) menu.addAction(action) - self.action_view_highlight_state = QtWidgets.QAction('highlight state labels') + self.action_view_highlight_state = QtGui.QAction('highlight state labels') self.action_view_highlight_state.setCheckable(True) menu.addAction(self.action_view_highlight_state) - self.action_view_alt_toggle_style = QtWidgets.QAction('alternative toggle switch') + self.action_view_alt_toggle_style = QtGui.QAction('alternative toggle switch') self.action_view_alt_toggle_style.setCheckable(True) menu.addAction(self.action_view_alt_toggle_style) From 63a0a4facd35486ab46b8ee84462339eb8f3fef9 Mon Sep 17 00:00:00 2001 From: qku Date: Sun, 29 Jan 2023 22:21:39 +0100 Subject: [PATCH 3/3] change signals to provide pyside6 compatibility: requires testing of e.g. delte poi --- src/qudi/gui/poimanager/poimanagergui.py | 2 +- src/qudi/gui/pulsed/pulsed_maingui.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qudi/gui/poimanager/poimanagergui.py b/src/qudi/gui/poimanager/poimanagergui.py index 5ed5a8f82..5622d79b0 100644 --- a/src/qudi/gui/poimanager/poimanagergui.py +++ b/src/qudi/gui/poimanager/poimanagergui.py @@ -471,7 +471,7 @@ def __connect_control_signals_to_logic(self): self._poi_manager_logic().set_poi_anchor_from_position, QtCore.Qt.QueuedConnection) self._mw.delete_poi_PushButton.clicked.connect( self._poi_manager_logic().delete_poi, QtCore.Qt.QueuedConnection) - self._mw.active_poi_ComboBox.activated[str].connect( + self._mw.active_poi_ComboBox.currentTextChanged.connect( self._poi_manager_logic().set_active_poi, QtCore.Qt.QueuedConnection) self._mw.goto_poi_after_update_checkBox.stateChanged.connect( self._poi_manager_logic().set_move_scanner_after_optimise, QtCore.Qt.QueuedConnection) diff --git a/src/qudi/gui/pulsed/pulsed_maingui.py b/src/qudi/gui/pulsed/pulsed_maingui.py index fa01335c8..ce3ea4b39 100644 --- a/src/qudi/gui/pulsed/pulsed_maingui.py +++ b/src/qudi/gui/pulsed/pulsed_maingui.py @@ -391,11 +391,11 @@ def _connect_analysis_tab_signals(self): self._pa.ana_param_num_laser_pulse_SpinBox.editingFinished.connect(self.measurement_settings_changed) self._pa.ana_param_record_length_DoubleSpinBox.editingFinished.connect(self.fast_counter_settings_changed) - self._pa.ana_param_fc_bins_ComboBox.currentIndexChanged.connect(self.fast_counter_settings_changed) + self._pa.ana_param_fc_bins_ComboBox.currentTextChanged.connect(self.fast_counter_settings_changed) self._pa.time_param_ana_periode_DoubleSpinBox.editingFinished.connect(self.measurement_timer_changed) self._pa.ana_param_errorbars_CheckBox.toggled.connect(self.toggle_error_bars) - self._pa.second_plot_ComboBox.currentIndexChanged[str].connect(self.second_plot_changed) + self._pa.second_plot_ComboBox.currentTextChanged[str].connect(self.second_plot_changed) return def _connect_extraction_tab_signals(self):