QSqlQuery::size() may not be supported on databases/all platforms. Using QSqlQuery::first() and QSqlQuery::next() could be more reliable.