Your parameter datos can be both not NULL and not valid. Are you sure you are passing a valid pointer that is still valid when this code uses it?

BTW,it is a little unusual to pass a QSqlDatabase by pointer.