Qt warning message when I use python console

Hi all

I built Slicer 5.7 as a debug version and loaded a script extension modules using the extension wizard. Since then, I have been consistently getting the following warning messages. Due to this I cannot use the Python console.

"Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt."

These warning messages only appear in the build version and not in the Slicer binary. Any idea what might be causing this?

캡처

I’ve never seen that particular message. Since you built from source you should be able to set a breakpoint where the warning is printed and inspect the stack trace to see if this comes from specific c++ code.

Warning seems to reported by code in QByteArray… See qtbase/src/corelib/text/qbytearray.cpp at v5.15.2 · qt/qtbase · GitHub

@park Would it be possible to share the exact steps leading to these warning messages ? Does it happen without the generated script extension loaded ?

Ironically, this warning message appeared because of “Grammarly”. It seems that Grammarly’s spelling check feature keeps activating the python interactor.

Thank you for your consideration !

This seems consistent with these Grammarly related comments[1] I found:

Is the grammarly desktop app interacting with browser elements without using the extension? (IIRC the grammarly app uses some accessibility privileges to inject into textareas across all apps)

It seems like that must be the case. If we have the details right about desktop app only (which seemed pretty clear).

I am wondering if there is way to “hint” Grammarly and avoid this.

What about having someone from our community with a paid account reach out and ask the Grammarly support team ?


  1. The weirdest bug I've seen yet | Hacker News ↩︎

1 Like