Results 1 to 2 of 2

Thread: How to create this button

  1. #1
    Join Date
    May 2012
    Location
    Bangalore, India
    Posts
    271
    Thanks
    29
    Thanked 50 Times in 47 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default How to create this button

    Untitled.png
    How to create this type of button after clicking which shows the custom menu like this:-
    Untitled1.png
    Heavy Metal Rules. For those about to rock, we salute you.
    HIT THANKS IF I HELPED.

  2. The following user says thank you to sonulohani for this useful post:


  3. #2
    Join Date
    Dec 2012
    Posts
    90
    Thanks
    5
    Thanked 20 Times in 18 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to create this button

    First you should create a tool button, then add QMenu to it. That simple
    Qt Code:
    1. QMenu *menu = new QMenu (this->ui.toolButton);
    2. // see overloads
    3. menu->addAction ("Hello");
    4. menu->addAction ("There");
    5. this->ui.toolButton->setMenu (menu);
    6. // that mode enables drop-down arrow, you can also try another modes
    7. this->ui.toolButton->setPopupMode (QToolButton::MenuButtonPopup);
    To copy to clipboard, switch view to plain text mode 

  4. The following 2 users say thank you to lanz for this useful post:

    sonulohani (16th May 2013)

Similar Threads

  1. Replies: 3
    Last Post: 12th March 2013, 10:16
  2. How can I create button from arraylist.
    By electronicboy in forum Qt Programming
    Replies: 5
    Last Post: 5th October 2009, 20:25
  3. How to create a custom Button?
    By Mister_Crac in forum Qt Programming
    Replies: 18
    Last Post: 22nd October 2006, 23:59
  4. Create a new button
    By avis_phoenix in forum Qt Programming
    Replies: 7
    Last Post: 3rd September 2006, 18:56
  5. How to create an Insert/Submit button for a form.
    By fnmblot in forum Qt Programming
    Replies: 5
    Last Post: 4th August 2006, 16:18

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.