I was wondering if anyone could direct me to an example of a login prompt that has a check box to "Remember Login Info." I would like to just write to a hidden file in the user's home directory if that kind of helps.

Here is what my main.cpp looks like that calls the login prompt, or maybe I should do it in the logindialog.cpp:

Qt Code:
  1. #include <QtGui/QApplication>
  2. #include <QDesktopWidget>
  3. #include <QSqlError>
  4. #include <QMessageBox>
  5. #include <QSqlDatabase>
  6.  
  7. #include "entryform.h"
  8. #include "mainwindow.h"
  9. #include "logindialog.h"
  10.  
  11. int main(int argc, char *argv[])
  12. {
  13. QString strRejected = "";
  14. QApplication a(argc, argv);
  15. LoginDialog dlg;
  16. dlg.setWindowTitle("Login");
  17. QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
  18. if( dlg.exec() == QDialog::Accepted ){
  19. db.setHostName(dlg.loginDlgUi.serverLE->text());
  20. db.setDatabaseName(dlg.loginDlgUi.databaseLE->text());
  21. db.setUserName(dlg.loginDlgUi.usernameLE->text());
  22. db.setPassword(dlg.loginDlgUi.passwordLE->text());
  23. if ( db.open() ) {
  24. MainWindow w;
  25. QRect r = w.geometry();
  26. r.moveTopLeft(QApplication::desktop()->availableGeometry().topLeft());
  27. w.setGeometry(r);
  28.  
  29. w.resize(800, 650);
  30. w.show();
  31. return a.exec();
  32. }
  33. } else {
  34. QMessageBox::information(0,"Login Canceled!","Login Canceled!");
  35. return 1;
  36. }
  37. strRejected = QString("The Login was rejected because: %1").arg(db.lastError().text()).toLatin1();
  38. QMessageBox::information(0,"Login Rejected!",strRejected);
  39. return 2;
  40. };
To copy to clipboard, switch view to plain text mode 

Thanks in advance

fnmblot