cmysqlplugin.h cdbinterface.h QtCore QObject QString QSqlDatabase dMySQL/cmysqlplugin.cpp cMySQLPlugin #ifndefCMYSQLPLUGIN_H #defineCMYSQLPLUGIN_H #include"cdbinterface.h" #include<QtCore> #include<QObject> #include<QString> #include<QSqlDatabase> classcMySQLPlugin:publicQObject,publiccDBInterface { Q_OBJECT Q_PLUGIN_METADATA(IID"cMySQLPlugin"FILE"dMySQL.json") Q_INTERFACES(cDBInterface) public: qint16pluginAPIVersion(){return(1);} QStringpluginName(){return("MySQLDB");} qint16pluginVersion(){return(1);} iTypepluginType(){return(cInterface::iTypeDB);} boolconnect(); boolinit(); QStringlastError(); boolconfig(); protected: boolopen(); QSqlDatabasem_db; QStringm_szLastError; }; #endif//CMYSQLPLUGIN_H