- fixed issue with first click on the header of the Tool Table in the Geometry Object Properties and also made sure that clicking the Plot Items in the last column will not select rows

This commit is contained in:
Marius Stanciu
2020-11-07 21:07:50 +02:00
committed by Marius
parent d842b490a8
commit f2c9a7a49e
4 changed files with 25 additions and 7 deletions

View File

@@ -675,23 +675,27 @@ class NonCopperClear(AppTool, Gerber):
if float('%.*f' % (self.decimals, tooluid_value['tooldia'])) == tool_sorted:
tool_id += 1
# ------------------------ Tool ID ----------------------------------------------------------------
id_ = QtWidgets.QTableWidgetItem('%d' % int(tool_id))
flags = QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled
id_.setFlags(flags)
row_no = tool_id - 1
self.ui.tools_table.setItem(row_no, 0, id_) # Tool name/id
# ------------------------ 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)
self.ui.tools_table.setItem(row_no, 1, dia) # Diameter
# ------------------------ Tool Shape -------------------------------------------------------------
tool_type_item = FCComboBox()
tool_type_item.addItems(self.tool_type_item_options)
idx = tool_type_item.findText(tooluid_value['tool_type'])
tool_type_item.setCurrentIndex(idx)
self.ui.tools_table.setCellWidget(row_no, 2, tool_type_item)
# ------------------------ Tool UID - NOT Visible -------------------------------------------------
tool_uid_item = QtWidgets.QTableWidgetItem(str(int(tooluid_key)))
# ## REMEMBER: THIS COLUMN IS HIDDEN IN OBJECTUI.PY # ##
self.ui.tools_table.setItem(row_no, 3, tool_uid_item) # Tool unique ID