INNER CODE UNIT · Python
_table
wzyn20051216/solidworks-automation-skill · apps/desktop/cad_workbench/app.py:331
def _table(self, columns: list[str]) -> QTableWidget:
table = QTableWidget(0, len(columns))
table.setHorizontalHeaderLabels(columns)
table.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch)
table.verticalHeader().setVisible(False)
table.setSelectionBehavior(QAbstractItemView.SelectRows)
table.setAlternatingRowColors(True)
table.setMinimumHeight(150)
return table
def _build_feature_tab(self) -> QWidget:
page = QWidget()
layout = QVBoxLayout(page)
layout.setContentsMargins(0, 0, 0, 0)
layout.setSpacing(14)
holes_panel, holes_layout = self._panel("孔")
self.holes_table = self._table(["id", "名称", "类型", "面", "直径", "数量", "X基准", "Y基准", "X定位", "Y定位", "X节距", "Y节距", "通孔"])