Hello I am working with the Qt code of mythv-0.22 source code in a MythUbuntu distro in Ubuntu 9.10.
I am trying to modify the Qt code of mythv-022 for connecting to a remote database and obatining some data. I have used the Qt Developer and tried to modify the main.cpp class.
I make the following changes :
The main.h file has not been modified. I include the following .h files in the main.cpp project:
#include "qapplication.h"
#include "qsqldatabase.h"
#include "qsqlerror.h"
#include "qlabel.h"
In main.cpp I have writen the following code , which is supposed to be used for connecting to the Mysql Database:
void conection_server(void){
QSqlDatabase * conexion = QSqlDatabase::addDatabase("QMYSQL3");
conexion->setDatabaseName("mysql");
conexion->setUserName("root");
conexion->sethostName("152.168.54.5");
}
I compile and obtain the following mistake
"main.cpp:1107: error: cannot convert ´QSqlDatabase´ to ´QSqlDatabase´ in initialization"
The line 1107 is the following :
QSqlDatabase * conexion = QSqlDatabase::addDatabase("QMYSQL3");
Does anybody know how to solve this compilation mistake ?
Thanks ,Gorka
Bookmarks