diff --git a/planetary_system_stacker/Test_programs/Info.py b/planetary_system_stacker/Test_programs/Info.py index 2234f09..dd59b3d 100644 --- a/planetary_system_stacker/Test_programs/Info.py +++ b/planetary_system_stacker/Test_programs/Info.py @@ -8,7 +8,7 @@ import os import platform -from PyQt5 import QtCore +from PyQt6 import QtCore import psutil import matplotlib import numpy as np diff --git a/planetary_system_stacker/Test_programs/frame_viewer_test.py b/planetary_system_stacker/Test_programs/frame_viewer_test.py index 5aeeb7e..c38b76a 100644 --- a/planetary_system_stacker/Test_programs/frame_viewer_test.py +++ b/planetary_system_stacker/Test_programs/frame_viewer_test.py @@ -1,6 +1,6 @@ from sys import argv -from PyQt5 import QtCore, QtGui, QtWidgets +from PyQt6 import QtCore, QtGui, QtWidgets from cv2 import NORM_MINMAX, normalize, cvtColor, COLOR_GRAY2RGB, circle, line from numpy import uint8, uint16 diff --git a/planetary_system_stacker/Test_programs/frame_viewer_test_gui.py b/planetary_system_stacker/Test_programs/frame_viewer_test_gui.py index b1d523d..bdb0c76 100644 --- a/planetary_system_stacker/Test_programs/frame_viewer_test_gui.py +++ b/planetary_system_stacker/Test_programs/frame_viewer_test_gui.py @@ -7,7 +7,7 @@ # WARNING! All changes made in this file will be lost! -from PyQt5 import QtCore, QtGui, QtWidgets +from PyQt6 import QtCore, QtGui, QtWidgets class Ui_Frame(object): diff --git a/planetary_system_stacker/Test_programs/gui_with_label.py b/planetary_system_stacker/Test_programs/gui_with_label.py index 3126e6a..fd1a8c9 100644 --- a/planetary_system_stacker/Test_programs/gui_with_label.py +++ b/planetary_system_stacker/Test_programs/gui_with_label.py @@ -8,7 +8,7 @@ # run again. Do not edit this file unless you know what you are doing. -from PyQt5 import QtCore, QtGui, QtWidgets +from PyQt6 import QtCore, QtGui, QtWidgets class Ui_Form(object): diff --git a/planetary_system_stacker/Test_programs/gui_with_label_test.py b/planetary_system_stacker/Test_programs/gui_with_label_test.py index de317c2..e069551 100644 --- a/planetary_system_stacker/Test_programs/gui_with_label_test.py +++ b/planetary_system_stacker/Test_programs/gui_with_label_test.py @@ -3,8 +3,8 @@ from sys import argv from urllib import request -from PyQt5 import QtWidgets -from PyQt5.QtCore import Qt +from PyQt6 import QtWidgets +from PyQt6.QtCore import Qt from gui_with_label import Ui_Form diff --git a/planetary_system_stacker/Test_programs/list_view.py b/planetary_system_stacker/Test_programs/list_view.py index 5a8d038..cfdf11d 100644 --- a/planetary_system_stacker/Test_programs/list_view.py +++ b/planetary_system_stacker/Test_programs/list_view.py @@ -2,8 +2,8 @@ from sys import argv -from PyQt5 import QtCore, QtGui, QtWidgets -from PyQt5.QtCore import Qt +from PyQt6 import QtCore, QtGui, QtWidgets +from PyQt6.QtCore import Qt from list_view_widget import Ui_ListViewWidget diff --git a/planetary_system_stacker/Test_programs/list_view_widget.py b/planetary_system_stacker/Test_programs/list_view_widget.py index 098b090..2d87fe1 100644 --- a/planetary_system_stacker/Test_programs/list_view_widget.py +++ b/planetary_system_stacker/Test_programs/list_view_widget.py @@ -6,7 +6,7 @@ # # WARNING! All changes made in this file will be lost! -from PyQt5 import QtCore, QtGui, QtWidgets +from PyQt6 import QtCore, QtGui, QtWidgets class Ui_ListViewWidget(object): def setupUi(self, ListViewWidget): @@ -35,4 +35,3 @@ def retranslateUi(self, ListViewWidget): ListViewWidget.setWindowTitle(_translate("ListViewWidget", "Frame")) self.addButton.setText(_translate("ListViewWidget", "+")) self.removeButton.setText(_translate("ListViewWidget", "-")) - diff --git a/planetary_system_stacker/Test_programs/main_program.py b/planetary_system_stacker/Test_programs/main_program.py index cafadbf..ad718d7 100644 --- a/planetary_system_stacker/Test_programs/main_program.py +++ b/planetary_system_stacker/Test_programs/main_program.py @@ -32,7 +32,7 @@ matplotlib.use('Agg') import matplotlib.pyplot as plt from skimage import img_as_ubyte -from PyQt5 import QtWidgets +from PyQt6 import QtWidgets from align_frames import AlignFrames from alignment_points import AlignmentPoints diff --git a/planetary_system_stacker/Test_programs/spinbox_gui.py b/planetary_system_stacker/Test_programs/spinbox_gui.py index 48566d7..27bf769 100644 --- a/planetary_system_stacker/Test_programs/spinbox_gui.py +++ b/planetary_system_stacker/Test_programs/spinbox_gui.py @@ -8,7 +8,7 @@ # run again. Do not edit this file unless you know what you are doing. -from PyQt5 import QtCore, QtGui, QtWidgets +from PyQt6 import QtCore, QtGui, QtWidgets class Ui_Frame(object): @@ -18,4 +18,3 @@ def setupUi(self, Frame): self.spinBox = QtWidgets.QSpinBox(Frame) self.spinBox.setGeometry(QtCore.QRect(9, 27, 131, 20)) self.spinBox.setObjectName("spinBox") - diff --git a/planetary_system_stacker/Test_programs/spinbox_test.py b/planetary_system_stacker/Test_programs/spinbox_test.py index afe3bb3..65c606b 100644 --- a/planetary_system_stacker/Test_programs/spinbox_test.py +++ b/planetary_system_stacker/Test_programs/spinbox_test.py @@ -1,8 +1,8 @@ from sys import argv from time import sleep -from PyQt5 import QtWidgets, QtCore -from PyQt5.QtWidgets import QApplication, QMainWindow, QProxyStyle, QStyle +from PyQt6 import QtWidgets, QtCore +from PyQt6.QtWidgets import QApplication, QMainWindow, QProxyStyle, QStyle class CustomStyle(QProxyStyle): def styleHint(self, hint, option=None, widget=None, returnData=None): @@ -33,4 +33,4 @@ def spinbox_changed(self): app = QtWidgets.QApplication(argv) window = SpinBoxTest() window.show() - app.exec_() \ No newline at end of file + app.exec_() diff --git a/planetary_system_stacker/alignment_point_editor.py b/planetary_system_stacker/alignment_point_editor.py index f7ca47e..1faedf2 100644 --- a/planetary_system_stacker/alignment_point_editor.py +++ b/planetary_system_stacker/alignment_point_editor.py @@ -26,7 +26,8 @@ from sys import argv, exit from time import time -from PyQt5 import QtCore, QtGui, QtWidgets +from PyQt6 import QtCore, QtGui, QtWidgets +from PyQt6.QtGui import QUndoCommand from numpy import uint8 from align_frames import AlignFrames @@ -89,7 +90,7 @@ def mousePressEvent(self, event): y = int(pos.y()) # The left button is pressed. - if event.button() == QtCore.Qt.LeftButton: + if event.button() == QtCore.Qt.MouseButton.LeftButton: self.left_button_pressed = True # Find the closest AP. @@ -112,7 +113,7 @@ def mousePressEvent(self, event): self.new_ap = True # The right button is pressed. - elif event.button() == QtCore.Qt.RightButton: + elif event.button() == QtCore.Qt.MouseButton.RightButton: self.right_button_pressed = True # Remember the location and initialize an object which during mouse moving stores @@ -135,7 +136,7 @@ def mouseReleaseEvent(self, event): y = int(pos.y()) # The left button is released. - if event.button() == QtCore.Qt.LeftButton: + if event.button() == QtCore.Qt.MouseButton.LeftButton: self.left_button_pressed = False # An existing AP was moved, replace it with the moved one. @@ -151,7 +152,7 @@ def mouseReleaseEvent(self, event): self.new_ap = False # The right button is released. - elif event.button() == QtCore.Qt.RightButton: + elif event.button() == QtCore.Qt.MouseButton.RightButton: self.right_button_pressed = False # If the mouse was not moved much between press and release, a single AP is deleted. @@ -244,9 +245,9 @@ def keyPressEvent(self, event): # This is a workaround: Instead of "93" it should read "QtCore.Qt.Key_Plus", but that # returns 43 instead. - if event.key() == 93 and event.modifiers() & QtCore.Qt.ControlModifier: + if event.key() == 93 and event.modifiers() & QtCore.Qt.KeyModifier.ControlModifier: self.change_ap_size(1) - elif event.key() == QtCore.Qt.Key_Minus and event.modifiers() & QtCore.Qt.ControlModifier: + elif event.key() == QtCore.Qt.Key.Key_Minus and event.modifiers() & QtCore.Qt.KeyModifier.ControlModifier: self.change_ap_size(-1) def change_ap_size(self, direction): @@ -300,7 +301,7 @@ def __init__(self, ap): self.patch_x_low = ap["patch_x_low"] self.patch_x_high = ap["patch_x_high"] self.pen_boundary = QtGui.QPen(self.color_boundary) - self.pen_boundary.setStyle(0) + self.pen_boundary.setStyle(QtCore.Qt.PenStyle.SolidLine) self.width_x = self.patch_x_high - self.patch_x_low self.width_x_external = self.width_x + self.pen_boundary.width() self.width_y = self.patch_y_high - self.patch_y_low @@ -372,7 +373,7 @@ def __init__(self, image, alignment_points): self.image = image # Initialize the undo stack. - self.undoStack = QtWidgets.QUndoStack(self) + self.undoStack = QtGui.QUndoStack(self) # Initialize the alignment point object. self.aps = alignment_points @@ -402,9 +403,9 @@ def keyPressEvent(self, event): """ # If the control key is pressed, switch to "no drag mode". - if event.key() == QtCore.Qt.Key_Z and event.modifiers() & QtCore.Qt.ControlModifier: + if event.key() == QtCore.Qt.Key.Key_Z and event.modifiers() & QtCore.Qt.KeyModifier.ControlModifier: self.undoStack.undo() - elif event.key() == QtCore.Qt.Key_Y and event.modifiers() & QtCore.Qt.ControlModifier: + elif event.key() == QtCore.Qt.Key.Key_Y and event.modifiers() & QtCore.Qt.KeyModifier.ControlModifier: self.undoStack.redo() else: super(AlignmentPointEditor, self).keyPressEvent(event) @@ -454,7 +455,7 @@ def replace_alignment_point(self, ap_old, ap_new): self.undoStack.push(command) -class CommandCreateApGrid(QtWidgets.QUndoCommand): +class CommandCreateApGrid(QUndoCommand): """ Undoable command to replace all existing APs with a new AP grid. """ @@ -499,7 +500,7 @@ def undo(self): self.photo_editor.setFocus() -class CommandAdd(QtWidgets.QUndoCommand): +class CommandAdd(QUndoCommand): """ Undoable command to add an AP to the AP list. """ @@ -523,7 +524,7 @@ def undo(self): self.photo_editor.setFocus() -class CommandRemove(QtWidgets.QUndoCommand): +class CommandRemove(QUndoCommand): """ Undoable command to remove an AP from the AP list. """ @@ -548,7 +549,7 @@ def undo(self): self.photo_editor.setFocus() -class CommandReplace(QtWidgets.QUndoCommand): +class CommandReplace(QUndoCommand): """ Undoable command to replace an AP on the AP list with another one. """ @@ -821,4 +822,3 @@ def done(self): AlignmentPoints.set_reference_box(ap, align_frames.mean_frame) print("Buffers allocated for " + str(count_updates) + " alignment points.") exit() - diff --git a/planetary_system_stacker/alignment_point_editor_gui.py b/planetary_system_stacker/alignment_point_editor_gui.py index cfcebb6..1d0a9de 100644 --- a/planetary_system_stacker/alignment_point_editor_gui.py +++ b/planetary_system_stacker/alignment_point_editor_gui.py @@ -7,36 +7,36 @@ # WARNING! All changes made in this file will be lost! -from PyQt5 import QtCore, QtGui, QtWidgets +from PyQt6 import QtCore, QtGui, QtWidgets class Ui_alignment_point_editor(object): def setupUi(self, alignment_point_editor): alignment_point_editor.setObjectName("alignment_point_editor") alignment_point_editor.resize(941, 629) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Preferred) sizePolicy.setHorizontalStretch(1) sizePolicy.setVerticalStretch(1) sizePolicy.setHeightForWidth(alignment_point_editor.sizePolicy().hasHeightForWidth()) alignment_point_editor.setSizePolicy(sizePolicy) - alignment_point_editor.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) - alignment_point_editor.setFrameShape(QtWidgets.QFrame.Panel) - alignment_point_editor.setFrameShadow(QtWidgets.QFrame.Sunken) + alignment_point_editor.setLocale(QtCore.QLocale(QtCore.QLocale.Language.English, QtCore.QLocale.Country.UnitedStates)) + alignment_point_editor.setFrameShape(QtWidgets.QFrame.Shape.Panel) + alignment_point_editor.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) self.verticalLayout_2 = QtWidgets.QVBoxLayout(alignment_point_editor) self.verticalLayout_2.setObjectName("verticalLayout_2") self.horizontalLayout_2 = QtWidgets.QHBoxLayout() self.horizontalLayout_2.setObjectName("horizontalLayout_2") - spacerItem = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum) + spacerItem = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Minimum) self.horizontalLayout_2.addItem(spacerItem) self.verticalLayout_3 = QtWidgets.QVBoxLayout() self.verticalLayout_3.setObjectName("verticalLayout_3") self.aphbw_label_display = QtWidgets.QLabel(alignment_point_editor) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.aphbw_label_display.sizePolicy().hasHeightForWidth()) self.aphbw_label_display.setSizePolicy(sizePolicy) - self.aphbw_label_display.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) + self.aphbw_label_display.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeading|QtCore.Qt.AlignmentFlag.AlignLeft|QtCore.Qt.AlignmentFlag.AlignVCenter) self.aphbw_label_display.setObjectName("aphbw_label_display") self.verticalLayout_3.addWidget(self.aphbw_label_display) self.aphbw_slider_value = QtWidgets.QSlider(alignment_point_editor) @@ -45,27 +45,27 @@ def setupUi(self, alignment_point_editor): self.aphbw_slider_value.setSingleStep(4) self.aphbw_slider_value.setPageStep(4) self.aphbw_slider_value.setProperty("value", 40) - self.aphbw_slider_value.setOrientation(QtCore.Qt.Vertical) + self.aphbw_slider_value.setOrientation(QtCore.Qt.Orientation.Vertical) self.aphbw_slider_value.setObjectName("aphbw_slider_value") self.verticalLayout_3.addWidget(self.aphbw_slider_value) self.aphbw_label_parameter = QtWidgets.QLabel(alignment_point_editor) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.aphbw_label_parameter.sizePolicy().hasHeightForWidth()) self.aphbw_label_parameter.setSizePolicy(sizePolicy) - self.aphbw_label_parameter.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) + self.aphbw_label_parameter.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeading|QtCore.Qt.AlignmentFlag.AlignLeft|QtCore.Qt.AlignmentFlag.AlignVCenter) self.aphbw_label_parameter.setObjectName("aphbw_label_parameter") self.verticalLayout_3.addWidget(self.aphbw_label_parameter) - spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.verticalLayout_3.addItem(spacerItem1) self.apst_label_display = QtWidgets.QLabel(alignment_point_editor) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.apst_label_display.sizePolicy().hasHeightForWidth()) self.apst_label_display.setSizePolicy(sizePolicy) - self.apst_label_display.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) + self.apst_label_display.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeading|QtCore.Qt.AlignmentFlag.AlignLeft|QtCore.Qt.AlignmentFlag.AlignVCenter) self.apst_label_display.setObjectName("apst_label_display") self.verticalLayout_3.addWidget(self.apst_label_display) self.apst_slider_value = QtWidgets.QSlider(alignment_point_editor) @@ -73,27 +73,27 @@ def setupUi(self, alignment_point_editor): self.apst_slider_value.setMaximum(30) self.apst_slider_value.setPageStep(5) self.apst_slider_value.setProperty("value", 5) - self.apst_slider_value.setOrientation(QtCore.Qt.Vertical) + self.apst_slider_value.setOrientation(QtCore.Qt.Orientation.Vertical) self.apst_slider_value.setObjectName("apst_slider_value") self.verticalLayout_3.addWidget(self.apst_slider_value) self.apst_label_parameter = QtWidgets.QLabel(alignment_point_editor) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.apst_label_parameter.sizePolicy().hasHeightForWidth()) self.apst_label_parameter.setSizePolicy(sizePolicy) - self.apst_label_parameter.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) + self.apst_label_parameter.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeading|QtCore.Qt.AlignmentFlag.AlignLeft|QtCore.Qt.AlignmentFlag.AlignVCenter) self.apst_label_parameter.setObjectName("apst_label_parameter") self.verticalLayout_3.addWidget(self.apst_label_parameter) - spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.verticalLayout_3.addItem(spacerItem2) self.apbt_label_display = QtWidgets.QLabel(alignment_point_editor) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.apbt_label_display.sizePolicy().hasHeightForWidth()) self.apbt_label_display.setSizePolicy(sizePolicy) - self.apbt_label_display.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) + self.apbt_label_display.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeading|QtCore.Qt.AlignmentFlag.AlignLeft|QtCore.Qt.AlignmentFlag.AlignVCenter) self.apbt_label_display.setObjectName("apbt_label_display") self.verticalLayout_3.addWidget(self.apbt_label_display) self.apbt_slider_value = QtWidgets.QSlider(alignment_point_editor) @@ -102,20 +102,20 @@ def setupUi(self, alignment_point_editor): self.apbt_slider_value.setSingleStep(2) self.apbt_slider_value.setPageStep(2) self.apbt_slider_value.setProperty("value", 10) - self.apbt_slider_value.setOrientation(QtCore.Qt.Vertical) + self.apbt_slider_value.setOrientation(QtCore.Qt.Orientation.Vertical) self.apbt_slider_value.setObjectName("apbt_slider_value") self.verticalLayout_3.addWidget(self.apbt_slider_value) self.apbt_label_parameter = QtWidgets.QLabel(alignment_point_editor) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.apbt_label_parameter.sizePolicy().hasHeightForWidth()) self.apbt_label_parameter.setSizePolicy(sizePolicy) - self.apbt_label_parameter.setLayoutDirection(QtCore.Qt.LeftToRight) - self.apbt_label_parameter.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) + self.apbt_label_parameter.setLayoutDirection(QtCore.Qt.LayoutDirection.LeftToRight) + self.apbt_label_parameter.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeading|QtCore.Qt.AlignmentFlag.AlignLeft|QtCore.Qt.AlignmentFlag.AlignVCenter) self.apbt_label_parameter.setObjectName("apbt_label_parameter") self.verticalLayout_3.addWidget(self.apbt_label_parameter) - spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.verticalLayout_3.addItem(spacerItem3) self.restore_standard_values = QtWidgets.QPushButton(alignment_point_editor) self.restore_standard_values.setObjectName("restore_standard_values") @@ -133,15 +133,15 @@ def setupUi(self, alignment_point_editor): self.btnRedo = QtWidgets.QPushButton(alignment_point_editor) self.btnRedo.setObjectName("btnRedo") self.horizontalLayout.addWidget(self.btnRedo) - spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.horizontalLayout.addItem(spacerItem4) self.label_message = QtWidgets.QLabel(alignment_point_editor) self.label_message.setObjectName("label_message") self.horizontalLayout.addWidget(self.label_message) - spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.horizontalLayout.addItem(spacerItem5) self.buttonBox = QtWidgets.QDialogButtonBox(alignment_point_editor) - self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Ok) + self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Ok) self.buttonBox.setObjectName("buttonBox") self.horizontalLayout.addWidget(self.buttonBox) self.verticalLayout_2.addLayout(self.horizontalLayout) diff --git a/planetary_system_stacker/configuration_editor.py b/planetary_system_stacker/configuration_editor.py index 0b6eb3c..8a468c1 100644 --- a/planetary_system_stacker/configuration_editor.py +++ b/planetary_system_stacker/configuration_editor.py @@ -20,9 +20,9 @@ """ -from PyQt5 import QtWidgets, QtCore -from PyQt5.QtGui import QIntValidator -from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QVBoxLayout, QLabel +from PyQt6 import QtWidgets, QtCore +from PyQt6.QtGui import QIntValidator +from PyQt6.QtWidgets import QDialog, QDialogButtonBox, QVBoxLayout, QLabel from configuration import ConfigurationParameters from parameter_configuration import Ui_ConfigurationDialog @@ -38,8 +38,8 @@ def __init__(self, parent_gui, parent=None): QtWidgets.QFrame.__init__(self, parent) self.setupUi(self) - self.setFrameShape(QtWidgets.QFrame.Panel) - self.setFrameShadow(QtWidgets.QFrame.Sunken) + self.setFrameShape(QtWidgets.QFrame.Shape.Panel) + self.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) self.setObjectName("configuration_editor") self.setFixedSize(900, 600) @@ -69,16 +69,16 @@ def __init__(self, parent_gui, parent=None): self.fdb_comboBox.addItem('Force Bayer GRBG') self.fdb_comboBox.addItem('Force Bayer GBRG') self.fdb_comboBox.addItem('Force Bayer BGGR') - self.fdb_comboBox.activated[str].connect(self.fdb_changed) + self.fdb_comboBox.textActivated.connect(self.fdb_changed) self.fdbm_comboBox.addItem('Bilinear') self.fdbm_comboBox.addItem('Variable Number of Gradients') self.fdbm_comboBox.addItem('Edge Aware') - self.fdbm_comboBox.activated[str].connect(self.fdbm_changed) + self.fdbm_comboBox.textActivated.connect(self.fdbm_changed) self.fn_checkBox.stateChanged.connect(self.fn_changed) self.fnt_slider_value.valueChanged['int'].connect(self.fnt_changed) self.afm_comboBox.addItem('Surface') self.afm_comboBox.addItem('Planet') - self.afm_comboBox.activated[str].connect(self.afm_changed) + self.afm_comboBox.textActivated.connect(self.afm_changed) self.afa_checkBox.stateChanged.connect(self.afa_changed) self.afrsf_slider_value.valueChanged['int'].connect(self.afrsf_changed) self.afsw_slider_value.valueChanged['int'].connect(self.afsw_changed) @@ -94,21 +94,21 @@ def __init__(self, parent_gui, parent=None): self.gpbl_combobox.addItem('2') self.gpbl_combobox.addItem('3') self.gpbl_combobox.addItem('4') - self.gpbl_combobox.activated[str].connect(self.gpbl_changed) + self.gpbl_combobox.textActivated.connect(self.gpbl_changed) self.mr_checkBox.stateChanged.connect(self.mr_changed) self.mr_lineEdit.setValidator(QIntValidator(1, 2147483647)) self.mr_lineEdit.textChanged.connect(self.mr_text_changed) self.gpif_comboBox.addItem('png') self.gpif_comboBox.addItem('tiff') self.gpif_comboBox.addItem('fits') - self.gpif_comboBox.activated[str].connect(self.gpif_changed) + self.gpif_comboBox.textActivated.connect(self.gpif_changed) self.aphbw_slider_value.valueChanged['int'].connect(self.aphbw_changed) self.apsw_slider_value.valueChanged['int'].connect(self.apsw_changed) self.apst_slider_value.valueChanged['int'].connect(self.apst_changed) self.apbt_slider_value.valueChanged['int'].connect(self.apbt_changed) self.apfp_comboBox.addItem('Percent of frames to be stacked') self.apfp_comboBox.addItem('Number of frames to be stacked') - self.apfp_comboBox.activated[str].connect(self.apfp_state_changed) + self.apfp_comboBox.textActivated.connect(self.apfp_state_changed) self.apfp_spinBox.valueChanged['int'].connect(self.apfp_value_changed) self.spp_checkBox.stateChanged.connect(self.spp_changed) self.ipfn_checkBox.stateChanged.connect(self.ipfn_changed) @@ -120,7 +120,7 @@ def __init__(self, parent_gui, parent=None): self.sfdfs_comboBox.addItem('1.5x') self.sfdfs_comboBox.addItem('2x') self.sfdfs_comboBox.addItem('3x') - self.sfdfs_comboBox.activated[str].connect(self.sfdfs_changed) + self.sfdfs_comboBox.textActivated.connect(self.sfdfs_changed) self.restore_standard_values.clicked.connect(self.restore_standard_parameters) @@ -136,15 +136,15 @@ def initialize_widgets_and_local_parameters(self): self.fgw_slider_value.setValue(int((self.config_copy.frames_gauss_width + 1) / 2)) self.fgw_label_display.setText(str(self.config_copy.frames_gauss_width)) index = self.fdb_comboBox.findText(self.config_copy.frames_debayering_default, - QtCore.Qt.MatchFixedString) + QtCore.Qt.MatchFlag.MatchFixedString) if index >= 0: self.fdb_comboBox.setCurrentIndex(index) index = self.fdbm_comboBox.findText(self.config_copy.frames_debayering_method, - QtCore.Qt.MatchFixedString) + QtCore.Qt.MatchFlag.MatchFixedString) if index >= 0: self.fdbm_comboBox.setCurrentIndex(index) index = self.afm_comboBox.findText(self.config_copy.align_frames_mode, - QtCore.Qt.MatchFixedString) + QtCore.Qt.MatchFlag.MatchFixedString) if index >= 0: self.afm_comboBox.setCurrentIndex(index) self.afm_activate_deactivate_widgets() @@ -176,7 +176,7 @@ def initialize_widgets_and_local_parameters(self): self.mr_lineEdit.setEnabled(False) index = self.gpif_comboBox.findText(self.config_copy.global_parameters_image_format, - QtCore.Qt.MatchFixedString) + QtCore.Qt.MatchFlag.MatchFixedString) if index >= 0: self.gpif_comboBox.setCurrentIndex(index) self.ipfn_checkBox.setChecked(self.config_copy.global_parameters_parameters_in_filename) @@ -208,7 +208,7 @@ def initialize_widgets_and_local_parameters(self): self.fnt_label_display.setText(str(self.config_copy.frames_normalization_threshold)) self.ipfn_activate_deactivate_widgets() index = self.sfdfs_comboBox.findText(self.config_copy.stack_frames_drizzle_factor_string, - QtCore.Qt.MatchFixedString) + QtCore.Qt.MatchFlag.MatchFixedString) if index >= 0: self.sfdfs_comboBox.setCurrentIndex(index) @@ -284,7 +284,7 @@ def ipfn_activate_deactivate_widgets(self): self.nap_checkBox.setEnabled(False) def afa_changed(self, state): - self.config_copy.align_frames_automation = (state == QtCore.Qt.Checked) + self.config_copy.align_frames_automation = (state == QtCore.Qt.CheckState.Checked) def afrsf_changed(self, value): self.config_copy.align_frames_rectangle_scale_factor = 100. / value @@ -296,16 +296,16 @@ def afafp_changed(self, value): self.config_copy.align_frames_average_frame_percent = value def efs_changed(self, state): - self.config_copy.frames_add_selection_dialog = (state == QtCore.Qt.Checked) + self.config_copy.frames_add_selection_dialog = (state == QtCore.Qt.CheckState.Checked) def fco_changed(self, state): - self.config_copy.align_frames_fast_changing_object = (state == QtCore.Qt.Checked) + self.config_copy.align_frames_fast_changing_object = (state == QtCore.Qt.CheckState.Checked) def gpwptf_changed(self, state): - self.config_copy.global_parameters_write_protocol_to_file = (state == QtCore.Qt.Checked) + self.config_copy.global_parameters_write_protocol_to_file = (state == QtCore.Qt.CheckState.Checked) def gpspwr_changed(self, state): - self.config_copy.global_parameters_store_protocol_with_result = (state == QtCore.Qt.Checked) + self.config_copy.global_parameters_store_protocol_with_result = (state == QtCore.Qt.CheckState.Checked) def gppl_changed(self, value): self.config_copy.global_parameters_protocol_level = value @@ -339,7 +339,7 @@ def make_mr_label_visible(self, state): self.mr_label.setText(text) def mr_changed(self, state): - max_memory_active = (state == QtCore.Qt.Checked) + max_memory_active = (state == QtCore.Qt.CheckState.Checked) self.mr_activate(max_memory_active) self.make_mr_label_visible(max_memory_active) @@ -396,10 +396,10 @@ def apfp_value_changed(self, value): self.config_copy.alignment_points_frame_number = value def spp_changed(self, state): - self.config_copy.global_parameters_include_postprocessing = (state == QtCore.Qt.Checked) + self.config_copy.global_parameters_include_postprocessing = (state == QtCore.Qt.CheckState.Checked) def fn_changed(self, state): - self.config_copy.frames_normalization = (state == QtCore.Qt.Checked) + self.config_copy.frames_normalization = (state == QtCore.Qt.CheckState.Checked) self.fn_activate_deactivate_widgets() def fnt_changed(self, value): @@ -407,20 +407,20 @@ def fnt_changed(self, value): self.fnt_label_display.setText(str(self.config_copy.frames_normalization_threshold)) def ipfn_changed(self, state): - self.config_copy.global_parameters_parameters_in_filename = (state == QtCore.Qt.Checked) + self.config_copy.global_parameters_parameters_in_filename = (state == QtCore.Qt.CheckState.Checked) self.ipfn_activate_deactivate_widgets() def nfs_changed(self, state): - self.config_copy.global_parameters_stack_number_frames = (state == QtCore.Qt.Checked) + self.config_copy.global_parameters_stack_number_frames = (state == QtCore.Qt.CheckState.Checked) def pfs_changed(self, state): - self.config_copy.global_parameters_stack_percent_frames = (state == QtCore.Qt.Checked) + self.config_copy.global_parameters_stack_percent_frames = (state == QtCore.Qt.CheckState.Checked) def apbs_changed(self, state): - self.config_copy.global_parameters_ap_box_size = (state == QtCore.Qt.Checked) + self.config_copy.global_parameters_ap_box_size = (state == QtCore.Qt.CheckState.Checked) def nap_changed(self, state): - self.config_copy.global_parameters_ap_number = (state == QtCore.Qt.Checked) + self.config_copy.global_parameters_ap_number = (state == QtCore.Qt.CheckState.Checked) def sfdfs_changed(self, value): self.config_copy.stack_frames_drizzle_factor_string = value diff --git a/planetary_system_stacker/display_quickstart.py b/planetary_system_stacker/display_quickstart.py index 5892b1f..30dc4d0 100644 --- a/planetary_system_stacker/display_quickstart.py +++ b/planetary_system_stacker/display_quickstart.py @@ -22,8 +22,8 @@ from sys import argv -from PyQt5 import QtWidgets -from PyQt5.QtCore import Qt +from PyQt6 import QtWidgets +from PyQt6.QtCore import Qt from configuration import Configuration from quickstart_gui import Ui_Form @@ -43,12 +43,12 @@ def __init__(self, parent_gui, configuration): # Get the quickstart guide text from a markdown document. The original text is in file # "quickstart.md". - self.label.setTextFormat(Qt.MarkdownText) + self.label.setTextFormat(Qt.TextFormat.MarkdownText) markdown_text = """ ### Quickstart Guide #### Configuration -Select 'Edit / Edit configuration' to check if the configuration parameters are set properly. +Select 'Edit / Edit configuration' to check if the configuration parameters are set properly. The dialog starts with the 'Frame-related Parameters' where the most important choice is the stabilization mode: * Surface (for extended objects which do not fit into the FoV) @@ -86,7 +86,7 @@ def __init__(self, parent_gui, configuration): Postprocessing can follow stacking immediately (if the workflow parameter 'Stacking plus postprocessing' is checked), or be executed separately (if the job input is a single image file). To process several images with the same parameters, adjust the parameters for the first image in -interactive mode, and then check 'Automatic' to repeat the same for all other images in batch mode. +interactive mode, and then check 'Automatic' to repeat the same for all other images in batch mode. """ self.label.setText(markdown_text) diff --git a/planetary_system_stacker/frame_selector.py b/planetary_system_stacker/frame_selector.py index f05c60e..9606e5f 100644 --- a/planetary_system_stacker/frame_selector.py +++ b/planetary_system_stacker/frame_selector.py @@ -29,8 +29,8 @@ from sys import argv, exit from time import sleep -from PyQt5 import QtCore, QtGui, QtWidgets -from PyQt5.QtCore import Qt +from PyQt6 import QtCore, QtGui, QtWidgets +from PyQt6.QtCore import Qt from configuration import Configuration from exceptions import Error diff --git a/planetary_system_stacker/frame_selector_gui.py b/planetary_system_stacker/frame_selector_gui.py index 7c75b09..a31aee1 100644 --- a/planetary_system_stacker/frame_selector_gui.py +++ b/planetary_system_stacker/frame_selector_gui.py @@ -7,7 +7,7 @@ # WARNING! All changes made in this file will be lost! -from PyQt5 import QtCore, QtGui, QtWidgets +from PyQt6 import QtCore, QtGui, QtWidgets class Ui_frame_selector(object): diff --git a/planetary_system_stacker/frame_viewer.py b/planetary_system_stacker/frame_viewer.py index 29f50df..42c71b5 100644 --- a/planetary_system_stacker/frame_viewer.py +++ b/planetary_system_stacker/frame_viewer.py @@ -33,7 +33,7 @@ matplotlib.use('Agg') import matplotlib.pyplot as plt -from PyQt5 import QtCore, QtGui, QtWidgets +from PyQt6 import QtCore, QtGui, QtWidgets from cv2 import NORM_MINMAX, normalize, cvtColor, COLOR_GRAY2RGB, circle, line from matplotlib import patches from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as Canvas @@ -219,13 +219,13 @@ def __init__(self): self.viewrect = self.viewport().rect() - self.setTransformationAnchor(QtWidgets.QGraphicsView.AnchorUnderMouse) - self.setResizeAnchor(QtWidgets.QGraphicsView.AnchorUnderMouse) - self.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) - self.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) + self.setTransformationAnchor(QtWidgets.QGraphicsView.ViewportAnchor.AnchorUnderMouse) + self.setResizeAnchor(QtWidgets.QGraphicsView.ViewportAnchor.AnchorUnderMouse) + self.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarPolicy.ScrollBarAlwaysOff) + self.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarPolicy.ScrollBarAlwaysOff) self.setBackgroundBrush(QtGui.QBrush(QtGui.QColor(30, 30, 30))) - self.setFrameShape(QtWidgets.QFrame.NoFrame) - self.setDragMode(QtWidgets.QGraphicsView.ScrollHandDrag) + self.setFrameShape(QtWidgets.QFrame.Shape.NoFrame) + self.setDragMode(QtWidgets.QGraphicsView.DragMode.ScrollHandDrag) self.drag_mode = True # Set the focus on the viewer. @@ -338,11 +338,11 @@ def setPhoto(self, image, overlay_exclude_mark=False): # The image is monochrome: if len(image_uint8.shape) == 2: qt_image = QtGui.QImage(image_uint8, self.shape_x, self.shape_y, self.shape_x, - QtGui.QImage.Format_Grayscale8) + QtGui.QImage.Format.Format_Grayscale8) # The image is RGB color. else: qt_image = QtGui.QImage(image_uint8, self.shape_x, - self.shape_y, 3 * self.shape_x, QtGui.QImage.Format_RGB888) + self.shape_y, 3 * self.shape_x, QtGui.QImage.Format.Format_RGB888) pixmap = QtGui.QPixmap(qt_image) if pixmap and not pixmap.isNull(): @@ -431,14 +431,14 @@ def keyPressEvent(self, event): """ # If the "+" key is pressed, zoom in. If "-" is pressed, zoom out. - if event.key() == QtCore.Qt.Key_Control: - self.setDragMode(QtWidgets.QGraphicsView.NoDrag) + if event.key() == QtCore.Qt.Key.Key_Control: + self.setDragMode(QtWidgets.QGraphicsView.DragMode.NoDrag) self.drag_mode = False - elif event.key() == QtCore.Qt.Key_Plus and not event.modifiers() & QtCore.Qt.ControlModifier: + elif event.key() == QtCore.Qt.Key.Key_Plus and not event.modifiers() & QtCore.Qt.KeyboardModifier.ControlModifier: self.zoom(1) - elif event.key() == QtCore.Qt.Key_Minus and not event.modifiers() & QtCore.Qt.ControlModifier: + elif event.key() == QtCore.Qt.Key.Key_Minus and not event.modifiers() & QtCore.Qt.KeyboardModifier.ControlModifier: self.zoom(-1) - elif event.key() == QtCore.Qt.Key_1 and not event.modifiers() & QtCore.Qt.ControlModifier: + elif event.key() == QtCore.Qt.Key.Key_1 and not event.modifiers() & QtCore.Qt.KeyboardModifier.ControlModifier: self.set_original_scale() else: super(FrameViewer, self).keyPressEvent(event) @@ -446,8 +446,8 @@ def keyPressEvent(self, event): def keyReleaseEvent(self, event): # If the control key is released, switch back to "drag mode". # Use default handling for other keys. - if event.key() == QtCore.Qt.Key_Control: - self.setDragMode(QtWidgets.QGraphicsView.ScrollHandDrag) + if event.key() == QtCore.Qt.Key.Key_Control: + self.setDragMode(QtWidgets.QGraphicsView.DragMode.ScrollHandDrag) self.drag_mode = True else: super(FrameViewer, self).keyReleaseEvent(event) diff --git a/planetary_system_stacker/frame_viewer_gui.py b/planetary_system_stacker/frame_viewer_gui.py index 7ba1769..624fac5 100644 --- a/planetary_system_stacker/frame_viewer_gui.py +++ b/planetary_system_stacker/frame_viewer_gui.py @@ -6,15 +6,15 @@ # # WARNING! All changes made in this file will be lost! -from PyQt5 import QtCore, QtGui, QtWidgets +from PyQt6 import QtCore, QtGui, QtWidgets class Ui_frame_viewer(object): def setupUi(self, frame_viewer): frame_viewer.setObjectName("frame_viewer") frame_viewer.resize(900, 630) - frame_viewer.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) - frame_viewer.setFrameShape(QtWidgets.QFrame.Panel) - frame_viewer.setFrameShadow(QtWidgets.QFrame.Sunken) + frame_viewer.setLocale(QtCore.QLocale(QtCore.QLocale.Language.English, QtCore.QLocale.Country.UnitedStates)) + frame_viewer.setFrameShape(QtWidgets.QFrame.Shape.Panel) + frame_viewer.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) self.grid_layout = QtWidgets.QGridLayout(frame_viewer) self.grid_layout.setObjectName("grid_layout") self.groupBox_frame_sorting = QtWidgets.QGroupBox(frame_viewer) @@ -59,7 +59,7 @@ def setupUi(self, frame_viewer): self.gridLayout_3.addWidget(self.pushButton_set_stacking_limit, 2, 0, 1, 2) self.grid_layout.addWidget(self.groupBox_stacking_fraction, 2, 3, 1, 1) self.buttonBox = QtWidgets.QDialogButtonBox(frame_viewer) - self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok) + self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok) self.buttonBox.setObjectName("buttonBox") self.grid_layout.addWidget(self.buttonBox, 4, 3, 1, 1) self.pushButton_play = QtWidgets.QPushButton(frame_viewer) @@ -71,7 +71,7 @@ def setupUi(self, frame_viewer): self.slider_frames = QtWidgets.QSlider(frame_viewer) self.slider_frames.setMaximum(1000) self.slider_frames.setPageStep(20) - self.slider_frames.setOrientation(QtCore.Qt.Horizontal) + self.slider_frames.setOrientation(QtCore.Qt.Orientation.Horizontal) self.slider_frames.setObjectName("slider_frames") self.grid_layout.addWidget(self.slider_frames, 4, 0, 1, 1) self.label_matplotlib = QtWidgets.QLabel(frame_viewer) @@ -107,4 +107,3 @@ def retranslateUi(self, frame_viewer): self.slider_frames.setToolTip(_translate("frame_viewer", "Use the slider to select the frame to be displayed. As an alternative,\n" "you can select the frame with the \'frame sorting\' spinboxes.")) self.label_matplotlib.setText(_translate("frame_viewer", "Matplotlib placeholder")) - diff --git a/planetary_system_stacker/frames.py b/planetary_system_stacker/frames.py index 928a144..e245851 100644 --- a/planetary_system_stacker/frames.py +++ b/planetary_system_stacker/frames.py @@ -27,7 +27,7 @@ from pathlib import Path from time import time -from PyQt5 import QtCore +from PyQt6 import QtCore from astropy.io import fits from cv2 import imread, VideoCapture, CAP_PROP_FRAME_COUNT, cvtColor, COLOR_RGB2GRAY, \ COLOR_BGR2RGB, COLOR_BayerGB2BGR, COLOR_BayerBG2BGR, THRESH_TOZERO, threshold, \ diff --git a/planetary_system_stacker/job_dialog.py b/planetary_system_stacker/job_dialog.py index d1c18ba..86d9a39 100644 --- a/planetary_system_stacker/job_dialog.py +++ b/planetary_system_stacker/job_dialog.py @@ -6,7 +6,7 @@ # # WARNING! All changes made in this file will be lost! -from PyQt5 import QtCore, QtGui, QtWidgets +from PyQt6 import QtCore, QtGui, QtWidgets class Ui_JobDialog(object): @@ -15,25 +15,25 @@ def setupUi(self, JobDialog): JobDialog.resize(900, 530) self.gridLayout = QtWidgets.QGridLayout(JobDialog) self.gridLayout.setObjectName("gridLayout") - spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.gridLayout.addItem(spacerItem, 1, 2, 1, 1) self.job_list_widget = QtWidgets.QListWidget(JobDialog) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.MinimumExpanding) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.MinimumExpanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.job_list_widget.sizePolicy().hasHeightForWidth()) self.job_list_widget.setSizePolicy(sizePolicy) self.job_list_widget.setMinimumSize(QtCore.QSize(0, 483)) - self.job_list_widget.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection) - self.job_list_widget.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows) + self.job_list_widget.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.ExtendedSelection) + self.job_list_widget.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows) self.job_list_widget.setObjectName("job_list_widget") self.gridLayout.addWidget(self.job_list_widget, 0, 0, 1, 6) self.button_remove_jobs = QtWidgets.QPushButton(JobDialog) self.button_remove_jobs.setObjectName("button_remove_jobs") self.gridLayout.addWidget(self.button_remove_jobs, 1, 1, 1, 1) self.buttonBox = QtWidgets.QDialogButtonBox(JobDialog) - self.buttonBox.setOrientation(QtCore.Qt.Horizontal) - self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok) + self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal) + self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok) self.buttonBox.setObjectName("buttonBox") self.gridLayout.addWidget(self.buttonBox, 1, 5, 1, 1) self.button_add_jobs = QtWidgets.QPushButton(JobDialog) @@ -42,7 +42,7 @@ def setupUi(self, JobDialog): self.messageLabel = QtWidgets.QLabel(JobDialog) self.messageLabel.setObjectName("messageLabel") self.gridLayout.addWidget(self.messageLabel, 1, 3, 1, 1) - spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.gridLayout.addItem(spacerItem1, 1, 4, 1, 1) self.retranslateUi(JobDialog) @@ -60,5 +60,3 @@ def retranslateUi(self, JobDialog): "Each entry is executed as a job, either in batch mode (automatic) or manually. When the list is complete, confirm with pressing \"OK\".")) self.button_add_jobs.setText(_translate("JobDialog", "Add job(s)")) self.messageLabel.setText(_translate("JobDialog", "Add / remove videos / image folders for stacking, or images for postprocessing, confirm with \'OK\'.")) - - diff --git a/planetary_system_stacker/job_editor.py b/planetary_system_stacker/job_editor.py index 94a7d77..50d80a4 100644 --- a/planetary_system_stacker/job_editor.py +++ b/planetary_system_stacker/job_editor.py @@ -23,7 +23,7 @@ from copy import deepcopy from pathlib import Path -from PyQt5 import QtWidgets, QtCore, QtGui +from PyQt6 import QtWidgets, QtCore, QtGui from exceptions import InternalError from job_dialog import Ui_JobDialog @@ -46,8 +46,8 @@ def __init__(self, *args, **kwargs): super(FileDialog, self).__init__(*args, **kwargs) # Do not use the native dialog of the OS. Otherwise the selection model tree is not # available as expected. - self.setOption(QtWidgets.QFileDialog.DontUseNativeDialog, True) - self.setFileMode(QtWidgets.QFileDialog.ExistingFiles) + self.setOption(QtWidgets.QFileDialog.Option.DontUseNativeDialog, True) + self.setFileMode(QtWidgets.QFileDialog.FileMode.ExistingFiles) self.tree = self.findChild(QtWidgets.QTreeView) def accept(self): @@ -121,8 +121,8 @@ def __init__(self, parent=None): super().__init__(parent) self.setAcceptDrops(True) - self.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection) - self.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows) + self.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.ExtendedSelection) + self.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows) def dragEnterEvent(self, event): if event.mimeData().hasUrls: @@ -188,8 +188,8 @@ def __init__(self, parent_gui, parent=None): self.gridLayout.addWidget(self.job_list_widget, 0, 0, 1, 6) self.job_list_widget.signal_job_entries.connect(self.get_input_names) - self.setFrameShape(QtWidgets.QFrame.Panel) - self.setFrameShadow(QtWidgets.QFrame.Sunken) + self.setFrameShape(QtWidgets.QFrame.Shape.Panel) + self.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) self.setObjectName("configuration_editor") # The following line was deactivated. Otherwise the instructions under the joblist @@ -248,20 +248,21 @@ def add_jobs(self): :return: - """ - options = QtWidgets.QFileDialog.Options() + #options = QtWidgets.QFileDialog.Option message = "Select video file(s)/folders with image files for stacking, and/or " \ "image files for postprocessing" self.file_dialog = FileDialog(self, message, self.configuration.hidden_parameters_current_dir, - "Videos (*.avi *.mov *.mp4 *.ser)", options=options) + "Videos (*.avi *.mov *.mp4 *.ser)") self.file_dialog.setNameFilters(["Still image folders / video files for stacking (*.avi *.mov *.mp4 *.ser)", "Images for postprocessing (*.tiff *.tif *.fit *.fits *.png *.jpg)"]) self.file_dialog.selectNameFilter("Still image folders / video files for stacking (*.avi *.mov *.mp4 *.ser)") + #self.file_dialog.setOptions(QtWidgets.QFileDialog.Option.ShowDirsOnly) # The list of strings with the new job names is sent by the FileDialog via the signal. self.file_dialog.signal_dialog_ready.connect(self.get_input_names) - self.file_dialog.exec_() + self.file_dialog.exec() def get_input_names(self, input_names): """ @@ -341,7 +342,7 @@ def action8_triggered(state): self.pattern = 'Force Bayer BGGR' # The context menu is opened on a job list entry. - if (event.type() == QtCore.QEvent.ContextMenu and + if (event.type() == QtCore.QEvent.Type.ContextMenu and source is self.job_list_widget): # Show the context menu only if job items are selected for which debayering is diff --git a/planetary_system_stacker/main_gui.py b/planetary_system_stacker/main_gui.py index 1ee40f6..b48952c 100644 --- a/planetary_system_stacker/main_gui.py +++ b/planetary_system_stacker/main_gui.py @@ -8,33 +8,34 @@ # run again. Do not edit this file unless you know what you are doing. -from PyQt5 import QtCore, QtGui, QtWidgets +from PyQt6 import QtCore, QtGui, QtWidgets +from PyQt6.QtGui import QAction class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(1098, 824) - MainWindow.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) + MainWindow.setLocale(QtCore.QLocale(QtCore.QLocale.Language.English, QtCore.QLocale.Country.UnitedStates)) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.centralwidget) self.verticalLayout_2.setObjectName("verticalLayout_2") self.frame = QtWidgets.QFrame(self.centralwidget) - self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel) - self.frame.setFrameShadow(QtWidgets.QFrame.Raised) + self.frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) + self.frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) self.frame.setObjectName("frame") self.verticalLayout_2.addWidget(self.frame) self.tool_line = QtWidgets.QHBoxLayout() self.tool_line.setObjectName("tool_line") self.control_area = QtWidgets.QFrame(self.centralwidget) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.control_area.sizePolicy().hasHeightForWidth()) self.control_area.setSizePolicy(sizePolicy) - self.control_area.setFrameShape(QtWidgets.QFrame.Box) - self.control_area.setFrameShadow(QtWidgets.QFrame.Raised) + self.control_area.setFrameShape(QtWidgets.QFrame.Shape.Box) + self.control_area.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) self.control_area.setObjectName("control_area") self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.control_area) self.horizontalLayout_3.setContentsMargins(-1, -1, 9, -1) @@ -57,35 +58,35 @@ def setupUi(self, MainWindow): self.pushButton_next_job = QtWidgets.QPushButton(self.control_area) self.pushButton_next_job.setObjectName("pushButton_next_job") self.horizontalLayout_3.addWidget(self.pushButton_next_job) - spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.horizontalLayout_3.addItem(spacerItem) self.box_automatic = QtWidgets.QCheckBox(self.control_area) self.box_automatic.setObjectName("box_automatic") self.horizontalLayout_3.addWidget(self.box_automatic) self.tool_line.addWidget(self.control_area) - spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.tool_line.addItem(spacerItem1) self.label_current_progress = QtWidgets.QLabel(self.centralwidget) self.label_current_progress.setMinimumSize(QtCore.QSize(130, 0)) self.label_current_progress.setText("") - self.label_current_progress.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) + self.label_current_progress.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter) self.label_current_progress.setObjectName("label_current_progress") self.tool_line.addWidget(self.label_current_progress) self.progressBar_current = QtWidgets.QProgressBar(self.centralwidget) self.progressBar_current.setProperty("value", 0) self.progressBar_current.setObjectName("progressBar_current") self.tool_line.addWidget(self.progressBar_current) - spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.tool_line.addItem(spacerItem2) self.label_batch_progress = QtWidgets.QLabel(self.centralwidget) - self.label_batch_progress.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) + self.label_batch_progress.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter) self.label_batch_progress.setObjectName("label_batch_progress") self.tool_line.addWidget(self.label_batch_progress) self.progressBar_batch = QtWidgets.QProgressBar(self.centralwidget) self.progressBar_batch.setProperty("value", 0) self.progressBar_batch.setObjectName("progressBar_batch") self.tool_line.addWidget(self.progressBar_batch) - spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.tool_line.addItem(spacerItem3) self.pushButton_quit = QtWidgets.QPushButton(self.centralwidget) self.pushButton_quit.setObjectName("pushButton_quit") @@ -114,39 +115,39 @@ def setupUi(self, MainWindow): self.statusBar = QtWidgets.QStatusBar(MainWindow) self.statusBar.setObjectName("statusBar") MainWindow.setStatusBar(self.statusBar) - self.actionLoad_video_directory = QtWidgets.QAction(MainWindow) + self.actionLoad_video_directory = QAction(MainWindow) self.actionLoad_video_directory.setObjectName("actionLoad_video_directory") - self.actionLoad_config = QtWidgets.QAction(MainWindow) + self.actionLoad_config = QAction(MainWindow) self.actionLoad_config.setObjectName("actionLoad_config") - self.actionSave_config = QtWidgets.QAction(MainWindow) + self.actionSave_config = QAction(MainWindow) self.actionSave_config.setObjectName("actionSave_config") - self.actionLoad_postproc_config = QtWidgets.QAction(MainWindow) + self.actionLoad_postproc_config = QAction(MainWindow) self.actionLoad_postproc_config.setObjectName("actionLoad_postproc_config") - self.actionSave_postproc_config = QtWidgets.QAction(MainWindow) + self.actionSave_postproc_config = QAction(MainWindow) self.actionSave_postproc_config.setObjectName("actionSave_postproc_config") - self.actionSave = QtWidgets.QAction(MainWindow) + self.actionSave = QAction(MainWindow) self.actionSave.setObjectName("actionSave") - self.actionSave_as = QtWidgets.QAction(MainWindow) + self.actionSave_as = QAction(MainWindow) self.actionSave_as.setObjectName("actionSave_as") - self.actionQuit = QtWidgets.QAction(MainWindow) + self.actionQuit = QAction(MainWindow) self.actionQuit.setObjectName("actionQuit") - self.actionEdit_configuration = QtWidgets.QAction(MainWindow) + self.actionEdit_configuration = QAction(MainWindow) self.actionEdit_configuration.setObjectName("actionEdit_configuration") - self.actionEdit_postproc_config = QtWidgets.QAction(MainWindow) + self.actionEdit_postproc_config = QAction(MainWindow) self.actionEdit_postproc_config.setObjectName("actionEdit_postproc_config") - self.actionDe_activate_master_frames = QtWidgets.QAction(MainWindow) + self.actionDe_activate_master_frames = QAction(MainWindow) self.actionDe_activate_master_frames.setObjectName("actionDe_activate_master_frames") - self.actionLoad_master_dark_frame = QtWidgets.QAction(MainWindow) + self.actionLoad_master_dark_frame = QAction(MainWindow) self.actionLoad_master_dark_frame.setObjectName("actionLoad_master_dark_frame") - self.actionLoad_master_flat_frame = QtWidgets.QAction(MainWindow) + self.actionLoad_master_flat_frame = QAction(MainWindow) self.actionLoad_master_flat_frame.setObjectName("actionLoad_master_flat_frame") - self.actionCreate_new_master_dark_frame = QtWidgets.QAction(MainWindow) + self.actionCreate_new_master_dark_frame = QAction(MainWindow) self.actionCreate_new_master_dark_frame.setObjectName("actionCreate_new_master_dark_frame") - self.actionCreate_new_master_flat_frame = QtWidgets.QAction(MainWindow) + self.actionCreate_new_master_flat_frame = QAction(MainWindow) self.actionCreate_new_master_flat_frame.setObjectName("actionCreate_new_master_flat_frame") - self.actionAbout = QtWidgets.QAction(MainWindow) + self.actionAbout = QAction(MainWindow) self.actionAbout.setObjectName("actionAbout") - self.actionShow_Quickstart = QtWidgets.QAction(MainWindow) + self.actionShow_Quickstart = QAction(MainWindow) self.actionShow_Quickstart.setCheckable(True) self.actionShow_Quickstart.setChecked(True) self.actionShow_Quickstart.setObjectName("actionShow_Quickstart") diff --git a/planetary_system_stacker/parameter_configuration.py b/planetary_system_stacker/parameter_configuration.py index c9475bb..cde06f8 100644 --- a/planetary_system_stacker/parameter_configuration.py +++ b/planetary_system_stacker/parameter_configuration.py @@ -8,7 +8,7 @@ # run again. Do not edit this file unless you know what you are doing. -from PyQt5 import QtCore, QtGui, QtWidgets +from PyQt6 import QtCore, QtGui, QtWidgets class Ui_ConfigurationDialog(object): @@ -21,17 +21,17 @@ def setupUi(self, ConfigurationDialog): self.GridLayout = QtWidgets.QGridLayout(ConfigurationDialog) self.GridLayout.setVerticalSpacing(22) self.GridLayout.setObjectName("GridLayout") - spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.GridLayout.addItem(spacerItem, 2, 0, 1, 1) self.buttonBox = QtWidgets.QDialogButtonBox(ConfigurationDialog) - self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok) + self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok) self.buttonBox.setObjectName("buttonBox") self.GridLayout.addWidget(self.buttonBox, 2, 2, 1, 2) self.restore_standard_values = QtWidgets.QPushButton(ConfigurationDialog) self.restore_standard_values.setObjectName("restore_standard_values") self.GridLayout.addWidget(self.restore_standard_values, 2, 1, 1, 1) self.tabWidget = QtWidgets.QTabWidget(ConfigurationDialog) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Expanding) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.tabWidget.sizePolicy().hasHeightForWidth()) @@ -42,9 +42,9 @@ def setupUi(self, ConfigurationDialog): self.tab_workflow.setObjectName("tab_workflow") self.gridLayout = QtWidgets.QGridLayout(self.tab_workflow) self.gridLayout.setObjectName("gridLayout") - spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.gridLayout.addItem(spacerItem1, 11, 1, 1, 1) - spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.gridLayout.addItem(spacerItem2, 0, 1, 1, 1) self.nfs_checkBox = QtWidgets.QCheckBox(self.tab_workflow) self.nfs_checkBox.setObjectName("nfs_checkBox") @@ -69,7 +69,7 @@ def setupUi(self, ConfigurationDialog): self.gpif_comboBox = QtWidgets.QComboBox(self.tab_workflow) self.gpif_comboBox.setObjectName("gpif_comboBox") self.gridLayout.addWidget(self.gpif_comboBox, 3, 6, 1, 1) - spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.gridLayout.addItem(spacerItem3, 19, 1, 1, 1) self.nap_checkBox = QtWidgets.QCheckBox(self.tab_workflow) self.nap_checkBox.setObjectName("nap_checkBox") @@ -83,41 +83,41 @@ def setupUi(self, ConfigurationDialog): self.apbs_checkBox = QtWidgets.QCheckBox(self.tab_workflow) self.apbs_checkBox.setObjectName("apbs_checkBox") self.gridLayout.addWidget(self.apbs_checkBox, 9, 5, 1, 2) - spacerItem4 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + spacerItem4 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.gridLayout.addItem(spacerItem4, 17, 1, 1, 1) self.gpbl_combobox = QtWidgets.QComboBox(self.tab_workflow) self.gpbl_combobox.setObjectName("gpbl_combobox") self.gridLayout.addWidget(self.gpbl_combobox, 12, 2, 1, 1) - spacerItem5 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + spacerItem5 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.gridLayout.addItem(spacerItem5, 4, 1, 1, 1) - spacerItem6 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + spacerItem6 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.gridLayout.addItem(spacerItem6, 2, 1, 1, 1) self.gpbl_label_parameter = QtWidgets.QLabel(self.tab_workflow) - self.gpbl_label_parameter.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) + self.gpbl_label_parameter.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeading|QtCore.Qt.AlignmentFlag.AlignLeft|QtCore.Qt.AlignmentFlag.AlignVCenter) self.gpbl_label_parameter.setObjectName("gpbl_label_parameter") self.gridLayout.addWidget(self.gpbl_label_parameter, 12, 1, 1, 1) self.gppl_label_parameter = QtWidgets.QLabel(self.tab_workflow) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.gppl_label_parameter.sizePolicy().hasHeightForWidth()) self.gppl_label_parameter.setSizePolicy(sizePolicy) - self.gppl_label_parameter.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) + self.gppl_label_parameter.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeading|QtCore.Qt.AlignmentFlag.AlignLeft|QtCore.Qt.AlignmentFlag.AlignVCenter) self.gppl_label_parameter.setObjectName("gppl_label_parameter") self.gridLayout.addWidget(self.gppl_label_parameter, 1, 5, 1, 1) self.gpif_label_parameter = QtWidgets.QLabel(self.tab_workflow) - self.gpif_label_parameter.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) + self.gpif_label_parameter.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeading|QtCore.Qt.AlignmentFlag.AlignLeft|QtCore.Qt.AlignmentFlag.AlignVCenter) self.gpif_label_parameter.setObjectName("gpif_label_parameter") self.gridLayout.addWidget(self.gpif_label_parameter, 3, 5, 1, 1) self.gpwptf_checkBox = QtWidgets.QCheckBox(self.tab_workflow) self.gpwptf_checkBox.setChecked(True) self.gpwptf_checkBox.setObjectName("gpwptf_checkBox") self.gridLayout.addWidget(self.gpwptf_checkBox, 1, 1, 1, 1) - spacerItem7 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + spacerItem7 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.gridLayout.addItem(spacerItem7, 1, 7, 1, 1) self.mr_label = QtWidgets.QLabel(self.tab_workflow) self.mr_label.setText("") - self.mr_label.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) + self.mr_label.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeading|QtCore.Qt.AlignmentFlag.AlignLeft|QtCore.Qt.AlignmentFlag.AlignTop) self.mr_label.setWordWrap(True) self.mr_label.setObjectName("mr_label") self.gridLayout.addWidget(self.mr_label, 12, 4, 7, 4) @@ -128,9 +128,9 @@ def setupUi(self, ConfigurationDialog): self.tab_frames.setObjectName("tab_frames") self.gridLayout_2 = QtWidgets.QGridLayout(self.tab_frames) self.gridLayout_2.setObjectName("gridLayout_2") - spacerItem8 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + spacerItem8 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.gridLayout_2.addItem(spacerItem8, 13, 0, 1, 1) - spacerItem9 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + spacerItem9 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.gridLayout_2.addItem(spacerItem9, 3, 0, 1, 1) self.efs_checkBox = QtWidgets.QCheckBox(self.tab_frames) self.efs_checkBox.setObjectName("efs_checkBox") @@ -154,7 +154,7 @@ def setupUi(self, ConfigurationDialog): self.fgw_slider_value.setPageStep(1) self.fgw_slider_value.setProperty("value", 4) self.fgw_slider_value.setSliderPosition(4) - self.fgw_slider_value.setOrientation(QtCore.Qt.Horizontal) + self.fgw_slider_value.setOrientation(QtCore.Qt.Orientation.Horizontal) self.fgw_slider_value.setObjectName("fgw_slider_value") self.gridLayout_2.addWidget(self.fgw_slider_value, 4, 2, 1, 2) self.afafp_label_parameter = QtWidgets.QLabel(self.tab_frames) @@ -163,12 +163,12 @@ def setupUi(self, ConfigurationDialog): self.fgw_label_display = QtWidgets.QLabel(self.tab_frames) self.fgw_label_display.setObjectName("fgw_label_display") self.gridLayout_2.addWidget(self.fgw_label_display, 4, 5, 1, 1) - spacerItem10 = QtWidgets.QSpacerItem(36, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + spacerItem10 = QtWidgets.QSpacerItem(36, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.gridLayout_2.addItem(spacerItem10, 4, 4, 1, 1) self.afrsf_label_display = QtWidgets.QLabel(self.tab_frames) self.afrsf_label_display.setObjectName("afrsf_label_display") self.gridLayout_2.addWidget(self.afrsf_label_display, 9, 5, 1, 1) - spacerItem11 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + spacerItem11 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.gridLayout_2.addItem(spacerItem11, 11, 0, 1, 1) self.afafp_label_display = QtWidgets.QLabel(self.tab_frames) self.afafp_label_display.setObjectName("afafp_label_display") @@ -188,14 +188,14 @@ def setupUi(self, ConfigurationDialog): self.afafp_slider_value.setSingleStep(3) self.afafp_slider_value.setPageStep(3) self.afafp_slider_value.setProperty("value", 6) - self.afafp_slider_value.setOrientation(QtCore.Qt.Horizontal) + self.afafp_slider_value.setOrientation(QtCore.Qt.Orientation.Horizontal) self.afafp_slider_value.setObjectName("afafp_slider_value") self.gridLayout_2.addWidget(self.afafp_slider_value, 12, 2, 1, 2) - spacerItem12 = QtWidgets.QSpacerItem(40, 25, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + spacerItem12 = QtWidgets.QSpacerItem(40, 25, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.gridLayout_2.addItem(spacerItem12, 4, 1, 1, 1) - spacerItem13 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + spacerItem13 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.gridLayout_2.addItem(spacerItem13, 5, 0, 2, 1) - spacerItem14 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + spacerItem14 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.gridLayout_2.addItem(spacerItem14, 0, 0, 1, 1) self.fdb_label_parameter = QtWidgets.QLabel(self.tab_frames) self.fdb_label_parameter.setObjectName("fdb_label_parameter") @@ -207,7 +207,7 @@ def setupUi(self, ConfigurationDialog): self.afrsf_slider_value.setPageStep(5) self.afrsf_slider_value.setProperty("value", 25) self.afrsf_slider_value.setSliderPosition(25) - self.afrsf_slider_value.setOrientation(QtCore.Qt.Horizontal) + self.afrsf_slider_value.setOrientation(QtCore.Qt.Orientation.Horizontal) self.afrsf_slider_value.setObjectName("afrsf_slider_value") self.gridLayout_2.addWidget(self.afrsf_slider_value, 9, 2, 1, 2) self.afsw_slider_value = QtWidgets.QSlider(self.tab_frames) @@ -216,10 +216,10 @@ def setupUi(self, ConfigurationDialog): self.afsw_slider_value.setSingleStep(5) self.afsw_slider_value.setPageStep(5) self.afsw_slider_value.setProperty("value", 20) - self.afsw_slider_value.setOrientation(QtCore.Qt.Horizontal) + self.afsw_slider_value.setOrientation(QtCore.Qt.Orientation.Horizontal) self.afsw_slider_value.setObjectName("afsw_slider_value") self.gridLayout_2.addWidget(self.afsw_slider_value, 10, 2, 1, 2) - spacerItem15 = QtWidgets.QSpacerItem(271, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + spacerItem15 = QtWidgets.QSpacerItem(271, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.gridLayout_2.addItem(spacerItem15, 4, 6, 1, 1) self.afm_label_parameter = QtWidgets.QLabel(self.tab_frames) self.afm_label_parameter.setObjectName("afm_label_parameter") @@ -266,7 +266,7 @@ def setupUi(self, ConfigurationDialog): self.apsw_slider_value.setSingleStep(2) self.apsw_slider_value.setPageStep(2) self.apsw_slider_value.setProperty("value", 10) - self.apsw_slider_value.setOrientation(QtCore.Qt.Horizontal) + self.apsw_slider_value.setOrientation(QtCore.Qt.Orientation.Horizontal) self.apsw_slider_value.setObjectName("apsw_slider_value") self.gridLayout_3.addWidget(self.apsw_slider_value, 3, 2, 1, 1) self.apst_label_parameter = QtWidgets.QLabel(self.tab_alignment) @@ -277,7 +277,7 @@ def setupUi(self, ConfigurationDialog): self.apst_slider_value.setMaximum(30) self.apst_slider_value.setPageStep(5) self.apst_slider_value.setProperty("value", 5) - self.apst_slider_value.setOrientation(QtCore.Qt.Horizontal) + self.apst_slider_value.setOrientation(QtCore.Qt.Orientation.Horizontal) self.apst_slider_value.setObjectName("apst_slider_value") self.gridLayout_3.addWidget(self.apst_slider_value, 5, 2, 1, 1) self.apsw_label_display = QtWidgets.QLabel(self.tab_alignment) @@ -295,17 +295,17 @@ def setupUi(self, ConfigurationDialog): self.aphbw_slider_value.setSingleStep(4) self.aphbw_slider_value.setPageStep(4) self.aphbw_slider_value.setProperty("value", 40) - self.aphbw_slider_value.setOrientation(QtCore.Qt.Horizontal) + self.aphbw_slider_value.setOrientation(QtCore.Qt.Orientation.Horizontal) self.aphbw_slider_value.setObjectName("aphbw_slider_value") self.gridLayout_3.addWidget(self.aphbw_slider_value, 1, 2, 1, 1) self.aphbw_label_display = QtWidgets.QLabel(self.tab_alignment) self.aphbw_label_display.setObjectName("aphbw_label_display") self.gridLayout_3.addWidget(self.aphbw_label_display, 1, 4, 1, 1) - spacerItem16 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + spacerItem16 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.gridLayout_3.addItem(spacerItem16, 8, 1, 1, 1) - spacerItem17 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + spacerItem17 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.gridLayout_3.addItem(spacerItem17, 1, 1, 1, 1) - spacerItem18 = QtWidgets.QSpacerItem(44, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + spacerItem18 = QtWidgets.QSpacerItem(44, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.gridLayout_3.addItem(spacerItem18, 1, 3, 1, 1) self.apbt_slider_value = QtWidgets.QSlider(self.tab_alignment) self.apbt_slider_value.setMinimum(2) @@ -313,17 +313,17 @@ def setupUi(self, ConfigurationDialog): self.apbt_slider_value.setSingleStep(2) self.apbt_slider_value.setPageStep(2) self.apbt_slider_value.setProperty("value", 10) - self.apbt_slider_value.setOrientation(QtCore.Qt.Horizontal) + self.apbt_slider_value.setOrientation(QtCore.Qt.Orientation.Horizontal) self.apbt_slider_value.setObjectName("apbt_slider_value") self.gridLayout_3.addWidget(self.apbt_slider_value, 7, 2, 1, 1) - spacerItem19 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + spacerItem19 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.gridLayout_3.addItem(spacerItem19, 1, 5, 1, 1) self.apbt_label_parameter = QtWidgets.QLabel(self.tab_alignment) self.apbt_label_parameter.setObjectName("apbt_label_parameter") self.gridLayout_3.addWidget(self.apbt_label_parameter, 7, 0, 1, 1) - spacerItem20 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + spacerItem20 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.gridLayout_3.addItem(spacerItem20, 2, 0, 1, 1) - spacerItem21 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + spacerItem21 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.gridLayout_3.addItem(spacerItem21, 4, 0, 1, 1) self.apbt_label_display = QtWidgets.QLabel(self.tab_alignment) self.apbt_label_display.setObjectName("apbt_label_display") @@ -331,9 +331,9 @@ def setupUi(self, ConfigurationDialog): self.aphbw_label_parameter = QtWidgets.QLabel(self.tab_alignment) self.aphbw_label_parameter.setObjectName("aphbw_label_parameter") self.gridLayout_3.addWidget(self.aphbw_label_parameter, 1, 0, 1, 1) - spacerItem22 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + spacerItem22 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.gridLayout_3.addItem(spacerItem22, 6, 0, 1, 1) - spacerItem23 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + spacerItem23 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.gridLayout_3.addItem(spacerItem23, 0, 0, 1, 1) self.gridLayout_3.setColumnStretch(0, 3) self.gridLayout_3.setColumnStretch(1, 1) @@ -361,34 +361,34 @@ def setupUi(self, ConfigurationDialog): self.fnt_label_display = QtWidgets.QLabel(self.tab_stacking) self.fnt_label_display.setObjectName("fnt_label_display") self.gridLayout_4.addWidget(self.fnt_label_display, 4, 4, 1, 1) - spacerItem24 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + spacerItem24 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.gridLayout_4.addItem(spacerItem24, 2, 0, 1, 1) self.fn_checkBox = QtWidgets.QCheckBox(self.tab_stacking) self.fn_checkBox.setObjectName("fn_checkBox") self.gridLayout_4.addWidget(self.fn_checkBox, 3, 0, 1, 3) - spacerItem25 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + spacerItem25 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.gridLayout_4.addItem(spacerItem25, 0, 0, 1, 1) self.fnt_slider_value = QtWidgets.QSlider(self.tab_stacking) self.fnt_slider_value.setMaximum(40) self.fnt_slider_value.setPageStep(2) - self.fnt_slider_value.setOrientation(QtCore.Qt.Horizontal) + self.fnt_slider_value.setOrientation(QtCore.Qt.Orientation.Horizontal) self.fnt_slider_value.setObjectName("fnt_slider_value") self.gridLayout_4.addWidget(self.fnt_slider_value, 4, 2, 1, 1) self.sfdfs_label_parameter = QtWidgets.QLabel(self.tab_stacking) self.sfdfs_label_parameter.setObjectName("sfdfs_label_parameter") self.gridLayout_4.addWidget(self.sfdfs_label_parameter, 6, 0, 1, 1) - spacerItem26 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + spacerItem26 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.gridLayout_4.addItem(spacerItem26, 5, 0, 1, 1) - spacerItem27 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + spacerItem27 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.gridLayout_4.addItem(spacerItem27, 7, 0, 1, 1) self.sfdfs_comboBox = QtWidgets.QComboBox(self.tab_stacking) self.sfdfs_comboBox.setObjectName("sfdfs_comboBox") self.gridLayout_4.addWidget(self.sfdfs_comboBox, 6, 2, 1, 1) - spacerItem28 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + spacerItem28 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.gridLayout_4.addItem(spacerItem28, 4, 1, 1, 1) - spacerItem29 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + spacerItem29 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.gridLayout_4.addItem(spacerItem29, 4, 3, 1, 1) - spacerItem30 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + spacerItem30 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.gridLayout_4.addItem(spacerItem30, 4, 5, 1, 1) self.apfp_comboBox = QtWidgets.QComboBox(self.tab_stacking) self.apfp_comboBox.setObjectName("apfp_comboBox") diff --git a/planetary_system_stacker/planetary_system_stacker.py b/planetary_system_stacker/planetary_system_stacker.py index cafd85e..75117d9 100644 --- a/planetary_system_stacker/planetary_system_stacker.py +++ b/planetary_system_stacker/planetary_system_stacker.py @@ -39,7 +39,7 @@ matplotlib.use('Agg') import numpy as np import psutil -from PyQt5 import QtWidgets, QtCore, QtGui +from PyQt6 import QtWidgets, QtCore, QtGui from numpy import uint8, uint16 import scipy import astropy @@ -64,7 +64,6 @@ from workflow import Workflow from pss_console import PssConsole -QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling, True) os.environ["QT_AUTO_SCREEN_SCALE_FACTOR"] = "1" @@ -452,10 +451,9 @@ def load_config_file(self): :return: - """ - options = QtWidgets.QFileDialog.Options() filename = QtWidgets.QFileDialog.getOpenFileName(self, "Load configuration file", self.configuration.hidden_parameters_current_dir, - "*.pss", options=options) + "*.pss") file_name = filename[0] # If a valid file was selected, read parameters from the file and open the configuration @@ -482,11 +480,9 @@ def save_config_file(self): """ # Open the file chooser. - options = QtWidgets.QFileDialog.Options() filename = QtWidgets.QFileDialog.getSaveFileName(self, "Save configuration file", self.configuration.hidden_parameters_current_dir, - "Config file (*.pss)", - options=options) + "Config file (*.pss)") # Store file only if the chooser did not return with a cancel. file_name = filename[0] @@ -534,19 +530,18 @@ def create_master_dark(self): :return: - """ - options = QtWidgets.QFileDialog.Options() message = "Select a video file / a folder with image files for computing a master dark" \ " frame" file_dialog = FileDialog(self, message, self.configuration.hidden_parameters_current_dir, - "Videos (*.avi *.mov *.mp4 *.ser)", options=options) + "Videos (*.avi *.mov *.mp4 *.ser)") file_dialog.setNameFilters(["Still image folder / video file (*.avi *.mov *.mp4 *.ser)"]) # The list of strings (length 1) with the path name to the dark frames is sent by the # FileDialog via the signal "signal_dialog_ready". file_dialog.signal_dialog_ready.connect(self.workflow.execute_create_master_dark) - file_dialog.exec_() + file_dialog.exec() @QtCore.pyqtSlot(bool) def master_dark_created(self, success): @@ -560,12 +555,10 @@ def master_dark_created(self, success): """ if success: - options = QtWidgets.QFileDialog.Options() master_dark_file = QtWidgets.QFileDialog.getSaveFileName(self, "Choose a file name for the new master dark frame", self.configuration.hidden_parameters_current_dir, - "Images (*png *.tiff *.fits)", - options=options) + "Images (*png *.tiff *.fits)") if master_dark_file[0]: Frames.save_image(master_dark_file[0], @@ -593,11 +586,10 @@ def load_master_dark(self): :return: - """ - options = QtWidgets.QFileDialog.Options() master_dark_file = QtWidgets.QFileDialog.getOpenFileName(self, "Select image file containing a master dark frame", self.configuration.hidden_parameters_current_dir, - "Images (*png *.tiff *.fits)", options=options) + "Images (*png *.tiff *.fits)") if master_dark_file[0]: self.signal_load_master_dark.emit(master_dark_file[0]) @@ -617,19 +609,18 @@ def create_master_flat(self): :return: - """ - options = QtWidgets.QFileDialog.Options() message = "Select a video file / a folder with image files for computing a master flat" \ " frame" file_dialog = FileDialog(self, message, self.configuration.hidden_parameters_current_dir, - "Videos (*.avi *.mov *.mp4 *.ser)", options=options) + "Videos (*.avi *.mov *.mp4 *.ser)") file_dialog.setNameFilters(["Still image folder / video file (*.avi *.mov *.mp4 *.ser)"]) # The list of strings (length 1) with the path name to the flat frames is sent by the # FileDialog via the signal "signal_dialog_ready". file_dialog.signal_dialog_ready.connect(self.workflow.execute_create_master_flat) - file_dialog.exec_() + file_dialog.exec() @QtCore.pyqtSlot(bool) def master_flat_created(self, success): @@ -643,12 +634,10 @@ def master_flat_created(self, success): """ if success: - options = QtWidgets.QFileDialog.Options() master_flat_file = QtWidgets.QFileDialog.getSaveFileName(self, "Choose a file name for the new master flat frame", self.configuration.hidden_parameters_current_dir, - "Images (*png *.tiff *.fits)", - options=options) + "Images (*png *.tiff *.fits)") if master_flat_file[0]: Frames.save_image(master_flat_file[0], @@ -676,11 +665,10 @@ def load_master_flat(self): :return: - """ - options = QtWidgets.QFileDialog.Options() master_flat_file = QtWidgets.QFileDialog.getOpenFileName(self, "Select image file containing a master dark frame", self.configuration.hidden_parameters_current_dir, - "Images (*png *.tiff *.fits)", options=options) + "Images (*png *.tiff *.fits)") if master_flat_file[0]: self.signal_load_master_flat.emit(master_flat_file[0]) @@ -1046,11 +1034,11 @@ def report_error(self, message): if not self.automatic: msg = QtWidgets.QMessageBox() msg.setText(message) - msg.setIcon(QtWidgets.QMessageBox.Critical) + msg.setIcon(QtWidgets.QMessageBox.Icon.Critical) msg.setWindowTitle(self.configuration.global_parameters_version) msg.setWindowIcon(QtGui.QIcon(self.configuration.window_icon)) - msg.setStandardButtons(QtWidgets.QMessageBox.Ok) - msg.exec_() + msg.setStandardButtons(QtWidgets.QMessageBox.StandardButton.Ok) + msg.exec() if self.configuration.global_parameters_protocol_level > 0: Miscellaneous.protocol(message + "\n", self.workflow.attached_log_file,) @@ -1074,10 +1062,9 @@ def save_result_as(self): :return: - """ - options = QtWidgets.QFileDialog.Options() filename, extension = QtWidgets.QFileDialog.getSaveFileName(self, "Save result as 16bit Png, Tiff or Fits image", self.workflow.stacked_image_name, - "Image Files (*png *.tiff *.fits)", options=options) + "Image Files (*png *.tiff *.fits)") if filename and extension: Frames.save_image(filename, self.workflow.stack_frames.stacked_image, @@ -1406,10 +1393,10 @@ def closeEvent(self, event=None): quit_msg = "Are you sure you want to exit?" reply = QtWidgets.QMessageBox.question(self, self.configuration.global_parameters_version, quit_msg, - QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No, - QtWidgets.QMessageBox.No) + QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No, + QtWidgets.QMessageBox.StandardButton.No) # Positive reply: Do it. - if reply == QtWidgets.QMessageBox.Yes: + if reply == QtWidgets.QMessageBox.StandardButton.Yes: if event: event.accept() @@ -1418,7 +1405,7 @@ def closeEvent(self, event=None): self.workflow.attached_log_file.close() # Store the geometry of main window, so it is placed the same at next program start. - if self.windowState() == QtCore.Qt.WindowMaximized: + if self.windowState() == QtCore.Qt.WindowState.WindowMaximized: self.configuration.hidden_parameters_main_window_maximized = True else: (x0, y0, width, height) = self.geometry().getRect() @@ -1458,13 +1445,13 @@ def main(): # app.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling) myapp = PlanetarySystemStacker() myapp.show() - exit(app.exec_()) + exit(app.exec()) # If command line arguments are passed, execute PSS without a GUI. else: app = QtCore.QCoreApplication(argv) PssConsole() - exit(app.exec_()) + exit(app.exec()) if __name__ == "__main__": main() diff --git a/planetary_system_stacker/postproc_editor.py b/planetary_system_stacker/postproc_editor.py index 88839bc..beb51dd 100644 --- a/planetary_system_stacker/postproc_editor.py +++ b/planetary_system_stacker/postproc_editor.py @@ -27,8 +27,8 @@ from time import sleep import psutil -from PyQt5 import QtWidgets, QtCore -from PyQt5.QtWidgets import QProxyStyle, QStyle +from PyQt6 import QtWidgets, QtCore +from PyQt6.QtWidgets import QProxyStyle, QStyle from cv2 import imread, cvtColor, COLOR_BGR2RGB, GaussianBlur, bilateralFilter, BORDER_DEFAULT, \ COLOR_BGR2HSV, COLOR_HSV2BGR from numpy import uint8, uint16, float32 @@ -360,25 +360,25 @@ def remove_layer(self): self.remove_layer_callback(self.layer_index) -class CustomStyle(QProxyStyle): - """ - This class is used to prevent the version spinbox from jumping two steps at once. The solution - was found on Stackoverflow - (https://stackoverflow.com/questions/40746350/why-qspinbox-jumps-twice-the-step-value). +# class CustomStyle(QProxyStyle): +# """ +# This class is used to prevent the version spinbox from jumping two steps at once. The solution +# was found on Stackoverflow +# (https://stackoverflow.com/questions/40746350/why-qspinbox-jumps-twice-the-step-value). - """ +# """ - def styleHint(self, hint, option=None, widget=None, returnData=None): - if hint == QStyle.SH_SpinBox_KeyPressAutoRepeatRate: - return 10**6 - elif hint == QStyle.SH_SpinBox_ClickAutoRepeatRate: - return 10**6 - elif hint == QStyle.SH_SpinBox_ClickAutoRepeatThreshold: - # You can use only this condition to avoid the auto-repeat, - # but better safe than sorry ;-) - return 10**6 - else: - return super().styleHint(hint, option, widget, returnData) +# def styleHint(self, hint, option=None, widget=None, returnData=None): +# if hint == QStyle.SH_SpinBox_KeyPressAutoRepeatRate: +# return 10**6 +# elif hint == QStyle.SH_SpinBox_ClickAutoRepeatRate: +# return 10**6 +# elif hint == QStyle.SH_SpinBox_ClickAutoRepeatThreshold: +# # You can use only this condition to avoid the auto-repeat, +# # but better safe than sorry ;-) +# return 10**6 +# else: +# return super().styleHint(hint, option, widget, returnData) class VersionManagerWidget(QtWidgets.QWidget, Ui_version_manager_widget): @@ -423,8 +423,8 @@ def __init__(self, configuration, parent=None): self.spinBox_version.setMinimum(0) self.spinBox_compare.setMaximum(configuration.postproc_data_object.number_versions) self.spinBox_compare.setMinimum(0) - self.spinBox_version.setStyle(CustomStyle()) - self.spinBox_compare.setStyle(CustomStyle()) + #self.spinBox_version.setStyle(CustomStyle()) + #self.spinBox_compare.setStyle(CustomStyle()) # Set the spinbox to the newly created version. self.spinBox_version.setValue(self.postproc_data_object.version_selected) @@ -1335,8 +1335,8 @@ def __init__(self, configuration, image_original, name_original, set_status_bar_ # Initialize a vertical spacer used to fill the lower part of the sharpening widget scroll # area. - self.spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, - QtWidgets.QSizePolicy.Expanding) + self.spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, + QtWidgets.QSizePolicy.Policy.Expanding) # Set the resolution index to an impossible value. It is used to check for changes. self.rgb_resolution_index = -1 @@ -1427,7 +1427,7 @@ def disable_widgets(self): self.version_manager_widget.setEnabled(False) self.tabWidget_postproc_control.setEnabled(False) - self.buttonBox.button(QtWidgets.QDialogButtonBox.Ok).setEnabled(False) + self.buttonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Ok).setEnabled(False) def enable_widgets(self): """ @@ -1438,7 +1438,7 @@ def enable_widgets(self): self.version_manager_widget.setEnabled(True) self.tabWidget_postproc_control.setEnabled(True) - self.buttonBox.button(QtWidgets.QDialogButtonBox.Ok).setEnabled(True) + self.buttonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Ok).setEnabled(True) def fgw_changed(self, value): """ @@ -1484,7 +1484,7 @@ def tab_changed(self, index): self.finish_rgb_correction_mode() def rgb_automatic_changed(self, state): - rgb_on = state == QtCore.Qt.Checked + rgb_on = state == QtCore.Qt.CheckState.Checked version = self.postproc_data_object.versions[ self.postproc_data_object.version_selected] version.rgb_automatic = rgb_on diff --git a/planetary_system_stacker/postproc_editor_gui.py b/planetary_system_stacker/postproc_editor_gui.py index 4f911a3..ded2a16 100644 --- a/planetary_system_stacker/postproc_editor_gui.py +++ b/planetary_system_stacker/postproc_editor_gui.py @@ -7,16 +7,16 @@ # WARNING! All changes made in this file will be lost! -from PyQt5 import QtCore, QtGui, QtWidgets +from PyQt6 import QtCore, QtGui, QtWidgets class Ui_postproc_editor(object): def setupUi(self, postproc_editor): postproc_editor.setObjectName("postproc_editor") postproc_editor.resize(865, 758) - postproc_editor.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) - postproc_editor.setFrameShape(QtWidgets.QFrame.Panel) - postproc_editor.setFrameShadow(QtWidgets.QFrame.Sunken) + postproc_editor.setLocale(QtCore.QLocale(QtCore.QLocale.Language.English, QtCore.QLocale.Country.UnitedStates)) + postproc_editor.setFrameShape(QtWidgets.QFrame.Shape.Panel) + postproc_editor.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) self.gridLayout = QtWidgets.QGridLayout(postproc_editor) self.gridLayout.setObjectName("gridLayout") self.VersionManagerWidget = QtWidgets.QLabel(postproc_editor) @@ -52,7 +52,7 @@ def setupUi(self, postproc_editor): self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.group_general) self.verticalLayout_3.setObjectName("verticalLayout_3") self.checkBox_automatic = QtWidgets.QCheckBox(self.group_general) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.checkBox_automatic.sizePolicy().hasHeightForWidth()) @@ -63,7 +63,7 @@ def setupUi(self, postproc_editor): self.gridLayout_2 = QtWidgets.QGridLayout() self.gridLayout_2.setObjectName("gridLayout_2") self.fgw_label_parameter = QtWidgets.QLabel(self.group_general) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.fgw_label_parameter.sizePolicy().hasHeightForWidth()) @@ -71,17 +71,17 @@ def setupUi(self, postproc_editor): self.fgw_label_parameter.setMinimumSize(QtCore.QSize(0, 0)) self.fgw_label_parameter.setObjectName("fgw_label_parameter") self.gridLayout_2.addWidget(self.fgw_label_parameter, 1, 0, 1, 1) - spacerItem = QtWidgets.QSpacerItem(36, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + spacerItem = QtWidgets.QSpacerItem(36, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.gridLayout_2.addItem(spacerItem, 1, 4, 1, 1) - spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.gridLayout_2.addItem(spacerItem1, 1, 6, 1, 1) - spacerItem2 = QtWidgets.QSpacerItem(40, 25, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + spacerItem2 = QtWidgets.QSpacerItem(40, 25, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.gridLayout_2.addItem(spacerItem2, 1, 1, 1, 1) self.fgw_label_display = QtWidgets.QLabel(self.group_general) self.fgw_label_display.setObjectName("fgw_label_display") self.gridLayout_2.addWidget(self.fgw_label_display, 1, 5, 1, 1) self.label_resolution = QtWidgets.QLabel(self.group_general) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.label_resolution.sizePolicy().hasHeightForWidth()) @@ -90,7 +90,7 @@ def setupUi(self, postproc_editor): self.label_resolution.setObjectName("label_resolution") self.gridLayout_2.addWidget(self.label_resolution, 0, 0, 1, 1) self.comboBox_resolution = QtWidgets.QComboBox(self.group_general) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.comboBox_resolution.sizePolicy().hasHeightForWidth()) @@ -98,7 +98,7 @@ def setupUi(self, postproc_editor): self.comboBox_resolution.setMinimumSize(QtCore.QSize(90, 0)) self.comboBox_resolution.setObjectName("comboBox_resolution") self.gridLayout_2.addWidget(self.comboBox_resolution, 0, 2, 1, 1) - spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.gridLayout_2.addItem(spacerItem3, 0, 3, 1, 1) self.fgw_slider_value = QtWidgets.QSlider(self.group_general) self.fgw_slider_value.setMinimum(1) @@ -107,7 +107,7 @@ def setupUi(self, postproc_editor): self.fgw_slider_value.setPageStep(1) self.fgw_slider_value.setProperty("value", 4) self.fgw_slider_value.setSliderPosition(4) - self.fgw_slider_value.setOrientation(QtCore.Qt.Horizontal) + self.fgw_slider_value.setOrientation(QtCore.Qt.Orientation.Horizontal) self.fgw_slider_value.setObjectName("fgw_slider_value") self.gridLayout_2.addWidget(self.fgw_slider_value, 1, 2, 1, 2) self.gridLayout_2.setColumnStretch(1, 1) @@ -118,7 +118,7 @@ def setupUi(self, postproc_editor): self.verticalLayout_3.setStretch(0, 1) self.verticalLayout_3.setStretch(1, 2) self.verticalLayout_4.addWidget(self.group_general) - spacerItem4 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + spacerItem4 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.verticalLayout_4.addItem(spacerItem4) self.group_red = QtWidgets.QGroupBox(self.tab_rgb) font = QtGui.QFont() @@ -134,7 +134,7 @@ def setupUi(self, postproc_editor): self.gridLayout_3.addWidget(self.pushButton_red_up, 1, 2, 1, 1) self.label_red_left = QtWidgets.QLabel(self.group_red) self.label_red_left.setStyleSheet("QLabel { color :red; }") - self.label_red_left.setAlignment(QtCore.Qt.AlignCenter) + self.label_red_left.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) self.label_red_left.setObjectName("label_red_left") self.gridLayout_3.addWidget(self.label_red_left, 2, 0, 1, 1) self.pushButton_red_down = QtWidgets.QPushButton(self.group_red) @@ -143,7 +143,7 @@ def setupUi(self, postproc_editor): self.gridLayout_3.addWidget(self.pushButton_red_down, 3, 2, 1, 1) self.label_red_down = QtWidgets.QLabel(self.group_red) self.label_red_down.setStyleSheet("QLabel { color :red; }") - self.label_red_down.setAlignment(QtCore.Qt.AlignCenter) + self.label_red_down.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) self.label_red_down.setObjectName("label_red_down") self.gridLayout_3.addWidget(self.label_red_down, 4, 2, 1, 1) self.pushButton_red_reset = QtWidgets.QPushButton(self.group_red) @@ -151,13 +151,13 @@ def setupUi(self, postproc_editor): self.gridLayout_3.addWidget(self.pushButton_red_reset, 2, 2, 1, 1) self.label_red_right = QtWidgets.QLabel(self.group_red) self.label_red_right.setStyleSheet("QLabel { color :red; }") - self.label_red_right.setAlignment(QtCore.Qt.AlignCenter) + self.label_red_right.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) self.label_red_right.setObjectName("label_red_right") self.gridLayout_3.addWidget(self.label_red_right, 2, 4, 1, 1) self.label_red_up = QtWidgets.QLabel(self.group_red) - self.label_red_up.setLayoutDirection(QtCore.Qt.LeftToRight) + self.label_red_up.setLayoutDirection(QtCore.Qt.LayoutDirection.LeftToRight) self.label_red_up.setStyleSheet("QLabel { color :red; }") - self.label_red_up.setAlignment(QtCore.Qt.AlignCenter) + self.label_red_up.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) self.label_red_up.setObjectName("label_red_up") self.gridLayout_3.addWidget(self.label_red_up, 0, 2, 1, 1) self.pushButton_red_left = QtWidgets.QPushButton(self.group_red) @@ -179,7 +179,7 @@ def setupUi(self, postproc_editor): self.gridLayout_4.setObjectName("gridLayout_4") self.label_blue_up = QtWidgets.QLabel(self.group_blue) self.label_blue_up.setStyleSheet("QLabel { color :blue; }") - self.label_blue_up.setAlignment(QtCore.Qt.AlignCenter) + self.label_blue_up.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) self.label_blue_up.setObjectName("label_blue_up") self.gridLayout_4.addWidget(self.label_blue_up, 0, 2, 1, 1) self.pushButton_blue_up = QtWidgets.QPushButton(self.group_blue) @@ -188,7 +188,7 @@ def setupUi(self, postproc_editor): self.gridLayout_4.addWidget(self.pushButton_blue_up, 1, 2, 1, 1) self.label_blue_left = QtWidgets.QLabel(self.group_blue) self.label_blue_left.setStyleSheet("QLabel { color :blue; }") - self.label_blue_left.setAlignment(QtCore.Qt.AlignCenter) + self.label_blue_left.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) self.label_blue_left.setObjectName("label_blue_left") self.gridLayout_4.addWidget(self.label_blue_left, 2, 0, 1, 1) self.pushButton_blue_left = QtWidgets.QPushButton(self.group_blue) @@ -204,7 +204,7 @@ def setupUi(self, postproc_editor): self.gridLayout_4.addWidget(self.pushButton_blue_right, 2, 3, 1, 1) self.label_blue_right = QtWidgets.QLabel(self.group_blue) self.label_blue_right.setStyleSheet("QLabel { color :blue; }") - self.label_blue_right.setAlignment(QtCore.Qt.AlignCenter) + self.label_blue_right.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) self.label_blue_right.setObjectName("label_blue_right") self.gridLayout_4.addWidget(self.label_blue_right, 2, 4, 1, 1) self.pushButton_blue_down = QtWidgets.QPushButton(self.group_blue) @@ -213,7 +213,7 @@ def setupUi(self, postproc_editor): self.gridLayout_4.addWidget(self.pushButton_blue_down, 3, 2, 1, 1) self.label_blue_down = QtWidgets.QLabel(self.group_blue) self.label_blue_down.setStyleSheet("QLabel { color :blue; }") - self.label_blue_down.setAlignment(QtCore.Qt.AlignCenter) + self.label_blue_down.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) self.label_blue_down.setObjectName("label_blue_down") self.gridLayout_4.addWidget(self.label_blue_down, 4, 2, 1, 1) self.verticalLayout_4.addWidget(self.group_blue) @@ -225,7 +225,7 @@ def setupUi(self, postproc_editor): self.gridLayout.addWidget(self.tabWidget_postproc_control, 0, 2, 1, 2) self.FrameViewer = QtWidgets.QLabel(postproc_editor) self.FrameViewer.setText("") - self.FrameViewer.setAlignment(QtCore.Qt.AlignCenter) + self.FrameViewer.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) self.FrameViewer.setObjectName("FrameViewer") self.gridLayout.addWidget(self.FrameViewer, 0, 1, 1, 1) self.label_zoom = QtWidgets.QLabel(postproc_editor) @@ -233,14 +233,14 @@ def setupUi(self, postproc_editor): font.setBold(False) font.setWeight(50) self.label_zoom.setFont(font) - self.label_zoom.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) + self.label_zoom.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter) self.label_zoom.setObjectName("label_zoom") self.gridLayout.addWidget(self.label_zoom, 2, 1, 1, 1) self.label_message = QtWidgets.QLabel(postproc_editor) self.label_message.setObjectName("label_message") self.gridLayout.addWidget(self.label_message, 2, 0, 1, 1) self.buttonBox = QtWidgets.QDialogButtonBox(postproc_editor) - self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok) + self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok) self.buttonBox.setObjectName("buttonBox") self.gridLayout.addWidget(self.buttonBox, 2, 2, 1, 1) self.gridLayout.setColumnStretch(0, 4) diff --git a/planetary_system_stacker/pss_console.py b/planetary_system_stacker/pss_console.py index fa1b66b..12c223d 100644 --- a/planetary_system_stacker/pss_console.py +++ b/planetary_system_stacker/pss_console.py @@ -2,7 +2,7 @@ from time import sleep from glob import glob -from PyQt5 import QtCore +from PyQt6 import QtCore from configuration import Configuration from exceptions import InternalError diff --git a/planetary_system_stacker/quickstart_gui.py b/planetary_system_stacker/quickstart_gui.py index 461769b..2b827e8 100644 --- a/planetary_system_stacker/quickstart_gui.py +++ b/planetary_system_stacker/quickstart_gui.py @@ -8,7 +8,7 @@ # run again. Do not edit this file unless you know what you are doing. -from PyQt5 import QtCore, QtGui, QtWidgets +from PyQt6 import QtCore, QtGui, QtWidgets class Ui_Form(object): @@ -22,11 +22,11 @@ def setupUi(self, Form): font = QtGui.QFont() font.setPointSize(10) self.label.setFont(font) - self.label.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) + self.label.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeading|QtCore.Qt.AlignmentFlag.AlignLeft|QtCore.Qt.AlignmentFlag.AlignTop) self.label.setWordWrap(True) self.label.setObjectName("label") self.verticalLayout.addWidget(self.label) - spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.verticalLayout.addItem(spacerItem) self.dont_show_checkBox = QtWidgets.QCheckBox(Form) self.dont_show_checkBox.setObjectName("dont_show_checkBox") diff --git a/planetary_system_stacker/rectangular_patch_editor.py b/planetary_system_stacker/rectangular_patch_editor.py index 4b31d63..4f85751 100644 --- a/planetary_system_stacker/rectangular_patch_editor.py +++ b/planetary_system_stacker/rectangular_patch_editor.py @@ -26,7 +26,7 @@ from sys import argv, exit from time import time -from PyQt5 import QtCore, QtWidgets +from PyQt6 import QtCore, QtWidgets from numpy import uint8, uint16, int32 from align_frames import AlignFrames @@ -83,7 +83,7 @@ def mousePressEvent(self, event): y = int(pos.y()) # The left button is pressed. - if event.button() == QtCore.Qt.LeftButton: + if event.button() == QtCore.Qt.MouseButton.LeftButton: self.left_button_pressed = True # Remember the location. @@ -102,7 +102,7 @@ def mouseReleaseEvent(self, event): if not self.photo_editor.drag_mode and self.photo_editor.hasPhoto(): # The left button is released. - if event.button() == QtCore.Qt.LeftButton: + if event.button() == QtCore.Qt.MouseButton.LeftButton: self.left_button_pressed = False # If a rectangular patch has been defined, store its coordinates. @@ -398,4 +398,3 @@ def reject(self): + str(border+window.x_high)) exit() - diff --git a/planetary_system_stacker/rectangular_patch_editor_gui.py b/planetary_system_stacker/rectangular_patch_editor_gui.py index 34fc4d3..ee4ba3a 100644 --- a/planetary_system_stacker/rectangular_patch_editor_gui.py +++ b/planetary_system_stacker/rectangular_patch_editor_gui.py @@ -6,21 +6,21 @@ # # WARNING! All changes made in this file will be lost! -from PyQt5 import QtCore, QtGui, QtWidgets +from PyQt6 import QtCore, QtGui, QtWidgets class Ui_rectangular_patch_editor(object): def setupUi(self, rectangular_patch_editor): rectangular_patch_editor.setObjectName("rectangular_patch_editor") rectangular_patch_editor.resize(900, 630) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Preferred) sizePolicy.setHorizontalStretch(1) sizePolicy.setVerticalStretch(1) sizePolicy.setHeightForWidth(rectangular_patch_editor.sizePolicy().hasHeightForWidth()) rectangular_patch_editor.setSizePolicy(sizePolicy) - rectangular_patch_editor.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) - rectangular_patch_editor.setFrameShape(QtWidgets.QFrame.Panel) - rectangular_patch_editor.setFrameShadow(QtWidgets.QFrame.Sunken) + rectangular_patch_editor.setLocale(QtCore.QLocale(QtCore.QLocale.Language.English, QtCore.QLocale.Country.UnitedStates)) + rectangular_patch_editor.setFrameShape(QtWidgets.QFrame.Shape.Panel) + rectangular_patch_editor.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) self.verticalLayout = QtWidgets.QVBoxLayout(rectangular_patch_editor) self.verticalLayout.setObjectName("verticalLayout") self.horizontalLayout = QtWidgets.QHBoxLayout() @@ -28,10 +28,10 @@ def setupUi(self, rectangular_patch_editor): self.messageLabel = QtWidgets.QLabel(rectangular_patch_editor) self.messageLabel.setObjectName("messageLabel") self.horizontalLayout.addWidget(self.messageLabel) - spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.horizontalLayout.addItem(spacerItem) self.buttonBox = QtWidgets.QDialogButtonBox(rectangular_patch_editor) - self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok) + self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok) self.buttonBox.setObjectName("buttonBox") self.horizontalLayout.addWidget(self.buttonBox) self.verticalLayout.addLayout(self.horizontalLayout) @@ -44,5 +44,3 @@ def retranslateUi(self, rectangular_patch_editor): rectangular_patch_editor.setWindowTitle(_translate("rectangular_patch_editor", "Frame")) self.messageLabel.setText(_translate("rectangular_patch_editor", "Message to be displayed")) self.buttonBox.setToolTip(_translate("rectangular_patch_editor", "Press \'OK\' to save the selection and exit, or \'cancel\' to discard the selection.")) - - diff --git a/planetary_system_stacker/sharpening_layer_widget.py b/planetary_system_stacker/sharpening_layer_widget.py index c94f04a..c225284 100644 --- a/planetary_system_stacker/sharpening_layer_widget.py +++ b/planetary_system_stacker/sharpening_layer_widget.py @@ -8,14 +8,14 @@ # run again. Do not edit this file unless you know what you are doing. -from PyQt5 import QtCore, QtGui, QtWidgets +from PyQt6 import QtCore, QtGui, QtWidgets class Ui_sharpening_layer_widget(object): def setupUi(self, sharpening_layer_widget): sharpening_layer_widget.setObjectName("sharpening_layer_widget") sharpening_layer_widget.resize(311, 227) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(sharpening_layer_widget.sizePolicy().hasHeightForWidth()) @@ -37,7 +37,7 @@ def setupUi(self, sharpening_layer_widget): self.label_radius.setObjectName("label_radius") self.gridLayout.addWidget(self.label_radius, 0, 1, 1, 1) self.pushButton_remove = QtWidgets.QPushButton(self.groupBox_layer) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.pushButton_remove.sizePolicy().hasHeightForWidth()) @@ -47,7 +47,7 @@ def setupUi(self, sharpening_layer_widget): self.pushButton_remove.setObjectName("pushButton_remove") self.gridLayout.addWidget(self.pushButton_remove, 7, 3, 1, 1) self.lineEdit_radius = QtWidgets.QLineEdit(self.groupBox_layer) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.lineEdit_radius.sizePolicy().hasHeightForWidth()) @@ -59,14 +59,14 @@ def setupUi(self, sharpening_layer_widget): self.horizontalSlider_bi_fraction = QtWidgets.QSlider(self.groupBox_layer) self.horizontalSlider_bi_fraction.setMaximum(100) self.horizontalSlider_bi_fraction.setPageStep(5) - self.horizontalSlider_bi_fraction.setOrientation(QtCore.Qt.Horizontal) + self.horizontalSlider_bi_fraction.setOrientation(QtCore.Qt.Orientation.Horizontal) self.horizontalSlider_bi_fraction.setObjectName("horizontalSlider_bi_fraction") self.gridLayout.addWidget(self.horizontalSlider_bi_fraction, 3, 2, 1, 1) self.bilateral_fraction_label = QtWidgets.QLabel(self.groupBox_layer) self.bilateral_fraction_label.setObjectName("bilateral_fraction_label") self.gridLayout.addWidget(self.bilateral_fraction_label, 3, 1, 1, 1) self.lineEdit_bi_fraction = QtWidgets.QLineEdit(self.groupBox_layer) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.lineEdit_bi_fraction.sizePolicy().hasHeightForWidth()) @@ -76,7 +76,7 @@ def setupUi(self, sharpening_layer_widget): self.lineEdit_bi_fraction.setObjectName("lineEdit_bi_fraction") self.gridLayout.addWidget(self.lineEdit_bi_fraction, 3, 3, 1, 1) self.lineEdit_amount = QtWidgets.QLineEdit(self.groupBox_layer) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.lineEdit_amount.sizePolicy().hasHeightForWidth()) @@ -89,14 +89,14 @@ def setupUi(self, sharpening_layer_widget): self.horizontalSlider_amount.setMaximum(100) self.horizontalSlider_amount.setPageStep(1) self.horizontalSlider_amount.setProperty("value", 3) - self.horizontalSlider_amount.setOrientation(QtCore.Qt.Horizontal) + self.horizontalSlider_amount.setOrientation(QtCore.Qt.Orientation.Horizontal) self.horizontalSlider_amount.setObjectName("horizontalSlider_amount") self.gridLayout.addWidget(self.horizontalSlider_amount, 1, 2, 1, 1) self.horizontalSlider_radius = QtWidgets.QSlider(self.groupBox_layer) self.horizontalSlider_radius.setMinimum(1) self.horizontalSlider_radius.setMaximum(100) self.horizontalSlider_radius.setPageStep(1) - self.horizontalSlider_radius.setOrientation(QtCore.Qt.Horizontal) + self.horizontalSlider_radius.setOrientation(QtCore.Qt.Orientation.Horizontal) self.horizontalSlider_radius.setObjectName("horizontalSlider_radius") self.gridLayout.addWidget(self.horizontalSlider_radius, 0, 2, 1, 1) self.label_bi_range = QtWidgets.QLabel(self.groupBox_layer) @@ -105,11 +105,11 @@ def setupUi(self, sharpening_layer_widget): self.horizontalSlider_bi_range = QtWidgets.QSlider(self.groupBox_layer) self.horizontalSlider_bi_range.setMaximum(200) self.horizontalSlider_bi_range.setPageStep(2) - self.horizontalSlider_bi_range.setOrientation(QtCore.Qt.Horizontal) + self.horizontalSlider_bi_range.setOrientation(QtCore.Qt.Orientation.Horizontal) self.horizontalSlider_bi_range.setObjectName("horizontalSlider_bi_range") self.gridLayout.addWidget(self.horizontalSlider_bi_range, 4, 2, 1, 1) self.lineEdit_bi_range = QtWidgets.QLineEdit(self.groupBox_layer) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.lineEdit_bi_range.sizePolicy().hasHeightForWidth()) @@ -122,11 +122,11 @@ def setupUi(self, sharpening_layer_widget): self.gridLayout.addWidget(self.label_denoise, 5, 1, 1, 1) self.horizontalSlider_denoise = QtWidgets.QSlider(self.groupBox_layer) self.horizontalSlider_denoise.setMaximum(100) - self.horizontalSlider_denoise.setOrientation(QtCore.Qt.Horizontal) + self.horizontalSlider_denoise.setOrientation(QtCore.Qt.Orientation.Horizontal) self.horizontalSlider_denoise.setObjectName("horizontalSlider_denoise") self.gridLayout.addWidget(self.horizontalSlider_denoise, 5, 2, 1, 1) self.lineEdit_denoise = QtWidgets.QLineEdit(self.groupBox_layer) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.lineEdit_denoise.sizePolicy().hasHeightForWidth()) diff --git a/planetary_system_stacker/shift_distribution_viewer.py b/planetary_system_stacker/shift_distribution_viewer.py index 8bac799..1d25279 100644 --- a/planetary_system_stacker/shift_distribution_viewer.py +++ b/planetary_system_stacker/shift_distribution_viewer.py @@ -21,7 +21,7 @@ """ from numpy import arange -from PyQt5 import QtWidgets +from PyQt6 import QtWidgets import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt @@ -101,8 +101,8 @@ def __init__(self, parent_gui, shift_distribution, shift_failure_percent, signal QtWidgets.QFrame.__init__(self, parent) self.setupUi(self) - self.setFrameShape(QtWidgets.QFrame.Panel) - self.setFrameShadow(QtWidgets.QFrame.Sunken) + self.setFrameShape(QtWidgets.QFrame.Shape.Panel) + self.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) self.setObjectName("shift_distribution_viewer") self.setFixedSize(900, 600) diff --git a/planetary_system_stacker/shift_distribution_viewer_gui.py b/planetary_system_stacker/shift_distribution_viewer_gui.py index d566de5..0af724f 100644 --- a/planetary_system_stacker/shift_distribution_viewer_gui.py +++ b/planetary_system_stacker/shift_distribution_viewer_gui.py @@ -7,7 +7,7 @@ # WARNING! All changes made in this file will be lost! -from PyQt5 import QtCore, QtGui, QtWidgets +from PyQt6 import QtCore, QtGui, QtWidgets class Ui_shift_distribution_viewer(object): @@ -24,10 +24,10 @@ def setupUi(self, shift_distribution_viewer): self.failedShiftsLabel.setFont(font) self.failedShiftsLabel.setObjectName("failedShiftsLabel") self.horizontalLayout.addWidget(self.failedShiftsLabel) - spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.horizontalLayout.addItem(spacerItem) self.buttonBox = QtWidgets.QDialogButtonBox(shift_distribution_viewer) - self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Ok) + self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Ok) self.buttonBox.setObjectName("buttonBox") self.horizontalLayout.addWidget(self.buttonBox) self.horizontalLayout.setStretch(1, 1) diff --git a/planetary_system_stacker/version_manager_widget.py b/planetary_system_stacker/version_manager_widget.py index b9ff88b..5e8b0e4 100644 --- a/planetary_system_stacker/version_manager_widget.py +++ b/planetary_system_stacker/version_manager_widget.py @@ -6,13 +6,13 @@ # # WARNING! All changes made in this file will be lost! -from PyQt5 import QtCore, QtGui, QtWidgets +from PyQt6 import QtCore, QtGui, QtWidgets class Ui_version_manager_widget(object): def setupUi(self, version_manager_widget): version_manager_widget.setObjectName("version_manager_widget") version_manager_widget.resize(401, 104) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(version_manager_widget.sizePolicy().hasHeightForWidth()) @@ -70,4 +70,3 @@ def retranslateUi(self, version_manager_widget): self.checkBox_blink_compare.setText(_translate("version_manager_widget", "Blink compare with")) self.spinBox_version.setToolTip(_translate("version_manager_widget", "Select a postprocessing version. The unprocessed image is version \"0\".")) self.label_version.setText(_translate("version_manager_widget", "Version selected")) - diff --git a/planetary_system_stacker/workflow.py b/planetary_system_stacker/workflow.py index 3de38b2..7575b3a 100644 --- a/planetary_system_stacker/workflow.py +++ b/planetary_system_stacker/workflow.py @@ -27,7 +27,7 @@ from os.path import splitext, join, dirname import psutil -from PyQt5 import QtCore +from PyQt6 import QtCore from numpy import uint16, uint8 from align_frames import AlignFrames diff --git a/setup.py b/setup.py index 3744232..f13f255 100644 --- a/setup.py +++ b/setup.py @@ -17,10 +17,10 @@ packages=setuptools.find_packages(), ext_modules=None, install_requires=[ - 'numpy < 1.23.0', + 'numpy', 'matplotlib', 'psutil', - 'PyQt5 >= 5.15', + 'PyQt6 >= 6.2', 'scipy', 'astropy', 'scikit-image', @@ -35,7 +35,7 @@ # "Operating System :: POSIX :: Linux", # "Operating System :: MacOS" ], - python_requires='>=3.5, <3.7', + python_requires='>=3.5', entry_points={ "console_scripts": [ "PlanetarySystemStacker=planetary_system_stacker.planetary_system_stacker:main", diff --git a/setup_linux.py b/setup_linux.py index f665231..0f6fbde 100644 --- a/setup_linux.py +++ b/setup_linux.py @@ -17,10 +17,10 @@ packages=setuptools.find_packages(), ext_modules=None, install_requires=[ - 'numpy < 1.23.0', + 'numpy', 'matplotlib', 'psutil', - 'PyQt5 >= 5.15', + 'PyQt6 >= 6.2', 'scipy', 'astropy', 'scikit-image', diff --git a/setup_macos.py b/setup_macos.py index 300b14d..1d08639 100644 --- a/setup_macos.py +++ b/setup_macos.py @@ -17,10 +17,10 @@ packages=setuptools.find_packages(), ext_modules=None, install_requires=[ - 'numpy < 1.23.0', + 'numpy', 'matplotlib', 'psutil', - 'PyQt5 >= 5.15', + 'PyQt6 >= 6.2', 'scipy', 'astropy', 'scikit-image', diff --git a/setup_windows.py b/setup_windows.py index 87e3d5a..44a3f5b 100644 --- a/setup_windows.py +++ b/setup_windows.py @@ -17,10 +17,10 @@ packages=setuptools.find_packages(), ext_modules=None, install_requires=[ - 'numpy < 1.23.0', + 'numpy', 'matplotlib', 'psutil', - 'PyQt5', + 'PyQt6 >= 6.2', 'scipy', 'astropy', 'scikit-image',