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. How to implement a right mouse pop menu when I click on row of QTableWidget?
Forum Updated to NodeBB v4.3 + New Features

How to implement a right mouse pop menu when I click on row of QTableWidget?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 643 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.
  • Q Offline
    Q Offline
    Qt Enthusiast
    wrote on last edited by A Former User
    #1

    (see title)

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by VRonin
      #2

      http://doc.qt.io/qt-5/qwidget.html#contextMenuPolicy-prop
      http://doc.qt.io/qt-5/qwidget.html#customContextMenuRequested
      http://doc.qt.io/qt-5/qtableview.html#indexAt

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      1 Reply Last reply
      3
      • goldenhawkingG Offline
        goldenhawkingG Offline
        goldenhawking
        wrote on last edited by
        #3

        The answer above is correct!!

        1. add actions to the target widget.
        2. Set the contextMenuPolicy to "action"
        3. catch the triggered() signal and do things you want.

        Qt is the best C++ framework I've ever met.

        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