change qtDatabase::nextRecord() to detect end of records

Hi,
I'ts new for me but I can send you Pull request with GitHub.
Best Regrards
Matthieu