1.使用MySQL
QmlSqlDatabase{
id: mainConnection
connectionName: "myTestSQL"
// Set the source of the database
//source: "127.0.0.1"
source: $Config.getResult("_Mysql_IP")
// set the database Name
databaseName: $Config.getResult("_Mysql_Database")
// set the User of the connection
user: $Config.getResult("_Mysql_UserName")
// set the password for that User
password: $Config.getResult("_Mysql_PassWord")
// set the port for the connection
port: $Config.getPort()
// set the driver to use
databaseDriver: QmlSqlDatabase.MySql
// add the database to memory so we can call over and over again
Component.onCompleted: {
addDataBase()
}
// Run the query to fill the model
// ! make sure that you are connected first !
onConnectionOpened: queryModel.exec()
}
2.出现以下错误
3.修复一下LSP.(CMD管理员模式)
netsh winsock reset
4.当前目录
QString QReadJson::CurrentPath =QDir::currentPath();//并不是exe目录