hi everyone,
i want to make a connection between a qt program installed in a client machine and a postgresql database stored on a server
this is the program i wrote

#include <QtGui/QApplication>
#include<QtSql>
#include<QtDebug>
#include "mainwindow.h"

int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QSqlDatabase db =QSqlDatabase::addDatabase("QODBC");

db.setHostName("10.9.173.168"); //this ip adress is the adress of the server machine and i used it in odbc and i have connection succeful
db.setDatabaseName("khaw");
db.setPassword("khawla");
db.setUserName("postgres");
db.setPort(5432);

if(db.open())
{
qDebug() <<"opened" ;

db.close();
}
else
{
qDebug() << db.lastError().text();
}
MainWindow w;
w.show();

return a.exec();
}
but i still have the error "[Microsoft][Gestionnaire de pilotes ODBC] Source de données introuvable et nom de pilote non spécifié QODBC3: Unable to connect"
which is in english [Microsoft] [ODBC Driver Manager] Data source name not found and no default driver specified
in odbc i wrote this:
data source:khaw
database:basee
server:10.9.173.168
user nameosgres
ssl mode:disable
port:5432
password:khawla
can you tell me what i should do to connect
thanks for your reply