addDatabase() returns a QSqlDatabase object and nothing but a QSqlDatabase object so X has to be of type QSqlDatabase.

Anyhow, QSqlDatabase will handle all the connections for you behind the scenes so you don't have to put them in a list - or keep them around at all. Just use QSqlDatabase::database() whenever you need one of the connections that you have created.

Relevant docs:
http://doc.trolltech.com/4.4/qsqldat...ml#addDatabase
http://doc.trolltech.com/4.4/qsqldatabase.html#database