This commit is contained in:
恍兮惚兮 2024-12-27 20:52:18 +08:00
parent ece7f83e1d
commit 3e171eb813

View File

@ -604,9 +604,6 @@ class autoinitdialog(LDialog):
) )
) )
lineW.addWidget(combo) lineW.addWidget(combo)
_w = QWidget()
_w.setLayout(lineW)
lineW = _w
elif line["type"] == "okcancel": elif line["type"] == "okcancel":
lineW = QDialogButtonBox( lineW = QDialogButtonBox(
QDialogButtonBox.StandardButton.Ok QDialogButtonBox.StandardButton.Ok
@ -642,9 +639,6 @@ class autoinitdialog(LDialog):
) )
regist[key] = functools.partial(__temp.__getitem__, "k") regist[key] = functools.partial(__temp.__getitem__, "k")
_ = QWidget()
_.setLayout(lineW)
lineW = _
elif line["type"] == "switch": elif line["type"] == "switch":
lineW = MySwitch(sign=dd[key]) lineW = MySwitch(sign=dd[key])
regist[key] = lineW.isChecked regist[key] = lineW.isChecked
@ -652,9 +646,7 @@ class autoinitdialog(LDialog):
_.addStretch() _.addStretch()
_.addWidget(lineW) _.addWidget(lineW)
_.addStretch() _.addStretch()
_w = QWidget() lineW = _
_w.setLayout(_)
lineW = _w
elif line["type"] in ["spin", "intspin"]: elif line["type"] in ["spin", "intspin"]:
__temp = {"k": dd[key]} __temp = {"k": dd[key]}
@ -683,9 +675,9 @@ class autoinitdialog(LDialog):
lineW.setEnabled(dd[key]) lineW.setEnabled(dd[key])
hbox.addWidget(switch) hbox.addWidget(switch)
hbox.addWidget(lineW) hbox.addWidget(lineW)
_ = QWidget() lineW = hbox
_.setLayout(hbox) if isinstance(lineW, QLayout):
lineW = _ lineW.setContentsMargins(0, 0, 0, 0)
if ("name" not in line) or (line["type"] == "split"): if ("name" not in line) or (line["type"] == "split"):
formLayout.addRow(lineW) formLayout.addRow(lineW)
else: else: