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 create a custom context menu for Qtableview
Forum Updated to NodeBB v4.3 + New Features

How to create a custom context menu for Qtableview

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 6.6k 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.
  • A Offline
    A Offline
    adnan
    wrote on last edited by
    #1

    I tried setting context menu policy to action context menu but no context menu is displayed on right click

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

      I tried setting context menu policy to
      custom context menu but no context
      menu is displayed on right click

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mlong
        wrote on last edited by
        #3

        I merged these two threads, because I think you're asking the same question, perhaps?

        Software Engineer
        My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lgeyer
          wrote on last edited by
          #4

          If you set the contextMenuPolicy to ActionsMenuContext make sure you've actually set some QActions for the widget.

          If you set the contextMenuPolicy to CustomContextMenu make sure you've connected to the customContextMenuRequested signal. You will have to show the context menu manually there.

          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