Read int from dialog
#include <QtGui>
int main (int argc, char* argv[]) {
QApplication app(argc, argv);
QTextStream cout(stdout, QIODevice::WriteOnly);
int factArg = QInputDialog::getInteger(0, "Calculator","value:", 1);
QString response = QString("The factorial of %1 is %2.\n%3").arg(factArg).arg(1);
int answer = QMessageBox::question(0, "Play again?", response,QMessageBox::Yes | QMessageBox::No);
}
Related examples in the same category