-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdbctestwidget.cpp
More file actions
43 lines (30 loc) · 1.21 KB
/
Copy pathdbctestwidget.cpp
File metadata and controls
43 lines (30 loc) · 1.21 KB
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
#include "dbctestwidget.h"
DBCTestWidget::DBCTestWidget(QWidget *parent):QWidget(parent)
{
testDBName="xxxx";
QLabel *label=new QLabel(this);
label->setGeometry(100,100,400,400);
SQLDataBase::instance()->connectionDB(testDBName);
// QImage *image=new QImage();
// QImage image;
// Terran terran;
// terran.id=1;
// QList<Terran> list;
// list.append(terran);
// SQLDataBase::instance()->operationDB(testDBName, SQLDataBase::OperationWay::LoadDBImage,list,&image);
Terran terran2;
terran2.id=350;
QList<Terran> list2;
list2.append(terran2);
SQLDataBase::instance()->operationDB(testDBName, SQLDataBase::OperationWay::SelectDBWithId,list2);
qDebug()<<list2.first().typeOfWork;
list2.first().typeOfWork=true;
qDebug()<<list2.first().typeOfWork;
SQLDataBase::instance()->operationDB(testDBName, SQLDataBase::OperationWay::UpdateDB,list2);
SQLDataBase::instance()->operationDB(testDBName, SQLDataBase::OperationWay::SelectDBWithId,list2);
qDebug()<<list2.first().typeOfWork;
// qDebug()<<image.byteCount();
// if(image.byteCount()>0){
// label->setPixmap(QPixmap::fromImage(image));
// }
}