Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. Restrict special characters in QTextEdit control
Forum Updated to NodeBB v4.3 + New Features

Restrict special characters in QTextEdit control

Scheduled Pinned Locked Moved C++ Gurus
5 Posts 4 Posters 4.2k Views 1 Watching
  • 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.
  • S Offline
    S Offline
    shankarraj
    wrote on last edited by
    #1

    Hi,
    I have used QTextEdit widget in my GUI. I want to restrict special characters from entering in textedit control.
    Can somebody tell me the way to do this.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      An event filter comes to find. Filter on incomming key events. If they represent a special character, simply filter out the event. Note that you also need to considder pasting in text from the clipboard.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sandy.pareek
        wrote on last edited by
        #3

        even inputmask property can help in this.
        regards
        sandy

        "my code, my life"

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on last edited by
          #4

          [quote author="sandy.pareek" date="1341821603"]even inputmask property can help in this.
          regards
          sandy[/quote]

          inputMask is a property of [[Doc:QLineEdit]] and is not available in a [[Doc:QTextEdit]].

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • S Offline
            S Offline
            sandy.pareek
            wrote on last edited by
            #5

            volker
            thank you sir.
            your correction is encouragement to us.

            http://thinkexist.com/quotation/cluelessness-there_are_no_stupid_questions-but/340958.html

            "my code, my life"

            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