- porting to PyQt6

This commit is contained in:
Marius Stanciu
2021-08-04 18:34:24 +03:00
parent c3d5fccb80
commit 53272da959
136 changed files with 1732 additions and 1715 deletions

View File

@@ -1,5 +1,5 @@
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtCore import QSettings
from PyQt6 import QtCore, QtWidgets
from PyQt6.QtCore import QSettings
from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, FCComboBox, RadioSet, OptionalInputSection, FCSpinner, \
FCColorEntry, FCLabel
@@ -77,8 +77,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
grid0.addWidget(self.snap_max_dist_entry, 6, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 8, 0, 1, 2)
# Workspace
@@ -174,8 +174,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
grid0.addWidget(self.wk_orientation_radio, 16, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 18, 0, 1, 2)
# Font Size
@@ -262,8 +262,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
grid0.addWidget(self.hud_font_size_spinner, 28, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 30, 0, 1, 2)
# Axis Color
@@ -277,8 +277,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
grid0.addWidget(self.axis_color_entry, 32, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 34, 0, 1, 2)
# -----------------------------------------------------------
@@ -380,8 +380,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
grid0.addWidget(self.mselect_radio, 50, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 52, 0, 1, 2)
# Delete confirmation

View File

@@ -1,7 +1,7 @@
import sys
from PyQt5 import QtWidgets
from PyQt5.QtCore import QSettings
from PyQt6 import QtWidgets
from PyQt6.QtCore import QSettings
from appGUI.GUIElements import RadioSet, FCSpinner, FCCheckBox, FCComboBox, FCButton, OptionalInputSection, \
FCDoubleSpinner, FCLabel
@@ -84,8 +84,8 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.ge_radio, 6, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 8, 0, 1, 2)
# Application Level for FlatCAM
@@ -118,8 +118,8 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.verbose_cb, 16, 0, 1, 2)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 18, 0, 1, 2)
# Languages for FlatCAM
@@ -137,8 +137,8 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.language_apply_btn, 24, 0, 1, 2)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 26, 0, 1, 2)
# -----------------------------------------------------------
@@ -207,8 +207,8 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
self.ois_version_check = OptionalInputSection(self.version_check_cb, [self.send_stats_cb])
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 42, 0, 1, 2)
# Worker Numbers
@@ -245,8 +245,8 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.tol_entry, 46, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 48, 0, 1, 2)
# Save Settings
@@ -304,8 +304,8 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
# self.as_ois = OptionalInputSection(self.autosave_cb, [self.autosave_label, self.autosave_entry], True)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 60, 0, 1, 2)
self.pdf_param_label = FCLabel('<B>%s:</b>' % _("Text to PDF parameters"))

View File

@@ -1,4 +1,4 @@
from PyQt5 import QtCore
from PyQt6 import QtCore
from appGUI.GUIElements import OptionalInputSection
from appGUI.preferences.OptionUI import *
from appGUI.preferences.OptionsGroupUI import OptionsGroupUI2

View File

@@ -1,5 +1,5 @@
from PyQt5 import QtWidgets, QtCore
from PyQt5.QtCore import QSettings
from PyQt6 import QtWidgets, QtCore
from PyQt6.QtCore import QSettings
from appGUI.GUIElements import RadioSet, FCCheckBox, FCComboBox, FCSliderWithSpinner, FCColorEntry, FCLabel
from appGUI.preferences.OptionsGroupUI import OptionsGroupUI
@@ -59,8 +59,8 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
# grid0.addWidget(self.theme_button, 2, 0, 1, 3)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 3, 0, 1, 2)
# Layout selection
@@ -95,9 +95,9 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
self.style_combo.addItems(QtWidgets.QStyleFactory.keys())
# find current style
current_style = QtCore.QCoreApplication.instance().style().objectName()
index = self.style_combo.findText(current_style, QtCore.Qt.MatchFixedString)
index = self.style_combo.findText(current_style, QtCore.Qt.MatchFlag.MatchFixedString)
self.style_combo.setCurrentIndex(index)
self.style_combo.activated[str].connect(self.handle_style)
self.style_combo.activated.connect(self.handle_style)
grid0.addWidget(self.style_label, 5, 0)
grid0.addWidget(self.style_combo, 5, 1)
@@ -138,8 +138,8 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.selection_cb, 9, 0, 1, 3)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 14, 0, 1, 2)
# Plot Selection (left - right) Color
@@ -178,8 +178,8 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.left_right_alpha_entry, 18, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 19, 0, 1, 2)
# Plot Selection (left - right) Color
@@ -220,8 +220,8 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.right_left_alpha_entry, 23, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 24, 0, 1, 2)
# ------------------------------------------------------------------
@@ -252,8 +252,8 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.sel_draw_color_entry, 27, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 28, 0, 1, 2)
# ------------------------------------------------------------------
@@ -327,7 +327,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
def handle_style(style):
# set current style
qsettings = QSettings("Open Source", "FlatCAM")
qsettings.setValue('style', style)
qsettings.setValue('style', str(style))
# This will write the setting to the platform specific storage.
del qsettings

View File

@@ -1,4 +1,4 @@
from PyQt5 import QtWidgets
from PyQt6 import QtWidgets
from appGUI.preferences.general.GeneralAppPrefGroupUI import GeneralAppPrefGroupUI
from appGUI.preferences.general.GeneralAPPSetGroupUI import GeneralAPPSetGroupUI