/** A static function to get some using CInputDialog. */ const QString CInputDialog::getText ( const QString& caption, const QString& description, const QString& text, bool* ok, QWidget* parent, Qt::WindowFlags wflags) { CInputDialog* dlg = new CInputDialog(caption, description, text, parent, wflags); QString ret = QString::null; *ok = (dlg->exec() == QDialog::Accepted) ? true : false; if (*ok) { //qDebug() << "dialog was accepted, return text: " << dlg->text(); ret = dlg->text(); } delete dlg; return ret; }
/** A static function to get some using CInputDialog. */ const QString CInputDialog::getText( const QString& caption, const QString& description, const QString& text, bool* ok, QWidget* parent, bool modal) { CInputDialog* dlg = new CInputDialog(caption, description, text, parent, "", modal); QString ret = QString::null; const bool isOk = (dlg->exec() == CInputDialog::Accepted); if (isOk) { ret = dlg->text(); } if (ok) { //change the ok param to return the value *ok = isOk; } delete dlg; return ret; }