Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

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

    General and Desktop
    1
    3
    6434
    Loading More Posts
    • 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.
    • ?
      Guest last edited by

      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 Reply Quote 0
      • Chris Kawa
        Chris Kawa Moderators last edited by

        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 Reply Quote 0
        • ?
          Guest last edited by

          all right, I understand now, thanks.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post