//头文件
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QSqlError>
#include <QSqlDriver>
//从ini文件中读取数据库相关ip、name
bool createConnection()
{
QSqlDatabase db = QSqlDatabase::addDatabase("QPSQL");//添加数据库驱动
QSettings m_set(qApp->applicationDirPath() + "/config/" + "SPSDB.ini", QSettings::IniFormat);
QString ip = m_set.value("DBInfo/ip").toString