Ok.
I'm downloading the PostgreSQL for Windows to compile the plugin.

So you think that is necessary only once to initialize QSqlDatabase?

The class should be only to make queries? In this case I can not close the connection, right?

db.close();