So instead of this:
QSqlQuery createQuery(DB);
qDebug()<< "open: " << DB.open();
do this
qDebug()<< "open: " << DB.open();
QSqlQuery createQuery(DB);
https://stackoverflow.com/questions/21796961/sqlite-out-of-memory-unable-to-execute-statement