Could not open the PostgreSQL database in Qt -
could not open postgresql database qt.
qdebug()<<qsqldatabase::drivers() qsqldatabase_database=qsqldatabase::adddatabase("qpsql"); qsqldatabase_database.setdatabasename("myapp"); qsqldatabase_database.sethostname("localhost"); qsqldatabase_database.setport(5432); qsqldatabase_database.setusername("postgres"); qsqldatabase_database.setpassword("1"); if(!qsqldatabase_database.open()) { qdebug()<<"could not open database"; qdebug()<<qsqldatabase_database.lasterror().text(); } else { qdebug()<<connected; }
output:
"qpsql,qpsql7" "could not open database" "driver not loaded driver not loaded"
it windows 7 64 bit pc.
in pc qt not installed.
but in qt(qt 5.4) installed pc(windows 7 32 bit) working perfectly!
Comments
Post a Comment