[SailfishDevel] Connect to 2 databases

Chris Walker cdw_nokiaqt at the-walker-household.co.uk
Thu Sep 15 08:56:12 UTC 2016


On Wed, 14 Sep 2016 23:40:50 +0200
Matthias Fehring <buschmann at huessenbergnetz.de> wrote:

> Am Donnerstag, 8. September 2016, 14:40:16 CEST schrieb Chris Walker:
> > Can anybody point me in the direction of some C++ code to connect to
> > two SQL databases please?  
> 
> Does it have to be pure C++ code? If not and if it can be the Qt way,
> read on. :)
> 
> > I want to have one set as read-only and the other as read-write.
> > 
> > Whatever I'm doing is wrong as I always end up with a default
> > connection.  
> 
> Have a look at QSqlDatabase and it's addDatabase() method. [1]

Thank you Matthias for the examples. I'll take a look.


More information about the Devel mailing list