CAM: Fix expression editor so that widgets refresh after closing
src/Gui/QuantitySpinBox.cpp: - Call updateExpression() after setExpression() in QuantitySpinBox src/Gui/SpinBox.cpp: - Call updateExpression() after setExpression() in ExpressionSpinBox src/Gui/Widgets.cpp: - Call onChange() after setExpression() in ExpLineEdit src/Mod/CAM/Path/Base/Gui/Util.py: - Connect to showFormulaDialog signal and refresh CAM QuantitySpinBox Python wrapper when dialog closes
This commit is contained in:
committed by
Chris Hennes
parent
bba37208cc
commit
db40eb1478
@@ -131,6 +131,21 @@ class QuantitySpinBox(QtCore.QObject):
|
||||
self.widget.installEventFilter(self)
|
||||
# Connect local class method as slot
|
||||
self.widget.textChanged.connect(self.onWidgetValueChanged)
|
||||
# Connect to showFormulaDialog signal to track dialog open/close
|
||||
try:
|
||||
self.widget.showFormulaDialog.connect(self.onFormulaDialogStateChanged)
|
||||
except AttributeError:
|
||||
# Widget may not have this signal
|
||||
pass
|
||||
|
||||
def onFormulaDialogStateChanged(self, isOpen):
|
||||
"""
|
||||
Slot called when the formula dialog is opened or closed.
|
||||
When the dialog closes (isOpen=False), refresh the widget.
|
||||
"""
|
||||
if not isOpen:
|
||||
# Dialog has closed, update the widget to reflect any changes
|
||||
self.updateWidget()
|
||||
|
||||
def eventFilter(self, obj, event):
|
||||
if event.type() == QtCore.QEvent.Type.FocusIn:
|
||||
|
||||
Reference in New Issue
Block a user