Advertisement
Guest User

Qt creator

a guest
Apr 26th, 2015
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. #include "mainwindow.h"
  2. #include "ui_mainwindow.h"
  3.  
  4. MainWindow::MainWindow(QWidget *parent) :
  5.     QMainWindow(parent),
  6.     ui(new Ui::MainWindow)
  7. {
  8.     ui->setupUi(this);
  9. }
  10.  
  11. MainWindow::~MainWindow()
  12. {
  13.     delete ui;
  14. }
  15.  
  16. void MainWindow::on_Register_Button_clicked()
  17. {
  18.     ShellExecute( NULL, L"open", L"http://www.mpcforum.pl/", L"", L"", SW_SHOWNORMAL );
  19. }
  20.  
  21. void MainWindow::on_Login_Button_clicked()
  22. {
  23.     QString username;
  24.     QString password;
  25.  
  26.     username = ui->Username_Form->text();
  27.     password = ui->Password_Form->text();
  28.  
  29.     QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
  30.     db.setHostName("localhost");
  31.     db.setDatabaseName("testdb");
  32.     db.setUserName("root");
  33.     db.setPassword("rootpassword");
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement