-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode.txt
More file actions
22 lines (16 loc) · 712 Bytes
/
code.txt
File metadata and controls
22 lines (16 loc) · 712 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
QTimer *timer31= new QTimer(this); //by douya
connect(timer31, SIGNAL(timeout()),this,SLOT(restoreDB()));
timer31->start(60*1000);
void Widget::restoreDB(){
QSqlDatabase data_base = QSqlDatabase::addDatabase("QSQLITE");
data_base.setlDatabaseName("qdg.db");
if(!data_base.open())
qDebug()<<"douya: failed to connect to ";
else
{
qDebug()<<"douya:success";
}
QSqlQuery query(data_base);
query.exec(QString("delete from sys_log where logid not in (select logid from sys_log order by time desc limit 8000 );"));
qDebug()<<"douya:ok";
}