I have some questions for you:
I created a python-plugin in QGIS,
then I created a Qt gui fom my plugin
and at last I created a Postgres DB
now I need to make a connection between Qt-gui and Postgres-DB
I wrote this
from PyQt4.QtSql import *
db = QSqlDatabase.addDatabase("QPSQL");
db.setHostName("localhost");
db.setDatabaseName("siti");
db.setUserName("postgres");
db.setPassword("bina");
bool ok = db.open();
but it doesn't works, I can't understand what I do wrong...
I wish someone could help me...
thank you for all! lisa
No comments:
Post a Comment