-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgetpassword.h
45 lines (37 loc) · 914 Bytes
/
getpassword.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef GETPASSWORD_H
#define GETPASSWORD_H
#include <QGroupBox>
#include <QMessageBox>
#include <QtSql>
#include <QSqlDatabase>
namespace Ui {
class getpassword;
}
class getpassword : public QGroupBox
{
Q_OBJECT
public:
explicit getpassword(QWidget *parent = nullptr);
~getpassword();
QSqlDatabase mydb;
void connClose(){
mydb.close();
mydb.removeDatabase(QSqlDatabase::defaultConnection);
}
bool connOpen(){
mydb=QSqlDatabase::addDatabase("QSQLITE");
mydb.setDatabaseName("C:/Users/tminh/OneDrive/Máy tính/Db/mydb.sqlite");
if(!mydb.open()){
qDebug()<<("File not opened");
return false;
}else {
qDebug()<<("File opened");
return true;
}
}
private slots:
void on_submitButton_2_clicked();
private:
Ui::getpassword *ui;
};
#endif // GETPASSWORD_H