Results 1 to 2 of 2

Thread: QAction with QMenu click event

  1. #1
    Join Date
    Sep 2009
    Location
    Warsaw/Poland
    Posts
    56
    Thanks
    8
    Thanked 4 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QAction with QMenu click event

    Hello,

    I've got QAction with set QMenu, and I have little problem.
    When I click on whole button where is nothing, but when i click on little arrow on right - menu is showing.
    What I need to change to showing menu when I'm clicking on whole button (not only arrow) ?

    Something like this:

    Qt Code:
    1. action->menu()->exec(QCursor::pos())
    To copy to clipboard, switch view to plain text mode 

    but this method is showing different that original clicking on button arror.
    So what is original function to show that menu on action ?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QAction with QMenu click event

    Set the popup mode of the button associated with the action to QToolButton::InstantPopup
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    mero (22nd July 2012)

Similar Threads

  1. QMenu does not show icons from QAction
    By eumel1990 in forum Newbie
    Replies: 5
    Last Post: 10th September 2011, 10:57
  2. Can't disable a QAction in QMenu
    By punkypogo in forum Qt Programming
    Replies: 3
    Last Post: 10th August 2010, 14:07
  3. how to add QMenu or QAction inside QDesigner
    By eric_vi in forum Qt Tools
    Replies: 1
    Last Post: 2nd August 2009, 16:48
  4. QAction text color (QMenu)
    By StefanK in forum Qt Programming
    Replies: 1
    Last Post: 20th March 2009, 15:14
  5. QPushButton QMenu QAction
    By hgedek in forum Newbie
    Replies: 2
    Last Post: 1st November 2007, 12:29

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.