Use libpq directly or use psqlODBC via the Windows ODBC APIs. You do not need both. You don't seem to be using psqlODBC at all, so we can ignore that, it doesn't matter that it's installed.
Your code looks OK, though you really should be using snprintf to prevent overrunning the size of your statically allocated conninfo buffer and introducing a stack overwrite exploit via buffer overflow into your code.
You should also check for connection errors:
if (PQstatus(connection) != CONNECTION_OK)
{
qDebug() << "Connection failed: " << PQerrorMessage(connection);
exit(1);
}
I suspect that you are having issues related to multiple, probably incompatible, versions of libpq. You are probably compiling against the libpq.lib for one libpq, but then at runtime linking to another libpq. This is especially likely with Qt, which provides its own SQL interface classes that may link to libpq.
To diagnose what's happening will probably require use of a debugger. Since you're on Windows, that means Visual Studio, because windbg.exe is only for masochists. If you do not have Visual Studio, get the free Express version here. You need "Express 2013 for Windows Desktop". (Microsoft changes the names in new and confusing ways with each release). Run your program under Visual Studio's debugger, and when it crashes, examine how/why.
As @kiln points out there's also QSql ... but it's very limited and IMO unsuitable for production applications where database access is a significant priority. (Edit: It looks like it's a lot better in Qt 5.4; I hadn't used it much since Qt4, and they've finally fixed the biggest omissions that made QtSQL practically unusable in the real world now, like the lack of access to the native SQLSTATE from the DB, lack of parameter binding, etc).
libpqdirectly or use psqlODBC via the Windows ODBC APIs. You do not need both.