PDA

View Full Version : push button



arumita
2nd June 2014, 20:54
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 ^^

Infinity
3rd June 2014, 01:02
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.