Use of popup window
-
you might want to "check out":http://doc.qt.nokia.com/4.7/qmessagebox.html#addButton
-
hello volker
I have tried it like this..it work but it add only one button at a time..
@QMessageBox messageBox(this);
QAbstractButton *addButton =
messageBox.addButton(tr("Add"), QMessageBox::ActionRole);messageBox.exec(); if (messageBox.clickedButton() == addButton) exit(0);@
i mean to say that if i want to add two or more button the same messagebox than what should i do here if i add another button say save in the message box than it only display save button ..
-
If you want to do that.. use the static members of QMessageBox and pass the StandardButtons with "|" like Ok | Cancel.
"Documentation":http://doc.qt.nokia.com/latest/qmessagebox.html#static-public-members
-
Did you try reading the documentation for QMessageBox? Did you find a method there to gain access to the actual buttons? If no, you did not look hard enough, and should look again. Come on: you have been told over and over again to read the docs better. You are even telling others to do that. The time you have wasted on this (and other topics) would be better spend studying the documentation.
-
yeh i have tried the doc example its working but the thing is that in simulator it show all three button in message box but in device it only show two buttons instead of three..the code i have written is..
@QMessageBox msgBox;
QPushButton *connectButton = msgBox.addButton(tr("Ok"), QMessageBox::ActionRole);
QPushButton *connectButton1 = msgBox.addButton(tr("AddNotes"), QMessageBox::ActionRole);
QPushButton *abortButton = msgBox.addButton(QMessageBox::Abort);msgBox.exec(); if (msgBox.clickedButton() == connectButton) { // connect } else if (msgBox.clickedButton() == abortButton) { // abort }@