Advertisement
Guest User

Untitled

a guest
Apr 28th, 2015
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. bool createDBTables()
  2. {
  3. QSqlQuery query;
  4. query.exec("DROP TABLE contacts");
  5. return query.exec("CREATE TABLE contacts ("
  6. "id INTEGER PRIMARY KEY AUTOINCREMENT, "
  7. "name VARCHAR(256) NOT NULL, "
  8. "status VARCHAR(1024), "
  9. "profpic VARCHAR(256), "
  10. "register_state INTEGER NOT NULL, "
  11. }
  12.  
  13. void MainWindows::showAccountDeactivation()
  14. {
  15. QMessageBox msgBox(this);
  16. QFont font = msgBox.font();
  17. msgBox.setWindowTitle(CGlobalZone::m_softwareName);
  18. msgBox.setInformativeText(tr("Are you sure you want to remove your account?"));
  19. msgBox.setStandardButtons(QMessageBox::Ok| QMessageBox::Cancel);
  20. msgBox.setDefaultButton(QMessageBox::Cancel);
  21. msgBox.setButtonText(QMessageBox::Ok , tr("Ok"));
  22. msgBox.setButtonText(QMessageBox::Cancel , tr("Cancel"));
  23. int ret = msgBox.exec();
  24. switch (ret)
  25. {
  26. case QMessageBox::Ok:
  27. {
  28. createDBTables();
  29. }
  30. break;
  31. case QMessageBox::Cancel:
  32. QTimer::singleShot(1500, this, SLOT(close()));
  33. break;
  34. }
  35. }
  36.  
  37. #ifndef MAIN_H
  38. #defing MAIN_H
  39.  
  40. bool createDBTables();
  41.  
  42. #endif // MAIN_H
  43.  
  44. #include "Main.h"
  45. ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement