Files
RedBear-OS/local/recipes/kde/kf6-kwidgetsaddons/source/tests/knewpassworddialogtest.cpp
T
2026-04-14 10:51:06 +01:00

28 lines
690 B
C++

/*
This file is part of the KDE libraries
SPDX-FileCopyrightText: 2007 Olivier Goffart <ogoffart at kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#include <iostream>
#include <knewpassworddialog.h>
#include <qapplication.h>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
KNewPasswordDialog dlg;
dlg.setPasswordStrengthWarningLevel(30);
dlg.setPrompt(QApplication::translate("main", "Enter a password for the test"));
if (dlg.exec()) {
std::cout << "Entered password: " << qPrintable(dlg.password()) << std::endl;
return 0;
} else {
std::cout << "No password" << std::endl;
return -1;
}
}