Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

silx.gui.data.DataViewer.DataViewer: Fixed issue with accessing views after using the removeView method. #4131

Merged
merged 1 commit into from
Jun 13, 2024

Conversation

malte-storm
Copy link
Contributor

Fixed issue #4130 which occured after using the silx.gui.data.DataViewer.DataViewer.removeView method which invalidated the index dictionary for accessing widgets.
Switching between views modified the referenced __stack without updating the __index.

@t20100 t20100 added this to the Next release milestone Jun 13, 2024
@t20100
Copy link
Member

t20100 commented Jun 13, 2024

Thanks for the investigation and the fix!

Looking at it, it seems self.__index is not needed and the following would simplify the code:

    def __getStackIndex(self, view):
        widget = view.getWidget()
        index = self.__stack.indexOf(widget)
        if index != -1:
            return index
        return self.__stack.addWidget(widget)

But let's keep this for later.

@t20100 t20100 merged commit f3686db into silx-kit:main Jun 13, 2024
7 of 8 checks passed
@malte-storm malte-storm deleted the fix_DataViewer_removeView branch July 9, 2024 08:00
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