To get the accurate row count for a SqlQueryModel, you can use the 'rowCount()' function provided by the model. Here's an example:

SqlQueryModel *model = new SqlQueryModel();
model->setQuery('SELECT * FROM myTable');

int rowCount = model->rowCount();

The 'rowCount()' function returns the number of rows in the model. Note that the row count may be limited by the query or the database settings, so it may not be the total number of rows in the table.

Also, keep in mind that if the query includes 'GROUP BY' or 'DISTINCT' clauses, the row count will not match the actual number of distinct rows in the table.

Accurate Row Count for SqlQueryModel in C++