Results 1 to 8 of 8

Thread: Disable popup menu

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2009
    Posts
    29
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Disable popup menu

    in this case, the Action will not be displayed. But cannot do any operation on clicking QMenu.
    I did a solution as: handled mousePressEvent/mouseReleaseEvent in a derived class of QMenu. Then i can perform the operation in menu click and no action needed here. But still i have a problem that the selection and focus is still in menu. So if i need to click another button i need to click it twice. I am not sure how to remove the selection and focus from menu.

  2. #2
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Disable popup menu

    umm, how about setFocusPolicy(Qt::NoFocus)..but then it'll never have the focus..is that how you want it?

  3. #3
    Join Date
    Feb 2009
    Posts
    29
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Disable popup menu

    i have found a solution:: send MouseButtonPress event in Release event.

    {
    QMouseEvent Event(QEvent::MouseButtonPress, pos(), Qt::LeftButton, 0, 0);
    QApplication::sendEvent(this, &Event);
    }
    Now it is working.......

Similar Threads

  1. Popup menu for a QGraphicsItem?
    By Morea in forum Qt Programming
    Replies: 4
    Last Post: 4th February 2009, 21:27
  2. multi level menu popup
    By MrGarbage in forum Qt Programming
    Replies: 1
    Last Post: 28th September 2007, 08:06
  3. Replies: 4
    Last Post: 25th June 2007, 20:40
  4. ListView Dynamic Popup menu
    By raphaelf in forum Newbie
    Replies: 3
    Last Post: 14th October 2006, 19:26
  5. Replies: 6
    Last Post: 14th April 2006, 05:39

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.