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. [SOLVED] QTableWidget: how to find if return key pressed on on_tableWidget_pressed event?
QtWS25 Last Chance

[SOLVED] QTableWidget: how to find if return key pressed on on_tableWidget_pressed event?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 1 Posters 6.9k 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.
  • ? This user is from outside of this forum
    ? This user is from outside of this forum
    Guest
    wrote on last edited by
    #1

    Hi, I like to know how to find if return key on a was pressed on a QTableWidget row using on_tableWidget_pressed
    event? thanks.

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      pressed() is not an event. It's a signal. You can't get the pressed key with it, only the item.

      Subclass QTableWidget and reimplement "keyPressEvent":http://qt-project.org/doc/qt-5/qwidget.html#keyPressEvent or use "event filter":http://qt-project.org/doc/qt-5/qobject.html#installEventFilter if you don't want to subclass.

      1 Reply Last reply
      0
      • ? This user is from outside of this forum
        ? This user is from outside of this forum
        Guest
        wrote on last edited by
        #3

        all right, I understand now, thanks.

        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