File indexing completed on 2024-04-28 03:59:18
0001 /* 0002 This file is part of the KDE libraries 0003 SPDX-FileCopyrightText: 2007 Olivier Goffart <ogoffart at kde.org> 0004 0005 SPDX-License-Identifier: LGPL-2.0-or-later 0006 */ 0007 0008 #include <iostream> 0009 #include <knewpassworddialog.h> 0010 #include <qapplication.h> 0011 0012 int main(int argc, char *argv[]) 0013 { 0014 QApplication a(argc, argv); 0015 0016 KNewPasswordDialog dlg; 0017 dlg.setPasswordStrengthWarningLevel(30); 0018 dlg.setPrompt(QApplication::translate("main", "Enter a password for the test")); 0019 0020 if (dlg.exec()) { 0021 std::cout << "Entered password: " << qPrintable(dlg.password()) << std::endl; 0022 return 0; 0023 } else { 0024 std::cout << "No password" << std::endl; 0025 return -1; 0026 } 0027 }