def __init__(self, mdl, ctrl):
super(ComponentSettings, self).__init__()
self.mdl = mdl
hfl = QtGui.QFormLayout()
ct_cmb = QtGui.QComboBox()
for _, i in sorted(mdl_meta.items(), key=lambda i: i[0]):
ct_cmb.addItem(i.text)
ct_cmb.setCurrentIndex(self.mdl.cmptype)
ct_cmb.currentIndexChanged.connect(self.changeTab)
hfl.addRow("Component Type", ct_cmb)
self.w_x = UnitEditable(ctrl.flow, "center.x", UNIT_GROUP_MM)
hfl.addRow("Position X:", self.w_x.widget)
self.w_y = UnitEditable(ctrl.flow, "center.y", UNIT_GROUP_MM)
hfl.addRow("Position Y:", self.w_y.widget)
self.w_theta = DegreeEditable(ctrl.flow, "theta")
hfl.addRow("Theta:", self.w_theta.widget)
self.headerWidget.setLayout(hfl)
for k, i in sorted(mdl_meta.items(), key=lambda i: i[0]):
self.addAutoWidget(i.widget_cons(mdl.model_instances[k]))
self.selectWidget(self.mdl.cmptype)
self.ctrl = ctrl
评论列表
文章目录