- porting to PyQt6
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
# MIT Licence #
|
||||
# ##########################################################
|
||||
|
||||
from PyQt5 import QtWidgets, QtCore, QtGui
|
||||
from PyQt6 import QtWidgets, QtCore, QtGui
|
||||
|
||||
from appTool import AppTool
|
||||
from appGUI.GUIElements import FCCheckBox, FCDoubleSpinner, RadioSet, FCTable, FCButton,\
|
||||
@@ -837,7 +837,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
|
||||
# ------------------------ Tool ID ----------------------------------------------------------------
|
||||
id_ = QtWidgets.QTableWidgetItem('%d' % int(tool_id))
|
||||
flags = QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled
|
||||
flags = QtCore.Qt.ItemFlag.ItemIsSelectable | QtCore.Qt.ItemFlag.ItemIsEnabled
|
||||
id_.setFlags(flags)
|
||||
row_no = tool_id - 1
|
||||
self.ui.tools_table.setItem(row_no, 0, id_) # Tool name/id
|
||||
@@ -845,7 +845,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
# ------------------------ Tool Diameter ----------------------------------------------------------
|
||||
# Make sure that the drill diameter when in MM is with no more than self.decimals decimals
|
||||
dia = QtWidgets.QTableWidgetItem('%.*f' % (self.decimals, tooluid_value['tooldia']))
|
||||
dia.setFlags(QtCore.Qt.ItemIsEnabled)
|
||||
dia.setFlags(QtCore.Qt.ItemFlag.ItemIsEnabled)
|
||||
self.ui.tools_table.setItem(row_no, 1, dia) # Diameter
|
||||
|
||||
# ------------------------ Tool Shape -------------------------------------------------------------
|
||||
@@ -862,7 +862,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
|
||||
# make the diameter column editable
|
||||
for row in range(tool_id):
|
||||
flags = QtCore.Qt.ItemIsEditable | QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled
|
||||
flags = QtCore.Qt.ItemFlag.ItemIsEditable | QtCore.Qt.ItemFlag.ItemIsSelectable | QtCore.Qt.ItemFlag.ItemIsEnabled
|
||||
self.ui.tools_table.item(row, 1).setFlags(flags)
|
||||
|
||||
self.ui.tools_table.resizeColumnsToContents()
|
||||
@@ -1873,16 +1873,16 @@ class NonCopperClear(AppTool, Gerber):
|
||||
if '+' in key_string:
|
||||
mod, __, key_text = key_string.rpartition('+')
|
||||
if mod.lower() == 'ctrl':
|
||||
# modifiers = QtCore.Qt.ControlModifier
|
||||
# modifiers = QtCore.Qt.KeyboardModifier.ControlModifier
|
||||
pass
|
||||
elif mod.lower() == 'alt':
|
||||
# modifiers = QtCore.Qt.AltModifier
|
||||
# modifiers = QtCore.Qt.KeyboardModifier.AltModifier
|
||||
pass
|
||||
elif mod.lower() == 'shift':
|
||||
# modifiers = QtCore.Qt.ShiftModifier
|
||||
# modifiers = QtCore.Qt.KeyboardModifier.
|
||||
pass
|
||||
else:
|
||||
# modifiers = QtCore.Qt.NoModifier
|
||||
# modifiers = QtCore.Qt.KeyboardModifier.NoModifier
|
||||
pass
|
||||
key = QtGui.QKeySequence(key_text)
|
||||
|
||||
@@ -1890,7 +1890,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
else:
|
||||
key = event.key
|
||||
|
||||
if key == QtCore.Qt.Key_Escape or key == 'Escape':
|
||||
if key == QtCore.Qt.Key.Key_Escape or key == 'Escape':
|
||||
|
||||
if self.area_sel_disconnect_flag is True:
|
||||
if self.app.is_legacy is False:
|
||||
@@ -4136,7 +4136,7 @@ class NccUI:
|
||||
"Permanent change is done in 'Preferences' menu."
|
||||
)
|
||||
)
|
||||
# self.level.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter)
|
||||
# self.level.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight | QtCore.Qt.AlignmentFlag.AlignVCenter)
|
||||
self.level.setCheckable(True)
|
||||
self.title_box.addWidget(self.level)
|
||||
|
||||
@@ -4176,8 +4176,8 @@ class NccUI:
|
||||
grid0.addWidget(self.object_combo, 2, 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, 4, 0, 1, 2)
|
||||
|
||||
# ### Tools ## ##
|
||||
@@ -4251,8 +4251,8 @@ class NccUI:
|
||||
grid1.addWidget(self.ncc_order_radio, 1, 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)
|
||||
grid1.addWidget(separator_line, 2, 0, 1, 2)
|
||||
|
||||
# #############################################################
|
||||
@@ -4333,14 +4333,14 @@ class NccUI:
|
||||
_("Delete a selection of tools in the Tool Table\n"
|
||||
"by first selecting a row in the Tool Table.")
|
||||
)
|
||||
self.deltool_btn.setSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.deltool_btn.setSizePolicy(QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
|
||||
button_grid.addWidget(self.deltool_btn, 0, 1, 2, 1)
|
||||
# #############################################################################################################
|
||||
|
||||
self.add_tool_separator_line = QtWidgets.QFrame()
|
||||
self.add_tool_separator_line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.add_tool_separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.add_tool_separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
self.add_tool_separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
self.grid3.addWidget(self.add_tool_separator_line, 11, 0, 1, 2)
|
||||
|
||||
self.tool_data_label = FCLabel(
|
||||
@@ -4500,8 +4500,8 @@ class NccUI:
|
||||
self.ois_ncc_offset = OptionalInputSection(self.ncc_choice_offset_cb, [self.ncc_offset_spinner])
|
||||
|
||||
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)
|
||||
self.grid3.addWidget(separator_line, 21, 0, 1, 2)
|
||||
|
||||
self.apply_param_to_all = FCButton(_("Apply parameters to all tools"))
|
||||
@@ -4513,8 +4513,8 @@ class NccUI:
|
||||
self.grid3.addWidget(self.apply_param_to_all, 22, 0, 1, 2)
|
||||
|
||||
self.all_param_separator_line2 = QtWidgets.QFrame()
|
||||
self.all_param_separator_line2.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.all_param_separator_line2.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.all_param_separator_line2.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
self.all_param_separator_line2.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
self.grid3.addWidget(self.all_param_separator_line2, 23, 0, 1, 2)
|
||||
|
||||
# General Parameters
|
||||
@@ -4659,8 +4659,8 @@ class NccUI:
|
||||
self.grid3.addWidget(self.valid_cb, 37, 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)
|
||||
self.grid3.addWidget(separator_line, 39, 0, 1, 2)
|
||||
|
||||
self.generate_ncc_button = FCButton(_('Generate Geometry'))
|
||||
|
||||
Reference in New Issue
Block a user