Skip to content

[BUG]: mcdisplay(-pyqtgraph) shipped with 3.7.1 crashes on startup on PyQt6-based systems #2482

@willend

Description

@willend

Describe the bug
Annoyingly, mcdisplay-pyqtgraph shipped with 3.7.1 crashes during on startup with the below error message (at least on some systems…). An incoming PR fixes the problem and will result in a scoop-up 3.7.2 likely next week…

  File "/Users/peterwillendrup/micromamba/envs/mcstas-3.7.1/share/mcstas/tools/Python/mcdisplay/pyqtgraph/mcdisplay.py", line 553, in main
    sys.exit(gui.run_ui(instrument, rays))
             ~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/Users/peterwillendrup/micromamba/envs/mcstas-3.7.1/share/mcstas/tools/Python/mcdisplay/pyqtgraph/mcdisplay.py", line 399, in run_ui
    return self.app.exec_()
           ^^^^^^^^^^^^^^
AttributeError: 'QApplication' object has no attribute 'exec_'. Did you mean: ‘exec’?

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/peterwillendrup/micromamba/envs/mcstas-3.7.1/share/mcstas/tools/Python/mcdisplay/pyqtgraph/mcdisplay.py", line 585, in <module>
    main(**args)
    ~~~~^^^^^^^^
  File "/Users/peterwillendrup/micromamba/envs/mcstas-3.7.1/share/mcstas/tools/Python/mcdisplay/pyqtgraph/mcdisplay.py", line 557, in main
    sys.exit(gui.run_ui(instrument, rays))
             ~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/Users/peterwillendrup/micromamba/envs/mcstas-3.7.1/share/mcstas/tools/Python/mcdisplay/pyqtgraph/mcdisplay.py", line 398, in run_ui
    self._display_nextray()
    ~~~~~~~~~~~~~~~~~~~~~^^
  File "/Users/peterwillendrup/micromamba/envs/mcstas-3.7.1/share/mcstas/tools/Python/mcdisplay/pyqtgraph/mcdisplay.py", line 468, in _display_nextray
    plt.clear()
    ~~~~~~~~~^^
  File "/Users/peterwillendrup/micromamba/envs/mcstas-3.7.1/lib/python3.14/site-packages/pyqtgraph/graphicsItems/PlotDataItem.py", line 1767, in clear
    self.scatter.clear()
    ~~~~~~~~~~~~~~~~~~^^
  File "/Users/peterwillendrup/micromamba/envs/mcstas-3.7.1/lib/python3.14/site-packages/pyqtgraph/graphicsItems/ScatterPlotItem.py", line 861, in clear
    self.invalidate()
    ~~~~~~~~~~~~~~~^^
  File "/Users/peterwillendrup/micromamba/envs/mcstas-3.7.1/lib/python3.14/site-packages/pyqtgraph/graphicsItems/ScatterPlotItem.py", line 597, in invalidate
    self.update()
    ~~~~~~~~~~~^^
RuntimeError: wrapped C/C++ object of type ScatterPlotItem has been deleted

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions