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. QTextEdit keyPressEvent(enter)
Forum Update on Monday, May 27th 2025

QTextEdit keyPressEvent(enter)

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 1.2k 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.
  • D Offline
    D Offline
    Dl10
    wrote on last edited by
    #1

    hi, i use PyQt5 and QTextEdit.
    i build small QTextEdit and i want when i click "enter" on box QTextEdit i want
    to call the function keyPressEvent, but this dont work.
    when i click "enter" this down on box QTextEdit .
    help, tnx.

    jsulmJ 1 Reply Last reply
    0
    • D Dl10

      hi, i use PyQt5 and QTextEdit.
      i build small QTextEdit and i want when i click "enter" on box QTextEdit i want
      to call the function keyPressEvent, but this dont work.
      when i click "enter" this down on box QTextEdit .
      help, tnx.

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

      @Dl10 Sorry, I don't understand your description. What "box" do you mean?
      Did you subclass QTextEdit and overwritten keyPressEvent?
      If so can you post the code?

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

      1 Reply Last reply
      1
      • D Offline
        D Offline
        Dl10
        wrote on last edited by
        #3

        i want to do some "input" then i press "enter" i call the keyPressEvent

        jsulmJ 1 Reply Last reply
        0
        • D Dl10

          i want to do some "input" then i press "enter" i call the keyPressEvent

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

          @Dl10 Again: did you subclass QTextEdit and overwrite keyPressEvent?
          Or where do you call keyPressEvent?
          Here an example: http://doc.qt.io/qt-5/qtwidgets-widgets-tetrix-example.html

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

          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