Results 1 to 2 of 2

Thread: QPushButton PopUp menu

  1. #1
    Join Date
    Jun 2007
    Posts
    23
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QPushButton PopUp menu

    Hi,

    I have a small peice of code

    Qt Code:
    1. QMenu *menu = new QMenu(this);
    2. menu->addAction("Testaaaaaaaaaaaaaaaaaaaaa");
    3. menu->addAction("Test1");
    4. menu->addAction("Test2");
    5.  
    6. pushButton->setMenu(menu);
    To copy to clipboard, switch view to plain text mode 

    This will add menu to pushbutton, when i click menu it starts showing menu from left handside i.e start of QPushButton (bottom left) but i would like the menu to start drawing from right hand side of QPushButtoh i.e. end of QPushButton (bottom right), can some one guide me how is this possible..?

    Thanks..!
    Last edited by jpn; 6th February 2008 at 10:50. Reason: missing [code] tags

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QPushButton PopUp menu

    Perhaps you could subclass QMenu, reimplement QWidget::showEvent() and shift the menu to the bottom right corner of QWidget::parentWidget().
    J-P Nurmi

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. PopUp a Menu when showing FullScreen
    By Lele in forum Qt Programming
    Replies: 2
    Last Post: 29th May 2007, 10:04
  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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.