Dead keys can edit QTextEdit widget despite readOnly on Linux?

Phil Thompson phil at riverbankcomputing.com
Sun Jul 17 10:46:04 BST 2022


On 07/07/2022 22:23, t_techcn wrote:
> Howdy,
> 
> I've been having a minor issue with a program since transitioning to
> PyQt6; On Linux, typing a character with a dead key modifier seems to
> let me edit the text inside a PyQt6.QtWidgets.QTextEdit widget even if
> I've set the text edit to read-only. Like so:
> 
> 1. Highlight any part of the text.
> 2. With a keyboard with dead keys, press any diacritic and then a
> letter, like '`' + 'a' or '^' + '2'.
> 
> The character then replaces the selected part of the text.
> 
> I was able to reproduce this on Arch & Debian when using the script
> I've added as an attachment. PyQt5 doesn't seem to have this behavior,
> and it doesn't seem to occur with c++ Qt6 either as far as I can tell.
> Not sure how to prevent this with PyQt6.

I don't see how this could be a PyQt problem.

Phil


More information about the PyQt mailing list