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. Context Menu
Forum Updated to NodeBB v4.3 + New Features

Context Menu

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

    Hello, I try to use context menus, but I have a problem. I have reimplemented contextMenuEvent(QContextMenuEvent *event), which works when using the menu key on the keyboard, but which doesn't work well when using the right mouse button (the context menu disapears on release). The menu should persist on mouse release, how do I change that?

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      I just did this. Which platform you are trying ?

      @ this->setContextMenuPolicy(Qt::ActionsContextMenu);
      QAction *action = new QAction("pthinks",this);
      this->addAction(action);
      QAction *action1 = new QAction("Bangaluru",this);
      this->addAction(action1);@

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      0
      • dheerendraD Offline
        dheerendraD Offline
        dheerendra
        Qt Champions 2022
        wrote on last edited by
        #3

        [quote author="Dheerendra" date="1408193937"] Welcome to the forum. I just did this. Which platform are you trying ?

        @ this->setContextMenuPolicy(Qt::ActionsContextMenu);
        QAction *action = new QAction("pthinks",this);
        this->addAction(action);
        QAction *action1 = new QAction("Bangaluru",this);
        this->addAction(action1);@
        [/quote]

        Dheerendra
        @Community Service
        Certified Qt Specialist
        http://www.pthinks.com

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kouros
          wrote on last edited by
          #4

          I am on Ubuntu 14.04. I want that the menu stays displayed when I release the right button. When I press the right button the menu is displayed, when I release the right button it disapears.

          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