Fix for C++ conversion error in plotting#3745
Merged
Merged
Conversation
rozyczko
reviewed
Nov 12, 2025
Member
rozyczko
left a comment
There was a problem hiding this comment.
I'm slightly confused how this could be the solution.
plotRequestedSignal's only slot is in GuiManager
self.communicate.plotRequestedSignal.connect(self.showPlot)showPlot passes the second argument (id) to displayData, not doing anything to it.
self.filesWidget.displayData(plot, id)Sunsequently, displayData, although accepting the argument
def displayData(self, data_list, id=None):does absolutely nothing with it. The whole id passing chain is completely redundant at this point (it used to be a few rewrites/fixes earlier though!)
rozyczko
requested changes
Nov 12, 2025
Member
Author
|
Since the tab_id parameter is obsolete, I have removed it from the definition and all the calls. |
DrPaulSharp
approved these changes
Nov 12, 2025
Contributor
DrPaulSharp
left a comment
There was a problem hiding this comment.
All looks good, rebase and merge when ready.
wpotrzebowski
approved these changes
Nov 13, 2025
Contributor
wpotrzebowski
left a comment
There was a problem hiding this comment.
Tested on Mac from installer. It works as expected
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
Fixes #3740
The issue occurred because
Nonewas passed as a parameter toplotRequestedSignal.In
src/sas/qtgui/Utilities/GuiUtils.py:106, the signal is defined to acceptlistandint. SinceNoneis not anint, it triggered a C++ type conversion error when the signal was emitted, as Qt is implemented in C++.PySide does not support Python-style union type hints (e.g. int | None) in signal definitions, so supporting both types directly is a rather cumbersome implementation.
As a workaround, the fix passes a valid integer value instead of
None:0 for perspectives that do not support tabs,
self.tab_idfor those that do.Although a deeper look showed that
tab_idis not actually used in the connected slot, it has been left intact to preserve the existing signal interface.How Has This Been Tested?
Checked by plotting in all the affected perspectives (SizeDistribution, Inversion, Invariant). The error does not appear anymore.
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)