Results 1 to 2 of 2

Thread: push button

  1. #1
    Join Date
    May 2014
    Posts
    8
    Thanks
    4
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default push button

    Hello ^^
    my idea: i have a global variable and i want to use just two values to this variable so i'm thinking to add a push button to my gui, when i click it should give me two choices if i click any choice my global variable get the corresponding value.

    i did search about qpushbutton i found something about setmenu() and menu() but i don't know how to use it , plz help with detail plz ^^

  2. #2
    Join Date
    Oct 2012
    Posts
    132
    Thanks
    10
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: push button

    should give me two choices
    What do you want exactly? You might want to use a QMessageBox to show a selection when the clicked-signal of the QPushButton is emitted. With QPushButton::setMenu(...) you can set a popup menu which will be shown automatically when the user clicks the button.

    i have a global variable
    I can just guess what you're trying to achive, but I think a using a member variable would be a better choice.

Similar Threads

  1. Need help to design push button
    By keyurparekh in forum Qt Programming
    Replies: 4
    Last Post: 29th March 2011, 13:39
  2. Push Button with image?
    By steve.bush in forum Newbie
    Replies: 10
    Last Post: 18th March 2011, 06:48
  3. Bitmap on Push Button in QT 3
    By Gokulnath in forum Newbie
    Replies: 2
    Last Post: 12th January 2011, 07:34
  4. Hareware Push Button
    By mickeyk191 in forum Newbie
    Replies: 2
    Last Post: 26th January 2010, 12:41
  5. A very small push button
    By Gnurou in forum Qt Programming
    Replies: 2
    Last Post: 15th November 2009, 03:04

Tags for this Thread

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.