Use QSqlDatabase as the only active session
General and Desktop
2
Posts
2
Posters
843
Views
1
Watching
-
Hi guys,
I'm a newbie in Qt and my situation is as follows: I'm developing a system with which I need to connect to a database, particularly PostgreSQL.
I have a home screen that allows log in (connect to the database with a username and password). After the start of session to be successful, i need to interact with information in the database. Obviously, I want to have only one active session database.
My question is, i can use QSqlDatabase to accomplish this? or i need to implement a singleton as best solution? If i can use the QSqlDatabase, how do you do to manage a single instance in the whole system?Best Regards.