介绍:
QMessageBox:QT弹出的提示框
#include "widget.h"
#include <sqlite3.h>
#include <QApplication>
#include <QDebug>
#include <QMessageBox>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
sqlite3 *db=nullptr;
int res=sqlite3_open("./data/user.db",&db);
if(res==SQLITE_OK)
{
QMessageBox::information(0,"打开","恭喜你,数据库打开成功!",QMessageBox::Cancel);
}
else
{
QMessageBox::critical(0,"错误","数据库打开失败,请重新检测!",QMessageBox::Ok);
}
Widget w;
w.show();
return a.exec();
}
(1)如果数据库打开成功: QMessageBox:information( , , , )