File indexing completed on 2024-04-28 15:32: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 a.setAttribute(Qt::AA_UseHighDpiPixmaps, true); 0016 0017 KNewPasswordDialog dlg; 0018 dlg.setPasswordStrengthWarningLevel(30); 0019 dlg.setPrompt(QApplication::translate("main", "Enter a password for the test")); 0020 0021 if (dlg.exec()) { 0022 std::cout << "Entered password: " << qPrintable(dlg.password()) << std::endl; 0023 return 0; 0024 } else { 0025 std::cout << "No password" << std::endl; 0026 return -1; 0027 } 0028 }