I have two QSqlDatabase database connections, "local" and "remote". I have a function that uses both connections (get data from local db and send to remote db). When I run this function from my QThread class, the local connection works (I got expected data), but the remote connection fails. But if I run this function outside the QThread class (in main()), both connections works.I have two QSqlDatabase database connections, "