Skip to content

Fix uncheck constraint#3809

Merged
krzywon merged 2 commits intomainfrom
fix-uncheck-constraint
Dec 9, 2025
Merged

Fix uncheck constraint#3809
krzywon merged 2 commits intomainfrom
fix-uncheck-constraint

Conversation

@bmaranville
Copy link
Copy Markdown
Contributor

Description

In the ConstraintWidget.uncheckConstraint(name: str) method, the constraint to be unchecked is always a string (it is the data of an item = QtWidgets.QTableWidgetItem(label))

In that method, a call was made to FittingWidget.getModelKey(self, constraint: Constraint) which is expecting a Constraint object. The call should be made to FittingWidget.getModelKeyFromName(self, name: str) instead.

This fixes an issue where the uncheckConstraint doesn't work, e.g. when called after initiating a single model fit when a multi-model constraint exists, and the constraint is to be disabled. (see #3808)

How Has This Been Tested?

Start a fit with the first model in the project attached to #3808, then verify that the constraint has been disabled (and the fit starts)

Review Checklist:

[if using the editor, use [x] in place of [ ] to check a box]

Documentation (check at least one)

  • There is nothing that needs documenting
  • Documentation changes are in this PR
  • There is an issue open for the documentation (link?)

Installers

  • There is a chance this will affect the installers, if so
    • Windows installer (GH artifact) has been tested (installed and worked)
    • MacOSX installer (GH artifact) has been tested (installed and worked)
    • Wheels installer (GH artifact) has been tested (installed and worked)

Licensing (untick if necessary)

  • The introduced changes comply with SasView license (BSD 3-Clause)

@krzywon krzywon merged commit d0eb312 into main Dec 9, 2025
40 checks passed
@krzywon krzywon deleted the fix-uncheck-constraint branch December 9, 2025 18:10
@bmaranville bmaranville mentioned this pull request Dec 11, 2025
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants