Maybe I lost my intelligence, but I really do not why this code do not behave correctly.

Qt Code:
  1. bool loginDialog::check()
  2. {
  3. qDebug()<<"LD check"<<usernames<<passwords;
  4. qDebug()<<"LD input"<<username<<password<<usernames.contains(username.trimmed());
  5. if (usernames.contains(username.trimmed()))
  6. {
  7. p = passwords.at(usernames.indexOf(username));
  8. qDebug()<<"LD password"
  9. "input"<<p<<QCryptographicHash::hash(password.toLocal8Bit(),QCryptographicHash::Md5);
  10. in = QCryptographicHash::hash(password.toLocal8Bit(),QCryptographicHash::Md5);
  11.  
  12. if ( in == p)
  13. {
  14. qDebug()<<"ACCEPTED"<< p.toLocal8Bit() << in;
  15. return true;
  16. }
  17. else
  18. {
  19. qDebug()<<"NO ACCEPTED"<<in<<p;
  20. return false;
  21. SleeperThread::msleep(900);
  22. }
  23.  
  24. }
  25. return false;
  26. }
To copy to clipboard, switch view to plain text mode 

The output at run is as follow
Qt Code:
  1. LD check ("administrator") ("!#/)zW¥§C?JJ?Ã")
  2. LD input "administrator" "admin" true
  3. LD passwordinput "!#/)zW¥§C?JJ?Ã" "!#/)zW¥§C?JJ?Ã"
  4. NO ACCEPTED "!#/)zW¥§C?JJ?Ã" "!#/)zW¥§C?JJ?Ã"
To copy to clipboard, switch view to plain text mode 

As you can see the variables "in" and "p" have the same value, but the "if" lands always in the NO ACCEPTED state.
Regards