Disabling characters interpretation
-
wrote on 11 Jun 2019, 10:38 last edited by
Hello,
I've found a weird behaviour using QLineEdit: entered text is parsed and transformed in something else when using some special characters. For example, when the user enters "a&bc" Qt displays "abc" underlining the 'b' character. Of course this tampers the user input and must be disabled, but I can't even figure how developers decided to name this awful feature, not to mention where is documented. Does anybody know if this can be disabled, and where it is described in the documentation?Thanks in advance!
Marco -
Hello,
I've found a weird behaviour using QLineEdit: entered text is parsed and transformed in something else when using some special characters. For example, when the user enters "a&bc" Qt displays "abc" underlining the 'b' character. Of course this tampers the user input and must be disabled, but I can't even figure how developers decided to name this awful feature, not to mention where is documented. Does anybody know if this can be disabled, and where it is described in the documentation?Thanks in advance!
Marco@Marco-Palestro Just checked on Windows 10, Qt 5.11 MinGW: can't reproduce the issue.
What OS is it? Which Qt versions? Are you sure it is QLineEdit and how did you configure it? -
wrote on 11 Jun 2019, 10:52 last edited by
I'm using qt 5.6.3 for an old project, a multiplatform GUI running on windows and android; windows version is compiled with mingw, but the problem is the same on android platform. I don't think it's related to platform or tool chain, it is clearly an "applicative" feature.
I made a mistake looking in the code; QLineEdit is used while editing, but then the text is displayed through a QPushButton stylized to seem a label (sorry, not my code). This must be related to accelerators used on buttons; do you know if it's possible to disable this feature? -
I'm using qt 5.6.3 for an old project, a multiplatform GUI running on windows and android; windows version is compiled with mingw, but the problem is the same on android platform. I don't think it's related to platform or tool chain, it is clearly an "applicative" feature.
I made a mistake looking in the code; QLineEdit is used while editing, but then the text is displayed through a QPushButton stylized to seem a label (sorry, not my code). This must be related to accelerators used on buttons; do you know if it's possible to disable this feature?Lifetime Qt Championwrote on 11 Jun 2019, 11:37 last edited by jsulm 6 Nov 2019, 11:38@Marco-Palestro said in Disabling characters interpretation:
QLineEdit is used while editing, but then the text is displayed through a QPushButton
This is an important information. So, it's not QLineEdit but QPushButton.
I just checked: you need to put && instead of &. That means, before setting the text in the button you need to double & -
wrote on 11 Jun 2019, 12:09 last edited by
Yes, thank you!
Regards
Marco
1/5