qtc-askpass: Quit after retrieving the password

Task-number: QTCREATORBUG-29619
Change-Id: Ib279ec43b7f67b8eac593d9e2f9800a65db024b7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Christian Kandeler
2023-09-19 11:16:56 +02:00
parent 0a7eebc9c4
commit 2f80ef7f23

View File

@@ -18,8 +18,10 @@ int main(int argc, char *argv[])
labelText.append('\n').append(appArgs.at(1));
dlg.setLabelText(labelText);
dlg.setTextEchoMode(QLineEdit::Password);
if (dlg.exec() == QDialog::Accepted)
const bool accepted = dlg.exec() == QDialog::Accepted;
if (accepted)
std::cout << qPrintable(dlg.textValue()) << std::endl;
qApp->exit(accepted ? 0 : 1);
});
return app.exec();
}