Not handling cancel action on single fit with multi constraint#3808
Merged
Not handling cancel action on single fit with multi constraint#3808
Conversation
… to inspect which button was pushed instead of looking at retval
Contributor
Author
|
This could also be fixed by an even smaller edit - the return value is diff --git i/src/sas/qtgui/Perspectives/Fitting/FittingWidget.py w/src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
index 90fb03f3b..0e38734a8 100644
--- i/src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
+++ w/src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
@@ -1330,7 +1330,7 @@ class FittingWidget(QtWidgets.QWidget, Ui_FittingWidgetUI):
button_cancel = QtWidgets.QPushButton("Cancel")
msgbox.addButton(button_cancel, QtWidgets.QMessageBox.RejectRole)
retval = msgbox.exec_()
- if retval == QtWidgets.QMessageBox.RejectRole:
+ if retval == int(QtWidgets.QMessageBox.RejectRole):
# cancel fit
raise ValueError("Fitting cancelled")
else: |
krzywon
approved these changes
Dec 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When a user presses "Fit" from on a model, when constraints have been added which tie this model to other models, a dialog box opens which notifies the user that if they continue, the constraint will be disabled so that the single fit can continue.
Currently, if you press "Cancel", the action is not cancelled, and the fit proceeds (and the constraint is disabled).
How Has This Been Tested?
Loaded a model, then selected "FitPage1", then clicked "Fit" - and then clicked "Cancel". Fit was cancelled, and constraint was not disabled. See attached project for an example of a multi-model constrained fit project.
6-1-2-constrained-fit.json
Review Checklist:
[if using the editor, use
[x]in place of[ ]to check a box]Documentation (check at least one)
Installers
Licensing (untick if necessary)