Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Disabling characters interpretation

Disabling characters interpretation

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 470 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Marco Palestro
    wrote on last edited by
    #1

    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

    jsulmJ 1 Reply Last reply
    0
    • M Marco Palestro

      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

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @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?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Marco Palestro
        wrote on last edited by
        #3

        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?

        jsulmJ 1 Reply Last reply
        0
        • M Marco Palestro

          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?

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by jsulm
          #4

          @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 &

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          2
          • M Offline
            M Offline
            Marco Palestro
            wrote on last edited by
            #5

            Yes, thank you!
            Regards
            Marco

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved