BCDA-APS / mdaviz

Data visualization for mda
https://bcda-aps.github.io/mdaviz/
Other
3 stars 0 forks source link

fix "GoNext" button #93

Closed rodolakis closed 1 month ago

rodolakis commented 4 months ago

Since PR #91, pushing the GoNext button (and likely other similar button) to select next file crashes the app:

Traceback (most recent call last):
  File "/home/beams3/RODOLAKIS/src/mdaviz/mdaviz/mda_folder.py", line 205, in goToNext
    self.highlightNewFile(i.row())
  File "/home/beams3/RODOLAKIS/src/mdaviz/mdaviz/mda_folder.py", line 163, in highlightNewFile
    self.selectionModel().select(
RuntimeError: wrapped C/C++ object of type QItemSelectionModel has been deleted
Aborted (core dumped)
prjemian commented 4 months ago

Youch!

prjemian commented 4 months ago

How to reproduce this error?

prjemian commented 4 months ago

Want to know what are the inputs to the Qt call: https://github.com/BCDA-APS/mdaviz/blob/6b15fe0a1f60d23c893d65999dee3ad42b56477e/mdaviz/mda_folder.py#L162-L165

prjemian commented 4 months ago

Unfortunately, the exception handling for Qt code is troublesome. Qt comes from a compiled library. If that code errors, it is not possible for Python to catch the error.

prjemian commented 4 months ago

Suspicious of an unexpected row value...

rodolakis commented 4 months ago

I cannot reproduce this error now...

rodolakis commented 4 months ago

I had that this morning during our demo, but now it seems to work just fine.

rodolakis commented 4 months ago

Want to know what are the inputs to the Qt call:

mdaviz/mdaviz/mda_folder.py

Lines 162 to 165 in 6b15fe0

index = self.mda_folder_tableview.tableView.model().index(row, 0) self.selectionModel().select( index, QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows )

@prjemian I am not sure to understand your question here

prjemian commented 4 months ago

Same here. In this view: image

this button? image

prjemian commented 4 months ago

If not seeing now, could consider closing. Instead, leave open a couple days, just in case.

rodolakis commented 4 months ago

Yes this button.

rodolakis commented 4 months ago

Still not able to reproduce this crash, but the highlight of the file & automatic scroll when using the button does not appear to work anymore. It does plot the next/previous/first/last scan when the button is push, only the highlight/focus/scroll is off.

To be investigated

rodolakis commented 4 months ago

After merging PR #99 and #102: