Skip to content

Commit

Permalink
Fix frame capture when using PyQt6 (#43)
Browse files Browse the repository at this point in the history
See
#40 (comment),
#42 (comment)

These failures were caused by an intervening frame in QtPy when using
the Qt6 backend, because QtPy replaced some removed functions in the
Qt5->Qt6 transition with their own implementations:


https://github.com/spyder-ide/qtpy/blob/1d2a1eae43bda2a3d0efef605cafc5462389ec03/qtpy/QtWidgets.py#L69-L105

Therefore, when looking for "first frame in the call stack that is not
in napari", the frame capture code would stop in QtPy. By adding QtPy to
the list of ignored prefixes, this PR fixes the issue in the Qt6 case.
  • Loading branch information
dalthviz authored Dec 20, 2024
1 parent 2e9ca54 commit fe3dcf0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion napari_console/qt_console.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from napari.utils.naming import CallerFrame


_PREF_LIST = ["napari.", "napari_console.", "in_n_out."]
_PREF_LIST = ["napari.", "napari_console.", "in_n_out.", "qtpy."]


def str_to_rgb(arg):
Expand Down

0 comments on commit fe3dcf0

Please sign in to comment.