how to put a password in C ++

  c++, key, qt, qt-creator
QString m_usuario = ui->txtUsuario->text();
QString contrasenia = ui->txtContrasenia->text();

if(contrasenia.isEmpty()){
    QMessageBox::warning(this,"AVISO", "No ha ingresado la contraseƱa");
    return;

    while (ui->txtContrasenia->text()!=clave) {
        QMessageBox::warning(this,"AVISO", "ContraseƱa incorrecta");

    }

}else {

    ui->groupDatos->setVisible(true);
}

I want to put a password in an interface, when it is correct I open the goupBox that I have visible (it is called goupDatos)
But I only get the message that I have not entered the password, and I want to enter the password.

I have the username and password defined as a macro called

#define clave 2005
#define usuario 2021

Source: Windows Questions C++

LEAVE A COMMENT