mardi 27 janvier 2015

how to create multiple connections in qt sqlite?

I have already created a db with the tables. Now, I want to create multiple connections for each thread.


Here is my idea. I will create the QMap m_sql_db_list;


When the db operations are done, I will get the pid_t gettid(void); If the pid is present in the qmap, I will use that QSqlDatabase for the db operations. In case, it is not there, I will create a separate connection and will store the QSqlDatabase in the QMap corresponding to the thread id. My question is how should I create the connection?


Aucun commentaire:

Enregistrer un commentaire